diff options
| author | Gert Pellin <gpe@odoo.com> | 2019-09-09 11:29:52 +0000 |
|---|---|---|
| committer | Pierre Masereel <pim@odoo.com> | 2019-09-13 10:05:44 +0000 |
| commit | 71e9c4dc7a3a1839290801e963ca9dc15f31eb76 (patch) | |
| tree | 4b1fb3690b2ddf9c287103e75a8cebd465f9dd1e | |
| parent | 20c097996ee382501acf67d7ae1bee7ccd540f80 (diff) | |
[FIX] point_of_sale: close session in multi company
Close a rescue PoS Session from another company triggers this error:
"Please define income account for this product: "Office Chair" (id:5).
property_account_income_id on product is company dependent but no
company was forced before this fix.
closes odoo/odoo#36280
Signed-off-by: pimodoo <pimodoo@users.noreply.github.com>
| -rw-r--r-- | addons/point_of_sale/models/pos_session.py | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/addons/point_of_sale/models/pos_session.py b/addons/point_of_sale/models/pos_session.py index adaab34ad08..14ccea3d461 100644 --- a/addons/point_of_sale/models/pos_session.py +++ b/addons/point_of_sale/models/pos_session.py @@ -521,7 +521,7 @@ class PosSession(models.Model): """ def get_income_account(order_line): product = order_line.product_id - income_account = product.property_account_income_id or product.categ_id.property_account_income_categ_id + income_account = product.with_context(force_company=order_line.company_id.id).property_account_income_id or product.categ_id.with_context(force_company=order_line.company_id.id).property_account_income_categ_id if not income_account: raise UserError(_('Please define income account for this product: "%s" (id:%d).') % (product.name, product.id)) |
