Coder Social home page Coder Social logo

Comments (11)

pedrobaeza avatar pedrobaeza commented on May 14, 2024

@AdilHoumadi @legalsylvain, can you please check it?

from pos.

legalsylvain avatar legalsylvain commented on May 14, 2024

Hi @pedrobaeza,
I personaly use Odoo in multicompany context (20 companies), but without account.fiscal.position.tax. Well, maybe my question is irrelevant but don't you have to fix your problem with correct access right on account.fiscal.position.tax model ? or maybe there is some uid==1 hack in the JS ?

from pos.

pedrobaeza avatar pedrobaeza commented on May 14, 2024

The problem is that the object account.fiscal.position.tax doesn't have company_id. It's the model account.fiscal.position which has it. Reading all of them, you finally end with an access error over this parent object, because the code access to it in some moment, but I get lost in the JS code.

from pos.

legalsylvain avatar legalsylvain commented on May 14, 2024

Ok !

At first analysis, i consider that it's a core bug. (account module)

  • account.fiscal.position has company_id
  • account.fiscal.position.tax has no company_id field
  • account.fiscal.position has a one2many field to account.fiscal.position.tax

It's bad designed. It's not ? And this bug could occure in any module that use both models, not specially pos_pricelist.
Odoo is full of that kind of bugs, specially in PoS.

So I would fix your problem, adding a 'company_id' field on account.fiscal.position.tax related to the company_id field or the parent account.fiscal.position. (store = true)

What do you think ?

If you're agree, the next question is where to fix this bug. I guess not in this module but in an account_multicompany module. don't you think ?

regards.

from pos.

pedrobaeza avatar pedrobaeza commented on May 14, 2024

Well, it's the same as putting company_id on account.invoice.line, sale.order.line. They shouldn't have it because you usually access them through the main object, not directly, but when you access directly, you take into account the company of the header. Something similar should be done here: get the fiscal positions for the company, and search for the taxes lines for that fiscal positions.

from pos.

legalsylvain avatar legalsylvain commented on May 14, 2024

Well,

Sorry to insist, but in fact there are company_id fields on both models you mentioned. My PoV is that you should have company_id (and rules) defined for two reasons :

  • in some use cases, it's necessary to access to the line directly. (existing exemple is : to invoice sale order lines);
  • in any cases, for security reasons ;

ref : (V 8.0 series)

Well, if you can access to an object (account.fiscal.position.tax) that is linked to an other object you can't access (account.fiscal.position.tax), the access rules are not consistent.

Don't you think ?

from pos.

pedrobaeza avatar pedrobaeza commented on May 14, 2024

Yeah, both are related fields. Maybe we can add them in this module. If other modules need them, they will add the same field, overwriting it, and create the same rule as duplicated, but no problem on that. I'll try and tell you.

from pos.

pedrobaeza avatar pedrobaeza commented on May 14, 2024

Here is the corresponding PR that solves it: #85

from pos.

flotho avatar flotho commented on May 14, 2024

Hi,

From my point of view the model account.fiscal.position.account should also have the same kind of access rule.
regards

from pos.

legalsylvain avatar legalsylvain commented on May 14, 2024

account.fiscal.position.account Model is not loaded by pos_pricelist, doesn't it ?

from pos.

flotho avatar flotho commented on May 14, 2024

@legalsylvain you're right, I'm too excessive maybe ;-)

from pos.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.