From 0f6d44e8090b5c00b379ae5080b02acf211041ec Mon Sep 17 00:00:00 2001 From: Stepan Savelyev Date: Mon, 20 Jan 2020 19:29:31 +0500 Subject: [PATCH] [IMP] order id domain --- models/res_partner_contract_annex.py | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/models/res_partner_contract_annex.py b/models/res_partner_contract_annex.py index a7e1b9a..f6ac22a 100644 --- a/models/res_partner_contract_annex.py +++ b/models/res_partner_contract_annex.py @@ -22,8 +22,8 @@ class ContractOrderAnnex(models.Model, IDocument, Extension): order_id = fields.Many2one( "sale.order", string="Order", - required=True, help="Orders with this partner which are not uses in annexes yet", + required=True, ) date_conclusion = fields.Date( string="Conclusion Date", default=fields.Date.today(), @@ -60,8 +60,11 @@ class ContractOrderAnnex(models.Model, IDocument, Extension): contract=contract_number, order=order_number, ) - # Compute domain for order_id because of bug with - # not working correctly domain in model + @api.onchange("order_id") + def _domain_order_id(self): + """Using domain function because of + simple domain does not working properly because of + contract_id is still False""" return { "domain": { "order_id": [