From 3e2e1cd9bff966edcf948bf574130879c6d129e6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Roc=C3=ADo=20Vega?= Date: Tue, 26 Mar 2024 10:24:25 -0300 Subject: [PATCH] [MIG] stock_landed_costs_analytic: Migration to 17.0 --- stock_landed_costs_analytic/__manifest__.py | 2 +- stock_landed_costs_analytic/models/__init__.py | 1 + .../models/stock_landed_cost.py | 10 ++++++++++ .../models/stock_valuation_adjustment_lines.py | 2 +- .../tests/test_stock_landed_costs_analytic.py | 3 ++- 5 files changed, 15 insertions(+), 3 deletions(-) create mode 100644 stock_landed_costs_analytic/models/stock_landed_cost.py diff --git a/stock_landed_costs_analytic/__manifest__.py b/stock_landed_costs_analytic/__manifest__.py index 45cae5c71b..ede0af054d 100644 --- a/stock_landed_costs_analytic/__manifest__.py +++ b/stock_landed_costs_analytic/__manifest__.py @@ -7,7 +7,7 @@ This module adds an analytic account and analytic tags on landed costs lines so that on landed costs validation account moves get analytic account and analytic tags values from landed costs lines.""", - "version": "16.0.1.0.0", + "version": "17.0.1.0.0", "license": "AGPL-3", "author": "ACSONE SA/NV,Odoo Community Association (OCA)", "website": "https://github.com/OCA/account-analytic", diff --git a/stock_landed_costs_analytic/models/__init__.py b/stock_landed_costs_analytic/models/__init__.py index 6bc349a804..20f2100664 100644 --- a/stock_landed_costs_analytic/models/__init__.py +++ b/stock_landed_costs_analytic/models/__init__.py @@ -1,2 +1,3 @@ from . import stock_landed_cost_lines from . import stock_valuation_adjustment_lines +from . import stock_landed_cost diff --git a/stock_landed_costs_analytic/models/stock_landed_cost.py b/stock_landed_costs_analytic/models/stock_landed_cost.py new file mode 100644 index 0000000000..bd97044bcc --- /dev/null +++ b/stock_landed_costs_analytic/models/stock_landed_cost.py @@ -0,0 +1,10 @@ +from odoo import api, models + + +class StockLandedCost(models.Model): + _name = "stock.landed.cost" + _inherit = "stock.landed.cost" + + @api.model_create_multi + def create(self, vals_list): + return super().create(vals_list) diff --git a/stock_landed_costs_analytic/models/stock_valuation_adjustment_lines.py b/stock_landed_costs_analytic/models/stock_valuation_adjustment_lines.py index 9e9efa3133..94863edea4 100644 --- a/stock_landed_costs_analytic/models/stock_valuation_adjustment_lines.py +++ b/stock_landed_costs_analytic/models/stock_valuation_adjustment_lines.py @@ -11,7 +11,7 @@ class StockValuationAdjustmentLines(models.Model): def _create_account_move_line( self, move, credit_account_id, debit_account_id, qty_out, already_out_account_id ): - res = super(StockValuationAdjustmentLines, self)._create_account_move_line( + res = super()._create_account_move_line( move, credit_account_id, debit_account_id, qty_out, already_out_account_id ) cost_line = self.cost_line_id diff --git a/stock_landed_costs_analytic/tests/test_stock_landed_costs_analytic.py b/stock_landed_costs_analytic/tests/test_stock_landed_costs_analytic.py index a3a9fc5ed1..918c3d0c92 100644 --- a/stock_landed_costs_analytic/tests/test_stock_landed_costs_analytic.py +++ b/stock_landed_costs_analytic/tests/test_stock_landed_costs_analytic.py @@ -6,7 +6,7 @@ class TestStockLandedCostsAnalytic(TransactionCase): def setUp(self): - super(TestStockLandedCostsAnalytic, self).setUp() + super().setUp() self.Product = self.env["product.product"] self.Picking = self.env["stock.picking"] self.LandedCost = self.env["stock.landed.cost"] @@ -78,6 +78,7 @@ def setUp(self): "name": "Move Test", "product_id": self.product.id, "product_uom_qty": 5, + "quantity": 5, "product_uom": self.ref("uom.product_uom_unit"), "location_id": self.supplier_location.id, "location_dest_id": self.customer_location.id,