diff options
| -rwxr-xr-x | indoteknik_custom/models/product_template.py | 14 | ||||
| -rw-r--r-- | indoteknik_custom/views/product_product.xml | 7 |
2 files changed, 17 insertions, 4 deletions
diff --git a/indoteknik_custom/models/product_template.py b/indoteknik_custom/models/product_template.py index 4beef751..bdbc391d 100755 --- a/indoteknik_custom/models/product_template.py +++ b/indoteknik_custom/models/product_template.py @@ -345,10 +345,11 @@ class ProductProduct(models.Model): usage = fields.Char(string='Usage') specification = fields.Char(string='Specification') material = fields.Char(string='Material') - qty_onhand_bandengan = fields.Float(string='Qty Onhand Bandengan', compute='_get_qty_onhand_bandengan') - qty_incoming_bandengan = fields.Float(string='Qty Incoming Bandengan', compute='_get_qty_incoming_bandengan') - qty_outgoing_bandengan = fields.Float(string='Qty Outgoing Bandengan', compute='_get_qty_outgoing_bandengan') - qty_available_bandengan = fields.Float(string='Qty Available Bandengan', compute='_get_qty_available_bandengan') + qty_onhand_bandengan = fields.Float(string='Onhand BU', compute='_get_qty_onhand_bandengan') + qty_incoming_bandengan = fields.Float(string='Incoming BU', compute='_get_qty_incoming_bandengan') + qty_outgoing_bandengan = fields.Float(string='Outgoing BU', compute='_get_qty_outgoing_bandengan') + qty_available_bandengan = fields.Float(string='Available BU', compute='_get_qty_available_bandengan') + qty_free_bandengan = fields.Float(string='Free BU', compute='_get_qty_free_bandengan') qty_upcoming = fields.Float(string='Qty Upcoming', compute='_get_qty_upcoming') sla_version = fields.Integer(string="SLA Version", default=0) is_edited = fields.Boolean(string='Is Edited') @@ -440,6 +441,11 @@ class ProductProduct(models.Model): for product in self: qty_available = product.qty_incoming_bandengan + product.qty_onhand_bandengan - product.qty_outgoing_bandengan product.qty_available_bandengan = qty_available + + def _get_qty_free_bandengan(self): + for product in self: + qty_free = product.qty_onhand_bandengan - product.qty_outgoing_bandengan + product.qty_free_bandengan = qty_free # def write(self, vals): # if 'solr_flag' not in vals: diff --git a/indoteknik_custom/views/product_product.xml b/indoteknik_custom/views/product_product.xml index 8194f92c..c06cc5f1 100644 --- a/indoteknik_custom/views/product_product.xml +++ b/indoteknik_custom/views/product_product.xml @@ -10,6 +10,13 @@ <field name="outgoing_qty"/> <field name="incoming_qty"/> </field> + <field name="virtual_available" position="after"> + <field name="qty_onhand_bandengan" optional="hide"/> + <field name="qty_incoming_bandengan" optional="hide"/> + <field name="qty_outgoing_bandengan" optional="hide"/> + <field name="qty_available_bandengan" optional="hide"/> + <field name="qty_free_bandengan" optional="hide"/> + </field> </field> </record> |
