Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[FIX] purchase: ensure all vendor bills are gathered from purchase order
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#48240 Signed-off-by: Simon Lejeune (sle) <sle@openerp.com>
- Loading branch information