From 5be65f6f512124cb3b4c3b83d69f9ff86dc1c6b4 Mon Sep 17 00:00:00 2001 From: Azka Nathan Date: Wed, 11 Jun 2025 08:58:41 +0700 Subject: table bundling line product --- fixco_custom/models/product_product.py | 11 ++++++++++- fixco_custom/security/ir.model.access.csv | 3 ++- fixco_custom/views/product_product.xml | 18 ++++++++++++++++++ fixco_custom/views/stock_picking.xml | 11 +++++++++++ 4 files changed, 41 insertions(+), 2 deletions(-) diff --git a/fixco_custom/models/product_product.py b/fixco_custom/models/product_product.py index 2e571a8..719a183 100755 --- a/fixco_custom/models/product_product.py +++ b/fixco_custom/models/product_product.py @@ -13,6 +13,7 @@ from io import BytesIO class ProductProduct(models.Model): _inherit = "product.product" + bundling_line_ids = fields.One2many('bundling.line', 'product_id', string="Bundling Lines", auto_join=True) qty_pcs_box = fields.Float("Pcs Box") barcode_box = fields.Char("Barcode Box") qr_code_variant = fields.Binary("QR Code Variant", compute='_compute_qr_code_variant') @@ -38,4 +39,12 @@ class ProductProduct(models.Model): img.save(buffer, format="PNG") qr_code_img = base64.b64encode(buffer.getvalue()).decode() - rec.qr_code_variant = qr_code_img \ No newline at end of file + rec.qr_code_variant = qr_code_img + +class BundlingLine(models.Model): + _name = "bundling.line" + + product_id = fields.Many2one('product.product', string="Product") + variant_id = fields.Many2one('product.product', string="Variant") + master_sku = fields.Char(string="Master SKU") + price = fields.Float(string="Price") diff --git a/fixco_custom/security/ir.model.access.csv b/fixco_custom/security/ir.model.access.csv index 58c19b9..e40c7d1 100755 --- a/fixco_custom/security/ir.model.access.csv +++ b/fixco_custom/security/ir.model.access.csv @@ -12,4 +12,5 @@ access_upload_payments_line,access.upload.payments.line,model_upload_payments_li access_purchase_pricelist,access.purchase.pricelist,model_purchase_pricelist,,1,1,1,1 access_shipment_group,access.shipment.group,model_shipment_group,,1,1,1,1 access_shipment_group_line,access.shipment.group.line,model_shipment_group_line,,1,1,1,1 -access_stock_picking_shipment_group,access.stock.picking.shipment_group,model_stock_picking_shipment_group,,1,1,1,1 \ No newline at end of file +access_stock_picking_shipment_group,access.stock.picking.shipment_group,model_stock_picking_shipment_group,,1,1,1,1 +access_bundling_line,access.bundling.line,model_bundling_line,,1,1,1,1 \ No newline at end of file diff --git a/fixco_custom/views/product_product.xml b/fixco_custom/views/product_product.xml index 2db7c31..cd065aa 100755 --- a/fixco_custom/views/product_product.xml +++ b/fixco_custom/views/product_product.xml @@ -11,7 +11,25 @@ + + + + + + + + bundling.line.tree + bundling.line + + + + + + + + + diff --git a/fixco_custom/views/stock_picking.xml b/fixco_custom/views/stock_picking.xml index 1db4793..446e735 100755 --- a/fixco_custom/views/stock_picking.xml +++ b/fixco_custom/views/stock_picking.xml @@ -1,6 +1,17 @@ + + Stock Picking + stock.picking + + + + + + + + Stock Picking stock.picking -- cgit v1.2.3