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

[FW][FIX] purchase: purchase user should be able to create vendors bills #48274

Closed

Conversation

@fw-bot
Copy link
Contributor

fw-bot commented Mar 24, 2020

Before this patch, the purchase users get an access violation error
at the invoice creation from a purchase order. This was due to
some missing ACL between v12 and v13.

Task : 2206969

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

Forward-Port-Of: #48240
Forward-Port-Of: #46961

@fw-bot

This comment has been minimized.

Copy link
Contributor Author

fw-bot commented Mar 24, 2020

Ping @Whenrow, @sle-odoo
This PR targets master and is the last of the forward-port chain.

To merge the full chain, say

@fw-bot r+

More info at https://github.com/odoo/odoo/wiki/Mergebot#forward-port

@fw-bot

This comment has been minimized.

Copy link
Contributor Author

fw-bot commented Mar 24, 2020

Ping @Whenrow, @sle-odoo

ci/runbot failed on this forward-port PR

@sle-odoo

This comment has been minimized.

Copy link
Contributor

sle-odoo commented Mar 24, 2020

@fw-bot r+

@robodoo robodoo added the r+ 👌 label Mar 24, 2020
@robodoo

This comment has been minimized.

Copy link
Contributor

robodoo commented Mar 24, 2020

@sle-odoo, you may want to rebuild or fix this PR as it has failed CI.

@C3POdoo C3POdoo added the RD label Mar 24, 2020
@Whenrow Whenrow force-pushed the odoo-dev:master-13.0-purchase-vendors-bills-zaOh-fw branch from 67939ae to 5be2f19 Mar 24, 2020
@robodoo robodoo removed the r+ 👌 label Mar 24, 2020
@fw-bot

This comment has been minimized.

Copy link
Contributor Author

fw-bot commented Mar 24, 2020

This PR was modified / updated and has become a normal PR. It should be merged the normal way (via @robodoo)

@sle-odoo

This comment has been minimized.

Copy link
Contributor

sle-odoo commented Mar 24, 2020

robodoo r+

@robodoo robodoo added the r+ 👌 label Mar 24, 2020
@Whenrow Whenrow force-pushed the odoo-dev:master-13.0-purchase-vendors-bills-zaOh-fw branch from 5be2f19 to 8503531 Mar 25, 2020
@robodoo robodoo removed the r+ 👌 label Mar 25, 2020
Whenrow added 3 commits Mar 24, 2020
This commit ensure the user have to minimum rights to post invoices
The 'Post' button was already hidden but the post() method is public

Task : 2206969

X-original-commit: 28ae3fb
The 'vendor bills' stat button on purchase order, once clicked, will
have a specific behavior depending on the invoice count :
    0 : open a new invoice with pre filled fields (not saved yet)
    1 : open the form view of the invoice
    2+: open the list view of the invoices.

Before this commit, the invoice count was computed with an environment on
the current user. That means a record rule could make the invoice count
lower than the real count and so give an unwanted behavior. Ex: create a
new invoice even if there is already one created because the user cannot
see the other people's invoices.

After this commit, the action_view_invoice with make an explicit read()
in database to fill the cache with all the purchase order's invoices and
make sure the count is the real one.

Task : 2206969

X-original-commit: e3101d9
Before this patch, the purchase users get an access violation error
at the invoice creation from a purchase order. This was due to
some missing ACL between v12 and v13.

Task : 2206969

X-original-commit: 4c4fb33
@Whenrow Whenrow force-pushed the odoo-dev:master-13.0-purchase-vendors-bills-zaOh-fw branch from 8503531 to 876550a Mar 26, 2020
@robodoo robodoo added the CI 🤖 label Mar 26, 2020
@sle-odoo

This comment has been minimized.

Copy link
Contributor

sle-odoo commented Mar 26, 2020

robodoo r+ rebase-ff

@robodoo robodoo added the r+ 👌 label Mar 26, 2020
@robodoo

This comment has been minimized.

Copy link
Contributor

robodoo commented Mar 26, 2020

Merge method set to rebase and fast-forward

robodoo pushed a commit that referenced this pull request Mar 26, 2020
The 'vendor bills' stat button on purchase order, once clicked, will
have a specific behavior depending on the invoice count :
    0 : open a new invoice with pre filled fields (not saved yet)
    1 : open the form view of the invoice
    2+: open the list view of the invoices.

Before this commit, the invoice count was computed with an environment on
the current user. That means a record rule could make the invoice count
lower than the real count and so give an unwanted behavior. Ex: create a
new invoice even if there is already one created because the user cannot
see the other people's invoices.

After this commit, the action_view_invoice with make an explicit read()
in database to fill the cache with all the purchase order's invoices and
make sure the count is the real one.

Task : 2206969

closes #48274

X-original-commit: e3101d9
Signed-off-by: Simon Lejeune (sle) <sle@openerp.com>
@robodoo robodoo closed this Mar 26, 2020
@robodoo robodoo deployed to merge Mar 26, 2020 Active
vtu-odoo added a commit to odoo-dev/odoo that referenced this pull request Mar 30, 2020
The 'vendor bills' stat button on purchase order, once clicked, will
have a specific behavior depending on the invoice count :
    0 : open a new invoice with pre filled fields (not saved yet)
    1 : open the form view of the invoice
    2+: open the list view of the invoices.

Before this commit, the invoice count was computed with an environment on
the current user. That means a record rule could make the invoice count
lower than the real count and so give an unwanted behavior. Ex: create a
new invoice even if there is already one created because the user cannot
see the other people's invoices.

After this commit, the action_view_invoice with make an explicit read()
in database to fill the cache with all the purchase order's invoices and
make sure the count is the real one.

Task : 2206969

closes odoo#48274

X-original-commit: e3101d9
Signed-off-by: Simon Lejeune (sle) <sle@openerp.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked issues

Successfully merging this pull request may close these issues.

None yet

5 participants
You can’t perform that action at this time.