Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[FIX]stock_account: stock manager group not inherit account bill group #43186

Conversation

@yhu-odoo
Copy link

yhu-odoo commented Jan 13, 2020

The inheritance of account billing group gives stock managers the access
to account module.
This commit is to remove this inheritance. When we need to access
account.move model, check if the user is a stock manager. If so, use
sudo() to get the access.

Description of the issue/feature this PR addresses:

Current behavior before PR:

Desired behavior after PR is merged:

--
I confirm I have signed the CLA and read the PR guidelines at www.odoo.com/submit-pr

@C3POdoo C3POdoo added the RD label Jan 13, 2020
@yhu-odoo yhu-odoo force-pushed the odoo-dev:master-stock-manager-inherit-accounting-yhu branch from 3cdb86b to 7b26611 Jan 13, 2020
@robodoo robodoo added CI 🤖 and removed CI 🤖 labels Jan 13, 2020
@yhu-odoo yhu-odoo force-pushed the odoo-dev:master-stock-manager-inherit-accounting-yhu branch from 7b26611 to 4d01373 Jan 14, 2020
@robodoo robodoo added CI 🤖 and removed CI 🤖 labels Jan 14, 2020
@sle-odoo

This comment has been minimized.

Copy link
Contributor

sle-odoo commented Jan 14, 2020

maybe we could replace the has_group by a create check on valuation layer? @amoyaux what do you think

@amoyaux

This comment has been minimized.

Copy link
Contributor

amoyaux commented Jan 14, 2020

same as create an ACL for account_move for stock manager in this case. The specific sudo are probably better since the stock manager is only able to create an account move during specific flow. Make it in the create would made it generic

@sle-odoo

This comment has been minimized.

Copy link
Contributor

sle-odoo commented Jan 14, 2020

nah adding a new acl for account move is a bad idea (not enough: we need account account account tag aacount analyitc tax and all that crap + duplicate the ir rules from account)

adding it in AM create is also a bad idea (inventory manager should not be able to create any account move he wants, only the ones related to the stock valuation)

what i suggested was going sudo by duck typing the read access on stock valuation layer (check_access_rule('read')), which only the inventory manager has at the moment, instead of checking the inventory manager group

yhu-odoo added 2 commits Jan 9, 2020
The inheritance of account billing group gives stock managers the access
to account module.
This commit is to remove this inheritance. When we need to access
account.move model, check if the user is a stock manager. If so, use
sudo() to get the access.

PR #43186
Task 2062611
missing bit from rev[0], [1], and [2]

[0] 7ef11e3
[1] d6c8c34
[2] 5096e72
@yhu-odoo yhu-odoo force-pushed the odoo-dev:master-stock-manager-inherit-accounting-yhu branch from 4d01373 to f0f22a8 Jan 15, 2020
@robodoo robodoo added CI 🤖 and removed CI 🤖 labels Jan 15, 2020
@sle-odoo

This comment has been minimized.

Copy link
Contributor

sle-odoo commented Jan 15, 2020

robodoo r+ rebase-ff

@robodoo

This comment has been minimized.

Copy link
Contributor

robodoo commented Jan 15, 2020

Merge method set to rebase and fast-forward

@robodoo robodoo added the r+ 👌 label Jan 15, 2020
robodoo pushed a commit that referenced this pull request Jan 15, 2020
The inheritance of account billing group gives stock managers the access
to account module.
This commit is to remove this inheritance. When we need to access
account.move model, check if the user is a stock manager. If so, use
sudo() to get the access.

PR #43186
Task 2062611
robodoo pushed a commit that referenced this pull request Jan 15, 2020
missing bit from rev[0], [1], and [2]

[0] 7ef11e3
[1] d6c8c34
[2] 5096e72

closes #43186

Signed-off-by: Simon Lejeune (sle) <sle@openerp.com>
@robodoo robodoo closed this Jan 15, 2020
@robodoo robodoo deployed to merge Jan 15, 2020 Active
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
5 participants
You can’t perform that action at this time.