summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorstephanchrst <stephanchrst@gmail.com>2023-10-26 11:56:16 +0700
committerstephanchrst <stephanchrst@gmail.com>2023-10-26 11:56:16 +0700
commit0037ab8019daad5c1cfccd0007284c54b5c22253 (patch)
treeace14e2743636a6dccb7b21db3ec0fd2db568895
parentcdd2e38987e4db045809b5af65fc12c16cf20186 (diff)
add indent tab in purchase order
-rwxr-xr-xindoteknik_custom/models/purchase_order.py1
-rwxr-xr-xindoteknik_custom/views/purchase_order.xml19
2 files changed, 20 insertions, 0 deletions
diff --git a/indoteknik_custom/models/purchase_order.py b/indoteknik_custom/models/purchase_order.py
index d62d7b1e..f9cd7f5b 100755
--- a/indoteknik_custom/models/purchase_order.py
+++ b/indoteknik_custom/models/purchase_order.py
@@ -48,6 +48,7 @@ class PurchaseOrder(models.Model):
note_description = fields.Char(string='Note', help='bisa diisi sebagai informasi indent barang tertentu atau apapun')
has_active_invoice = fields.Boolean(string='Has Active Invoice', compute='_compute_has_active_invoice')
description = fields.Char(string='Description', help='bisa diisi sebagai informasi indent barang tertentu atau apapun')
+ purchase_order_lines = fields.One2many('purchase.order.line', 'order_id', string='Indent', auto_join=True)
def _compute_has_active_invoice(self):
for order in self:
diff --git a/indoteknik_custom/views/purchase_order.xml b/indoteknik_custom/views/purchase_order.xml
index d564f260..8f7ea6df 100755
--- a/indoteknik_custom/views/purchase_order.xml
+++ b/indoteknik_custom/views/purchase_order.xml
@@ -79,6 +79,7 @@
<field name="description"/>
<field name="total_so_percent_margin"/>
<field name="has_active_invoice" invisible="1" />
+ <field name="purchase_order_lines"/>
</field>
<field name="order_line" position="attributes">
@@ -96,6 +97,12 @@
<xpath expr="//form/sheet/notebook/page/field[@name='order_line']/tree/field[@name='product_qty']" position="attributes">
<attribute name="attrs">{'readonly': [], 'required': True}</attribute>
</xpath>
+
+ <xpath expr="//form/sheet/notebook/page[@name='purchase_delivery_invoice']" position="before">
+ <page string="Indent" name="purchase_order_lines_indent">
+ <field name="purchase_order_lines"/>
+ </page>
+ </xpath>
</field>
</record>
</data>
@@ -165,4 +172,16 @@
<field name="active">True</field>
</record>
</data>
+ <data>
+ <record id="purchase_order_line_indent_tree" model="ir.ui.view">
+ <field name="name">purchase.order.line.indent.tree</field>
+ <field name="model">purchase.order.line</field>
+ <field name="arch" type="xml">
+ <tree editable="top" create="false" delete="false">
+ <field name="product_id" readonly="1"/>
+ <field name="indent"/>
+ </tree>
+ </field>
+ </record>
+ </data>
</odoo> \ No newline at end of file