From 8f5fad4e3e763cbafddba4e68a827e5ffc4f13b9 Mon Sep 17 00:00:00 2001 From: Kaylie Kipe Date: Tue, 12 Oct 2021 14:19:40 -0700 Subject: [PATCH] [IMP] delivery_hibou: Added new field for `commercial_partner_id` and improved domain to show Shipping Accounts accordingly --- delivery_hibou/models/stock.py | 1 + delivery_hibou/views/stock_views.xml | 3 ++- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/delivery_hibou/models/stock.py b/delivery_hibou/models/stock.py index 35559223..48719274 100644 --- a/delivery_hibou/models/stock.py +++ b/delivery_hibou/models/stock.py @@ -11,6 +11,7 @@ class StockPicking(models.Model): ('no', 'No'), ], string='Require Insurance', default='auto', help='If your carrier supports it, auto should be calculated off of the "Automatic Insurance Value" field.') + commercial_partner_id = fields.Many2one('res.partner', related='partner_id.commercial_partner_id') @api.depends('move_lines.priority', 'carrier_id') def _compute_priority(self): diff --git a/delivery_hibou/views/stock_views.xml b/delivery_hibou/views/stock_views.xml index 60cfdef9..ff0e14fb 100644 --- a/delivery_hibou/views/stock_views.xml +++ b/delivery_hibou/views/stock_views.xml @@ -7,10 +7,11 @@ + + domain="[('partner_id', 'in', (False, partner_id, commercial_partner_id))]"/>