From f12beff2f1e4da1244e7a8e014e73e5e5023aa9d Mon Sep 17 00:00:00 2001 From: Azka Nathan Date: Wed, 9 Jul 2025 10:58:07 +0700 Subject: multiple qty --- fixco_custom/models/product_product.py | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'fixco_custom/models/product_product.py') diff --git a/fixco_custom/models/product_product.py b/fixco_custom/models/product_product.py index a6bec4d..5117104 100755 --- a/fixco_custom/models/product_product.py +++ b/fixco_custom/models/product_product.py @@ -17,7 +17,16 @@ class ProductProduct(models.Model): 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') + qty_multiple = fields.Float('Multiple') + def check_multiple_qty(self, other_qty): + if self.qty_multiple > 0 and other_qty > 0: + multiple = self.qty_multiple + if other_qty % multiple != 0: + return True + else: + return False + @api.constrains('name', 'default_code') def constrains_product_type(self): self.type = 'product' -- cgit v1.2.3