diff options
| author | stephanchrst <stephanchrst@gmail.com> | 2024-11-14 11:16:07 +0700 |
|---|---|---|
| committer | stephanchrst <stephanchrst@gmail.com> | 2024-11-14 11:16:07 +0700 |
| commit | 3f5eec5331b216911d911c230ea64538588b65c0 (patch) | |
| tree | 7b5e60b7dcfbb120849c731de7630b7c0242648d | |
| parent | f6df2ccfde5b45d018c8d7b11203429b5f39ebfc (diff) | |
add free bu
| -rw-r--r-- | indoteknik_custom/models/sale_order_line.py | 5 | ||||
| -rwxr-xr-x | indoteknik_custom/views/sale_order.xml | 1 |
2 files changed, 6 insertions, 0 deletions
diff --git a/indoteknik_custom/models/sale_order_line.py b/indoteknik_custom/models/sale_order_line.py index f4469117..04fafa69 100644 --- a/indoteknik_custom/models/sale_order_line.py +++ b/indoteknik_custom/models/sale_order_line.py @@ -37,6 +37,11 @@ class SaleOrderLine(models.Model): weight = fields.Float(string='Weight') md_vendor_id = fields.Many2one('res.partner', string='MD Vendor', readonly=True) margin_md = fields.Float(string='Margin MD') + qty_free_bu = fields.Float(string='Free BU', compute='_get_qty_free_bandengan') + + def _get_qty_free_bandengan(self): + for line in self: + line.qty_free_bu = line.product_id.qty_free_bandengan @api.constrains('note_procurement') def note_procurement_to_apo(self): diff --git a/indoteknik_custom/views/sale_order.xml b/indoteknik_custom/views/sale_order.xml index b8f2d08d..53dac424 100755 --- a/indoteknik_custom/views/sale_order.xml +++ b/indoteknik_custom/views/sale_order.xml @@ -119,6 +119,7 @@ </attribute> </xpath> <xpath expr="//form/sheet/notebook/page/field[@name='order_line']/tree/field[@name='price_total']" position="after"> + <field name="qty_free_bu" optional="hide"/> <field name="vendor_id" attrs="{'readonly': [('parent.approval_status', '=', 'approved')]}" domain="[('parent_id', '=', False)]" options="{'no_create':True}"/> <field name="vendor_md_id" optional="hide"/> <field name="purchase_price" attrs=" |
