diff --git a/product_combo_pack/__init__.py b/product_combo_pack/__init__.py index c4b2a59a5..6e523b5dd 100644 --- a/product_combo_pack/__init__.py +++ b/product_combo_pack/__init__.py @@ -3,7 +3,7 @@ # # Cybrosys Technologies Pvt. Ltd. # -# Copyright (C) 2020-TODAY Cybrosys Technologies (). +# Copyright (C) 2022-TODAY Cybrosys Technologies (). # Author: Afras Habis (odoo@cybrosys.com) # # This program is free software: you can modify diff --git a/product_combo_pack/__manifest__.py b/product_combo_pack/__manifest__.py index 54094a417..5dddc532b 100644 --- a/product_combo_pack/__manifest__.py +++ b/product_combo_pack/__manifest__.py @@ -3,7 +3,7 @@ # # Cybrosys Technologies Pvt. Ltd. # -# Copyright (C) 2020-TODAY Cybrosys Technologies (). +# Copyright (C) 2022-TODAY Cybrosys Technologies (). # Author: Afras Habis (odoo@cybrosys.com) # # This program is free software: you can modify @@ -23,7 +23,7 @@ { 'name': 'Product Pack', - 'version': '15.0.1.1.1', + 'version': '15.0.1.0.1', 'summary': 'Manage Products as Pack', 'description': 'Manage Products as Pack', 'category': 'Sales', diff --git a/product_combo_pack/doc/RELEASE_NOTES.md b/product_combo_pack/doc/RELEASE_NOTES.md index d31a971c9..47bbd0cea 100644 --- a/product_combo_pack/doc/RELEASE_NOTES.md +++ b/product_combo_pack/doc/RELEASE_NOTES.md @@ -3,3 +3,8 @@ #### 02.05.2020 #### Version 15.0.1.0.0 Initial Commit for product_combo_pack + +#### 01.12.2022 +#### Version 15.0.1.0.1 +#### UPDT +- Product pack duplication issue \ No newline at end of file diff --git a/product_combo_pack/models/__init__.py b/product_combo_pack/models/__init__.py index 3ffdc8c37..4aaad3f5e 100644 --- a/product_combo_pack/models/__init__.py +++ b/product_combo_pack/models/__init__.py @@ -3,7 +3,7 @@ # # Cybrosys Technologies Pvt. Ltd. # -# Copyright (C) 2020-TODAY Cybrosys Technologies (). +# Copyright (C) 2022-TODAY Cybrosys Technologies (). # Author: Afras Habis (odoo@cybrosys.com) # # This program is free software: you can modify diff --git a/product_combo_pack/models/pack_products.py b/product_combo_pack/models/pack_products.py index 192c0f47d..efeac0310 100644 --- a/product_combo_pack/models/pack_products.py +++ b/product_combo_pack/models/pack_products.py @@ -3,7 +3,7 @@ # # Cybrosys Technologies Pvt. Ltd. # -# Copyright (C) 2020-TODAY Cybrosys Technologies (). +# Copyright (C) 2022-TODAY Cybrosys Technologies (). # Author: Afras Habis (odoo@cybrosys.com) # # This program is free software: you can modify @@ -30,12 +30,13 @@ class PackProducts(models.Model): _rec_name = 'product_tmpl_id' _description = 'Select Pack Products' - product_id = fields.Many2one('product.product', string = 'Product', required = True, - domain = [('is_pack', '=', False)]) - product_tmpl_id = fields.Many2one('product.template', string = 'Product') - price = fields.Float('Price', compute = 'compute_price', store = True) - quantity = fields.Integer('Quantity', default = 1) - qty_available = fields.Float('Quantity Available', compute = 'compute_quantity_of_product', store = True, readonly = False) + product_id = fields.Many2one('product.product', string='Product', required=True, + domain=[('is_pack', '=', False)]) + product_tmpl_id = fields.Many2one('product.template', string='Product') + price = fields.Float('Price', compute='compute_price', store=True) + quantity = fields.Integer('Quantity', default=1) + qty_available = fields.Float('Quantity Available', compute='compute_quantity_of_product', store=True, + readonly=False) total_available_quantity = fields.Float('Total Quantity') @api.depends('product_id', 'total_available_quantity', 'product_id.qty_available') @@ -43,7 +44,8 @@ class PackProducts(models.Model): for record in self: location_id = record.product_tmpl_id.pack_location_id if location_id: - stock_quant = self.env['stock.quant'].search([('product_id','=',record.product_id.id),('location_id','=',location_id.id)]) + stock_quant = self.env['stock.quant'].search( + [('product_id', '=', record.product_id.id), ('location_id', '=', location_id.id)]) if stock_quant: record.qty_available = stock_quant.quantity else: @@ -63,4 +65,4 @@ class PackProducts(models.Model): @api.constrains('quantity') def _check_positive_qty(self): if any([ml.quantity < 0 for ml in self]): - raise ValidationError(_('You can not enter negative quantities.')) \ No newline at end of file + raise ValidationError(_('You can not enter negative quantities.')) diff --git a/product_combo_pack/models/product_form.py b/product_combo_pack/models/product_form.py index dd926e242..44cfb0808 100644 --- a/product_combo_pack/models/product_form.py +++ b/product_combo_pack/models/product_form.py @@ -3,7 +3,7 @@ # # Cybrosys Technologies Pvt. Ltd. # -# Copyright (C) 2020-TODAY Cybrosys Technologies (). +# Copyright (C) 2022-TODAY Cybrosys Technologies (). # Author: Afras Habis (odoo@cybrosys.com) # # This program is free software: you can modify @@ -36,12 +36,12 @@ class ProductPack(models.Model): return warehouse.lot_stock_id.id is_pack = fields.Boolean('Is a Pack') - pack_price = fields.Integer(string = "Pack Price", compute = 'set_pack_price', store = True) - pack_products_ids = fields.One2many('pack.products', 'product_tmpl_id', string = 'Pack Products') + pack_price = fields.Integer(string="Pack Price", compute='set_pack_price', store=True) + pack_products_ids = fields.One2many('pack.products', 'product_tmpl_id', string='Pack Products', copy=True) pack_quantity = fields.Integer('Pack Quantity') pack_location_id = fields.Many2one('stock.location', - domain = [('usage', 'in', ['internal', 'transit'])], - default = default_pack_location) + domain=[('usage', 'in', ['internal', 'transit'])], + default=default_pack_location) @api.depends('pack_products_ids', 'pack_products_ids.price') def set_pack_price(self): @@ -96,12 +96,12 @@ class ProductPack(models.Model): location_id = self.pack_location_id.id if not location_id: warehouse = self.env['stock.warehouse'].search([( - 'company_id', '=', company_user.id)], limit = 1) + 'company_id', '=', company_user.id)], limit=1) location_id = warehouse.lot_stock_id.id if not location_id: raise UserError(_( 'You need to select the location to update the pack quantity...!')) - self.env['stock.quant'].with_context(inventory_mode = True).sudo().create({ + self.env['stock.quant'].with_context(inventory_mode=True).sudo().create({ 'product_id': product_id, 'location_id': location_id, 'inventory_quantity': self.pack_quantity, diff --git a/product_combo_pack/models/sale_order.py b/product_combo_pack/models/sale_order.py index 7afe00ec4..accae1043 100644 --- a/product_combo_pack/models/sale_order.py +++ b/product_combo_pack/models/sale_order.py @@ -3,7 +3,7 @@ # # Cybrosys Technologies Pvt. Ltd. # -# Copyright (C) 2020-TODAY Cybrosys Technologies (). +# Copyright (C) 2022-TODAY Cybrosys Technologies (). # Author: Afras Habis (odoo@cybrosys.com) # # This program is free software: you can modify diff --git a/product_combo_pack/wizard/__init__.py b/product_combo_pack/wizard/__init__.py index a1cfef5b8..b1a68be89 100644 --- a/product_combo_pack/wizard/__init__.py +++ b/product_combo_pack/wizard/__init__.py @@ -3,7 +3,7 @@ # # Cybrosys Technologies Pvt. Ltd. # -# Copyright (C) 2020-TODAY Cybrosys Technologies (). +# Copyright (C) 2022-TODAY Cybrosys Technologies (). # Author: Afras Habis (odoo@cybrosys.com) # # This program is free software: you can modify diff --git a/product_combo_pack/wizard/select_product_pack.py b/product_combo_pack/wizard/select_product_pack.py index b3dad1098..d4a26d4b1 100644 --- a/product_combo_pack/wizard/select_product_pack.py +++ b/product_combo_pack/wizard/select_product_pack.py @@ -3,7 +3,7 @@ # # Cybrosys Technologies Pvt. Ltd. # -# Copyright (C) 2020-TODAY Cybrosys Technologies (). +# Copyright (C) 2022-TODAY Cybrosys Technologies (). # Author: Afras Habis (odoo@cybrosys.com) # # This program is free software: you can modify