diff options
| author | Azka Nathan <darizkyfaz@gmail.com> | 2024-12-18 10:25:09 +0700 |
|---|---|---|
| committer | Azka Nathan <darizkyfaz@gmail.com> | 2024-12-18 10:25:09 +0700 |
| commit | 01d85b9f0d8fc70c35eaa13a154f3443fc35f1c6 (patch) | |
| tree | 6523f2fad4f08f9c12d6316529adb3c05fa3e971 | |
| parent | 97d9a59c82be9052815be6039327148f07d98514 (diff) | |
new field qr code variant
| -rw-r--r-- | indoteknik_custom/models/stock_move.py | 9 | ||||
| -rw-r--r-- | indoteknik_custom/views/stock_picking.xml | 14 |
2 files changed, 23 insertions, 0 deletions
diff --git a/indoteknik_custom/models/stock_move.py b/indoteknik_custom/models/stock_move.py index 8214a057..e1d4e74c 100644 --- a/indoteknik_custom/models/stock_move.py +++ b/indoteknik_custom/models/stock_move.py @@ -11,6 +11,15 @@ class StockMove(models.Model): string="Print Barcode", default=lambda self: self.product_id.print_barcode, ) + qr_code_variant = fields.Binary("QR Code Variant", compute='_compute_qr_code_variant') + + def _compute_qr_code_variant(self): + for rec in self: + if rec.print_barcode and rec.print_barcode == True and rec.product_id and rec.product_id.qr_code_variant: + rec.qr_code_variant = rec.product_id.qr_code_variant + else: + rec.qr_code_variant = False + def write(self, vals): res = super(StockMove, self).write(vals) diff --git a/indoteknik_custom/views/stock_picking.xml b/indoteknik_custom/views/stock_picking.xml index 20fc709e..fab83885 100644 --- a/indoteknik_custom/views/stock_picking.xml +++ b/indoteknik_custom/views/stock_picking.xml @@ -121,6 +121,7 @@ <field name="product_uom" position="after"> <field name="sale_id" attrs="{'readonly': 1}" optional="hide"/> <field name="print_barcode" optional="hide"/> + <field name="qr_code_variant" widget="image" optional="hide"/> </field> <page name="note" position="after"> <page string="E-Faktur" name="efaktur" attrs="{'invisible': [['is_internal_use', '=', False]]}"> @@ -169,11 +170,24 @@ </group> </group> </page> + <!-- <page string="Check Product" name="check_product"> + <field name="check_product_lines"/> + </page> --> </page> </field> </record> + <!-- <record id="check_product_tree" model="ir.ui.view"> + <field name="name">check.product.tree</field> + <field name="model">check.product</field> + <field name="arch" type="xml"> + <tree editable="bottom"> + <field name="product_id"/> + </tree> + </field> + </record> --> + <record id="view_stock_move_line_detailed_operation_tree_inherit" model="ir.ui.view"> <field name="name">stock.move.line.operations.tree.inherit</field> <field name="model">stock.move.line</field> |
