diff options
| -rw-r--r-- | indoteknik_custom/models/automatic_purchase.py | 3 | ||||
| -rwxr-xr-x | indoteknik_custom/models/purchase_order.py | 8 |
2 files changed, 2 insertions, 9 deletions
diff --git a/indoteknik_custom/models/automatic_purchase.py b/indoteknik_custom/models/automatic_purchase.py index d9ec17f4..ce0328c4 100644 --- a/indoteknik_custom/models/automatic_purchase.py +++ b/indoteknik_custom/models/automatic_purchase.py @@ -239,7 +239,8 @@ class AutomaticPurchase(models.Model): 'picking_type_id': 28, 'date_order': current_time, 'from_apo': True, - 'note_description': 'Automatic PO' + 'note_description': 'Automatic PO', + 'show_description': False if vendor_id == 5571 else True, } new_po = self.env['purchase.order'].create(param_header) diff --git a/indoteknik_custom/models/purchase_order.py b/indoteknik_custom/models/purchase_order.py index 8772dea9..4475e777 100755 --- a/indoteknik_custom/models/purchase_order.py +++ b/indoteknik_custom/models/purchase_order.py @@ -118,17 +118,9 @@ class PurchaseOrder(models.Model): show_description = fields.Boolean( string='Show Description', - compute='_compute_show_description', default=True ) - @api.depends('partner_id') - def _compute_show_description(self): - for order in self: - if order.partner_id.id == 5571: - order.show_description = False - else: - order.show_description = order.show_description @api.onchange('show_description') def onchange_show_description(self): |
