diff --git a/product_catch_weight/__manifest__.py b/product_catch_weight/__manifest__.py index 76d3cea2..535582f7 100644 --- a/product_catch_weight/__manifest__.py +++ b/product_catch_weight/__manifest__.py @@ -1,6 +1,6 @@ { 'name': 'Product Catch Weight', - 'version': '11.0.1.0.0', + 'version': '12.0.1.0.0', 'category': 'Warehouse', 'depends': [ 'sale_stock', diff --git a/product_catch_weight/models/account_invoice.py b/product_catch_weight/models/account_invoice.py index 11879f5b..c6db156c 100644 --- a/product_catch_weight/models/account_invoice.py +++ b/product_catch_weight/models/account_invoice.py @@ -8,7 +8,7 @@ class AccountInvoiceLine(models.Model): _inherit = 'account.invoice.line' catch_weight = fields.Float(string='Catch Weight', digits=(10, 4), compute='_compute_price', store=True) - catch_weight_uom_id = fields.Many2one('product.uom', related='product_id.catch_weight_uom_id') + catch_weight_uom_id = fields.Many2one('uom.uom', related='product_id.catch_weight_uom_id') @api.one @api.depends('price_unit', 'discount', 'invoice_line_tax_ids', 'quantity', diff --git a/product_catch_weight/models/product.py b/product_catch_weight/models/product.py index 16cb4b91..0232c1c8 100644 --- a/product_catch_weight/models/product.py +++ b/product_catch_weight/models/product.py @@ -4,4 +4,4 @@ from odoo import api, fields, models class ProductProduct(models.Model): _inherit = 'product.template' - catch_weight_uom_id = fields.Many2one('product.uom', string='Catch Weight UOM') + catch_weight_uom_id = fields.Many2one('uom.uom', string='Catch Weight UOM') diff --git a/product_catch_weight/models/stock.py b/product_catch_weight/models/stock.py index 0e553569..b96fa5bc 100644 --- a/product_catch_weight/models/stock.py +++ b/product_catch_weight/models/stock.py @@ -6,7 +6,7 @@ class StockProductionLot(models.Model): catch_weight_ratio = fields.Float(string='Catch Weight Ratio', digits=(10, 6), compute='_compute_catch_weight_ratio') catch_weight = fields.Float(string='Catch Weight', digits=(10, 4)) - catch_weight_uom_id = fields.Many2one('product.uom', related='product_id.catch_weight_uom_id') + catch_weight_uom_id = fields.Many2one('uom.uom', related='product_id.catch_weight_uom_id') @api.depends('catch_weight') def _compute_catch_weight_ratio(self): @@ -22,7 +22,7 @@ class StockProductionLot(models.Model): class StockMove(models.Model): _inherit = 'stock.move' - product_catch_weight_uom_id = fields.Many2one('product.uom', related="product_id.catch_weight_uom_id") + product_catch_weight_uom_id = fields.Many2one('uom.uom', related="product_id.catch_weight_uom_id") def _prepare_move_line_vals(self, quantity=None, reserved_quant=None): vals = super(StockMove, self)._prepare_move_line_vals(quantity=quantity, reserved_quant=reserved_quant) @@ -40,9 +40,9 @@ class StockMoveLine(models.Model): catch_weight_ratio = fields.Float(string='Catch Weight Ratio', digits=(10, 6), default=1.0) catch_weight = fields.Float(string='Catch Weight', digits=(10,4)) - catch_weight_uom_id = fields.Many2one('product.uom', string='Catch Weight UOM') + catch_weight_uom_id = fields.Many2one('uom.uom', string='Catch Weight UOM') lot_catch_weight = fields.Float(related='lot_id.catch_weight') - lot_catch_weight_uom_id = fields.Many2one('product.uom', related='product_id.catch_weight_uom_id') + lot_catch_weight_uom_id = fields.Many2one('uom.uom', related='product_id.catch_weight_uom_id') class StockPicking(models.Model): @@ -61,4 +61,4 @@ class StockQuant(models.Model): lot_catch_weight_ratio = fields.Float(related='lot_id.catch_weight_ratio') lot_catch_weight = fields.Float(related='lot_id.catch_weight') - lot_catch_weight_uom_id = fields.Many2one('product.uom', related='lot_id.catch_weight_uom_id') + lot_catch_weight_uom_id = fields.Many2one('uom.uom', related='lot_id.catch_weight_uom_id') diff --git a/product_catch_weight/tests/test_catch_weight.py b/product_catch_weight/tests/test_catch_weight.py index 48821d7a..9a383ea3 100644 --- a/product_catch_weight/tests/test_catch_weight.py +++ b/product_catch_weight/tests/test_catch_weight.py @@ -12,8 +12,8 @@ class TestPicking(TransactionCase): self.nominal_weight = 50.0 self.partner1 = self.env.ref('base.res_partner_2') self.stock_location = self.env.ref('stock.stock_location_stock') - self.ref_uom_id = self.env.ref('product.product_uom_kgm') - self.product_uom_id = self.env['product.uom'].create({ + self.ref_uom_id = self.env.ref('uom.product_uom_kgm') + self.product_uom_id = self.env['uom.uom'].create({ 'name': '50 ref', 'category_id': self.ref_uom_id.category_id.id, 'uom_type': 'bigger', diff --git a/product_catch_weight/views/account_invoice_views.xml b/product_catch_weight/views/account_invoice_views.xml index 8eb57740..695a08e2 100644 --- a/product_catch_weight/views/account_invoice_views.xml +++ b/product_catch_weight/views/account_invoice_views.xml @@ -25,21 +25,21 @@