diff options
| author | Rafi Zadanly <zadanlyr@gmail.com> | 2023-07-27 14:28:09 +0700 |
|---|---|---|
| committer | Rafi Zadanly <zadanlyr@gmail.com> | 2023-07-27 14:28:09 +0700 |
| commit | 71426bf819e0be494f487214c2a59cbf4dd09017 (patch) | |
| tree | 344ac3d3dc2498bb3b6f38fc70b18813fad08dfe | |
| parent | 9f842a12e4875039622ac3140495b773cc39da5e (diff) | |
| parent | c6c59089732d912d9bc9c8a95028ddb1addcfb5a (diff) | |
Merge branch 'production' of https://bitbucket.org/altafixco/indoteknik-addons into production
| -rwxr-xr-x | indoteknik_custom/models/sale_order.py | 3 | ||||
| -rwxr-xr-x | indoteknik_custom/views/sale_order.xml | 3 |
2 files changed, 4 insertions, 2 deletions
diff --git a/indoteknik_custom/models/sale_order.py b/indoteknik_custom/models/sale_order.py index 552f1b0a..12043996 100755 --- a/indoteknik_custom/models/sale_order.py +++ b/indoteknik_custom/models/sale_order.py @@ -327,7 +327,6 @@ class SaleOrder(models.Model): order.is_warning = False def sale_order_approve(self): - # raise UserError("Bisa langsung Confirm") self.check_due() for order in self: @@ -357,6 +356,8 @@ class SaleOrder(models.Model): if not order.carrier_id: raise UserError("Shipping Method harus diisi") for line in order.order_line: + if line.product_id.id == 385544: + raise UserError('Produk Sementara Tidak Bisa Di Confirm atau Ask Approval') if not line.product_id or line.product_id.type == 'service': continue # must add product can sell validation diff --git a/indoteknik_custom/views/sale_order.xml b/indoteknik_custom/views/sale_order.xml index ae16f649..9ff000e7 100755 --- a/indoteknik_custom/views/sale_order.xml +++ b/indoteknik_custom/views/sale_order.xml @@ -58,7 +58,8 @@ </xpath> <field name="source_id" position="attributes"> <attribute name="domain">[('id', 'in', [32, 59, 60, 61])]</attribute> - <attribute name="required">1</attribute> + <attribute name="attrs">{'required':['|',('create_date', '>', '2023-07-30'), ('create_date', '=', False)]} + </attribute> </field> <xpath expr="//form/sheet/notebook/page/field[@name='order_line']/tree/field[@name='price_total']" position="after"> <field name="vendor_id" attrs="{'readonly': [('parent.approval_status', '=', 'approved')]}"/> |
