summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAzka Nathan <darizkyfaz@gmail.com>2024-08-30 10:13:44 +0700
committerAzka Nathan <darizkyfaz@gmail.com>2024-08-30 10:13:44 +0700
commit2719b8cdd45b356baa598255dcdbdd8e353478e7 (patch)
tree25ee79c5a98ab5315d9c037e55b7b1f90c423778
parentf1b4d965f17184fb1a44c4bda759bd5a23f9df8d (diff)
payment term po cr
-rw-r--r--indoteknik_custom/models/automatic_purchase.py1
-rwxr-xr-xindoteknik_custom/views/purchase_order.xml2
2 files changed, 2 insertions, 1 deletions
diff --git a/indoteknik_custom/models/automatic_purchase.py b/indoteknik_custom/models/automatic_purchase.py
index 3561fc0f..1d1322fa 100644
--- a/indoteknik_custom/models/automatic_purchase.py
+++ b/indoteknik_custom/models/automatic_purchase.py
@@ -220,6 +220,7 @@ class AutomaticPurchase(models.Model):
# i start from zero (0)
for i in range(page):
new_po = self.env['purchase.order'].create([param_header])
+ new_po.payment_term_id = new_po.partner_id.property_supplier_payment_term_id
new_po.name = new_po.name + name + str(i + 1)
self.env['automatic.purchase.match'].create([{
diff --git a/indoteknik_custom/views/purchase_order.xml b/indoteknik_custom/views/purchase_order.xml
index b936086a..c301f3d3 100755
--- a/indoteknik_custom/views/purchase_order.xml
+++ b/indoteknik_custom/views/purchase_order.xml
@@ -39,7 +39,7 @@
<field name="currency_id" position="after">
<field name="summary_qty_po"/>
<field name="count_line_product"/>
- <field name="payment_term_id" required="1" attrs="{'readonly': [('state', 'not in', ['draft'])]}"/>
+ <field name="payment_term_id" readonly="1"/>
</field>
<field name="amount_total" position="after">
<field name="total_margin"/>