summaryrefslogtreecommitdiff
path: root/addons/point_of_sale
diff options
context:
space:
mode:
authorJorge Pinna Puissant <jpp@odoo.com>2020-11-12 14:59:07 +0000
committerNicolas Martinelli <nim@odoo.com>2020-11-16 11:59:39 +0000
commitc7bb37d43cc85d3d0eaeb24f2e4e331835e22f5b (patch)
tree8f8c99ddb931868a4d2313d972b55a2af2b3d7a1 /addons/point_of_sale
parent629b54dc1249c77d1e30240c0b5a91e22a1ae110 (diff)
[FIX] account,point_of_sale: increment customer supplier rank to commercial partner
Before this commit, if a customer/supplier has an invoice address, when creating an invoice/bill it's the invoice address that will be identified as the customer/supplier and that will have its rank increased and not the commercial partner. Now, the rank increment is done to the commercial partner as well. opw-2377870 closes odoo/odoo#61774 X-original-commit: dbf042611ccb134a220704d6b775aab650364ca2 Signed-off-by: Nicolas Martinelli (nim) <nim@odoo.com>
Diffstat (limited to 'addons/point_of_sale')
-rw-r--r--addons/point_of_sale/models/pos_session.py3
1 files changed, 2 insertions, 1 deletions
diff --git a/addons/point_of_sale/models/pos_session.py b/addons/point_of_sale/models/pos_session.py
index a046c9707f7..13eb7fe347e 100644
--- a/addons/point_of_sale/models/pos_session.py
+++ b/addons/point_of_sale/models/pos_session.py
@@ -480,7 +480,8 @@ class PosSession(models.Model):
rounding_difference = self._update_amounts(rounding_difference, {'amount': diff}, order.date_order)
# Increasing current partner's customer_rank
- order.partner_id._increase_rank('customer_rank')
+ partners = (order.partner_id | order.partner_id.commercial_partner_id)
+ partners._increase_rank('customer_rank')
if self.company_id.anglo_saxon_accounting:
global_session_pickings = self.picking_ids.filtered(lambda p: not p.pos_order_id)