summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorIT Fixcomart <it@fixcomart.co.id>2022-08-10 17:25:18 +0700
committerIT Fixcomart <it@fixcomart.co.id>2022-08-10 17:25:18 +0700
commit2b3b0b8c0c54c9b63af16eaf011d925763021a83 (patch)
tree5972b9a3cbca9970b2f330252f139cb207390e90
parent06180f02fd39a917b46a6218c465c0fe94e37610 (diff)
Sync purchase_order_line.name to product.display_name, ubah state button view
-rw-r--r--indoteknik_custom/models/purchase_order.py4
-rw-r--r--indoteknik_custom/views/purchase_order.xml4
2 files changed, 4 insertions, 4 deletions
diff --git a/indoteknik_custom/models/purchase_order.py b/indoteknik_custom/models/purchase_order.py
index ba98d8d3..4931d738 100644
--- a/indoteknik_custom/models/purchase_order.py
+++ b/indoteknik_custom/models/purchase_order.py
@@ -22,8 +22,8 @@ class PurchaseOrder(models.Model):
values = {
'order_id': self.id,
'product_id': order_line.product_id.id,
- 'name': order_line.product_id.name,
- 'product_qty': order_line.product_qty
+ 'name': order_line.product_id.display_name,
+ 'product_qty': order_line.product_qty,
}
self.env['purchase.order.line'].sudo().create(values)
diff --git a/indoteknik_custom/views/purchase_order.xml b/indoteknik_custom/views/purchase_order.xml
index 48a8cf6b..f209d18a 100644
--- a/indoteknik_custom/views/purchase_order.xml
+++ b/indoteknik_custom/views/purchase_order.xml
@@ -11,11 +11,11 @@
string="Synchronize Sale Order"
type="object"
class="oe_highlight oe_edit_only"
- attrs="{'invisible': [('sale_order_id', '=', False)]}"
+ attrs="{'invisible': ['|', ('sale_order_id', '=', False), ('state', 'not in', ['draft'])]}"
/>
</div>
<field name="date_order" position="before">
- <field name="sale_order_id"/>
+ <field name="sale_order_id" attrs="{'readonly': [('state', 'not in', ['draft'])]}"/>
</field>
</field>
</record>