Comments (11)
@AdilHoumadi @legalsylvain, can you please check it?
from pos.
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.
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.
Ok !
At first analysis, i consider that it's a core bug. (account module)
account.fiscal.position
hascompany_id
account.fiscal.position.tax
has nocompany_id
fieldaccount.fiscal.position
has a one2many field toaccount.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.
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.
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)
account.invoice.line
: https://github.com/odoo/odoo/blob/8.0/addons/account/account_invoice.py#L1289sale.order.line
: https://github.com/odoo/odoo/blob/8.0/addons/sale/sale.py#L944
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.
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.
Here is the corresponding PR that solves it: #85
from pos.
Hi,
From my point of view the model account.fiscal.position.account should also have the same kind of access rule.
regards
from pos.
account.fiscal.position.account
Model is not loaded by pos_pricelist, doesn't it ?
from pos.
@legalsylvain you're right, I'm too excessive maybe ;-)
from pos.
Related Issues (20)
- pos_payment_change for France HOT 3
- OCA/pos: Your 16.0 branch isn't protected HOT 5
- [14.0] pos_no_cash_bank_statement: Bug of savepoint does not exist HOT 2
- oca pos_payment_terminal connection telium HOT 1
- [16.0] pos_default_partner default partner should be visible in pos HOT 1
- After refund of 1 qty, POS qty display increased by 2 qty HOT 4
- [15.0] pos_event_sale : no way to refund hidden event HOT 1
- Error when trying to install [pos_order_reorder] on 15.0 HOT 1
- pos_stock_available_online HOT 3
- Migration to version 17.0 HOT 3
- pos_report_session_summary Error when printing the session summary. HOT 1
- [16] pos_partner_firstname Can't create a contact HOT 10
- pos_order_to_sale_order Fiscal Position applied at Header but not at OrderLines HOT 9
- [16.0]pos_payment_change change policy option not displayed
- V16 branch looks broken. HOT 8
- Tare barcode not recognized in the scaling screen HOT 3
- [RFC] Postal Code MK Estrategy HOT 6
- [RFC] Template Email for "How would you like to receive your receipt?" HOT 1
- [13.0][pos_lot_selection] - Help to migrate pos_lot_selection version 13.0 HOT 1
- error on change paiment HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from pos.