diff options
| -rwxr-xr-x | fixco_custom/models/product_product.py | 11 | ||||
| -rwxr-xr-x | fixco_custom/security/ir.model.access.csv | 3 | ||||
| -rwxr-xr-x | fixco_custom/views/product_product.xml | 18 | ||||
| -rwxr-xr-x | 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 @@ <field name="qty_pcs_box" /> <field name="qr_code_variant" widget="image" readonly="True"/> </field> + <notebook position="inside"> + <page string="Bundling"> + <field name="bundling_line_ids"/> + </page> + </notebook> </field> </record> + + <record id="bundling_line_tree" model="ir.ui.view"> + <field name="name">bundling.line.tree</field> + <field name="model">bundling.line</field> + <field name="arch" type="xml"> + <tree editable="bottom"> + <field name="variant_id" /> + <field name="master_sku" /> + <field name="price"/> + </tree> + </field> + </record> + </data> </odoo> 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 @@ <?xml version="1.0" encoding="UTF-8" ?> <odoo> <data> + <record id="stock_picking_tree_view_inherit" model="ir.ui.view"> + <field name="name">Stock Picking</field> + <field name="model">stock.picking</field> + <field name="inherit_id" ref="stock.vpicktree"/> + <field name="arch" type="xml"> + <field name="partner_id" position="after"> + <field name="provider_name" optional="hide"/> + </field> + </field> + </record> + <record id="stock_picking_form_view_inherit" model="ir.ui.view"> <field name="name">Stock Picking</field> <field name="model">stock.picking</field> |
