From 2dc4ef69c145b02250ef3ebda2a7c11f90fe9423 Mon Sep 17 00:00:00 2001 From: Nicolas Martinelli Date: Thu, 26 Mar 2020 15:12:04 +0000 Subject: [PATCH] [FIX] account, pos_cash_rounding: company_id on cash rounding MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - Create 2 companies C1 and C2 - Create a cash rounding method for C2, i.e. use an account of C2 - In the POS configuration of C1, choose the created cash rounding method When closing the POS, entries will be booked in C1 and C2 => error. We define a `company_id` field which is a related to the `account` company. opw-2223150 opw-2217718 closes odoo/odoo#48632 X-original-commit: a1feee5db2d6509c0af8f59812a8e8ce5b23c662 Signed-off-by: pimodoo Signed-off-by: Nicolas Martinelli (nim) Signed-off-by: Xavier Dollé (xdo) --- addons/account/models/account_cash_rounding.py | 1 + addons/point_of_sale/views/pos_config_view.xml | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/addons/account/models/account_cash_rounding.py b/addons/account/models/account_cash_rounding.py index 7d105c60288..3d0c85d26e2 100644 --- a/addons/account/models/account_cash_rounding.py +++ b/addons/account/models/account_cash_rounding.py @@ -25,6 +25,7 @@ class AccountCashRounding(models.Model): rounding_method = fields.Selection(string='Rounding Method', required=True, selection=[('UP', 'UP'), ('DOWN', 'DOWN'), ('HALF-UP', 'HALF-UP')], default='HALF-UP', help='The tie-breaking rule used for float rounding operations') + company_id = fields.Many2one('res.company', related='profit_account_id.company_id') def round(self, amount): """Compute the rounding on the amount passed as parameter. diff --git a/addons/point_of_sale/views/pos_config_view.xml b/addons/point_of_sale/views/pos_config_view.xml index 10a57d7b709..6fba101c259 100644 --- a/addons/point_of_sale/views/pos_config_view.xml +++ b/addons/point_of_sale/views/pos_config_view.xml @@ -354,7 +354,7 @@