From 7fe2c169a448df17c9395dfae20c524e94aa8bfc Mon Sep 17 00:00:00 2001 From: Azka Nathan Date: Tue, 16 Sep 2025 09:27:32 +0700 Subject: push --- indoteknik_custom/models/purchase_order.py | 2 +- indoteknik_custom/models/purchase_order_line.py | 1 + indoteknik_custom/report/purchase_report.xml | 10 ++-------- indoteknik_custom/views/purchase_order.xml | 10 ++++++---- 4 files changed, 10 insertions(+), 13 deletions(-) diff --git a/indoteknik_custom/models/purchase_order.py b/indoteknik_custom/models/purchase_order.py index 98cf6ff1..4636c243 100755 --- a/indoteknik_custom/models/purchase_order.py +++ b/indoteknik_custom/models/purchase_order.py @@ -137,7 +137,7 @@ class PurchaseOrder(models.Model): def _compute_date_planned(self): """ date_planned = the earliest date_planned across all order lines. """ for order in self: - order.date_planned = False + order.date_planned = order.date_planned @api.constrains('date_planned') def constrains_date_planned(self): diff --git a/indoteknik_custom/models/purchase_order_line.py b/indoteknik_custom/models/purchase_order_line.py index 315795d5..a3c3a33b 100755 --- a/indoteknik_custom/models/purchase_order_line.py +++ b/indoteknik_custom/models/purchase_order_line.py @@ -50,6 +50,7 @@ class PurchaseOrderLine(models.Model): cost_service_per_item = fields.Float(string='Biaya Jasa Per Item', compute='_compute_doc_delivery_amt') contribution_cost_service = fields.Float(string='Contribution Cost Service', compute='_compute_doc_delivery_amt') ending_price = fields.Float(string='Ending Price', compute='_compute_doc_delivery_amt') + show_description = fields.Boolean(string='Show Description', help="Show Description when print po", default=True) def _compute_doc_delivery_amt(self): for line in self: diff --git a/indoteknik_custom/report/purchase_report.xml b/indoteknik_custom/report/purchase_report.xml index 6666235a..555adff4 100644 --- a/indoteknik_custom/report/purchase_report.xml +++ b/indoteknik_custom/report/purchase_report.xml @@ -93,12 +93,6 @@ - -
- N/A -
-
-
@@ -135,9 +129,9 @@ - + - +
diff --git a/indoteknik_custom/views/purchase_order.xml b/indoteknik_custom/views/purchase_order.xml index 821f3295..a3a5e05c 100755 --- a/indoteknik_custom/views/purchase_order.xml +++ b/indoteknik_custom/views/purchase_order.xml @@ -112,6 +112,7 @@ + {'no_create': True} @@ -181,19 +182,20 @@ - {'readonly': ['|', ('state', 'in', ['purchase', 'done', 'cancel']), ('has_active_invoice', '=', True)]} + + {'readonly': [('has_active_invoice', '=', True)]} - {'readonly': [], 'required': True} + {'readonly': [('state', 'in', ['purchase', 'done', 'cancel'])], 'required': True} - {'readonly': []} + {'readonly': [('state', 'in', ['purchase', 'done', 'cancel'])]} - {'required': True} + {'readonly': [('state', 'in', ['purchase', 'done', 'cancel'])], 'required': True} -- cgit v1.2.3