diff --git a/stock_account_operating_unit/__manifest__.py b/stock_account_operating_unit/__manifest__.py index b909669448..3a609c95ad 100644 --- a/stock_account_operating_unit/__manifest__.py +++ b/stock_account_operating_unit/__manifest__.py @@ -7,7 +7,7 @@ "name": "Stock account moves with Operating Unit", "summary": "Create journal entries in moves between internal locations " "with different operating units.", - "version": "15.0.1.0.0", + "version": "17.0.1.0.0", "category": "Generic Modules/Sales & Purchases", "author": "Eficent Business and IT Consulting Services S.L., " "Serpent Consulting Services Pvt. Ltd.," diff --git a/stock_account_operating_unit/model/stock_move.py b/stock_account_operating_unit/model/stock_move.py index a53e853cc9..dec0f225f5 100644 --- a/stock_account_operating_unit/model/stock_move.py +++ b/stock_account_operating_unit/model/stock_move.py @@ -16,6 +16,7 @@ def _generate_valuation_lines_data( credit_value, debit_account_id, credit_account_id, + svl_id, description, ): res = super(StockMove, self)._generate_valuation_lines_data( @@ -25,6 +26,7 @@ def _generate_valuation_lines_data( credit_value, debit_account_id, credit_account_id, + svl_id, description, ) if res: @@ -101,6 +103,7 @@ def _action_done(self, cancel_backorder=False): move.product_id.standard_price, acc_valuation, acc_valuation, + False, _("%s - OU Move") % move.product_id.display_name, ) am = ( diff --git a/stock_account_operating_unit/readme/CONTRIBUTORS.md b/stock_account_operating_unit/readme/CONTRIBUTORS.md index 8727574b10..a04d0074fe 100644 --- a/stock_account_operating_unit/readme/CONTRIBUTORS.md +++ b/stock_account_operating_unit/readme/CONTRIBUTORS.md @@ -2,3 +2,4 @@ \<\> - Serpent Consulting Services Pvt. Ltd. \<\> - Jarsa Sistemas \<\> +- Daniel Herreros \<\> diff --git a/stock_account_operating_unit/tests/test_stock_account_operating_unit.py b/stock_account_operating_unit/tests/test_stock_account_operating_unit.py index 872b0a9812..0d941bb910 100644 --- a/stock_account_operating_unit/tests/test_stock_account_operating_unit.py +++ b/stock_account_operating_unit/tests/test_stock_account_operating_unit.py @@ -16,7 +16,6 @@ def setUp(self): self.account_model = self.env["account.account"] self.product_model = self.env["product.product"] self.product_cteg_model = self.env["product.category"] - self.acc_type_model = self.env["account.account.type"] self.operating_unit_model = self.env["operating.unit"] self.company_model = self.env["res.company"] self.move_model = self.env["stock.move"] @@ -55,24 +54,24 @@ def setUp(self): # Create account for Goods Received Not Invoiced name = "Goods Received Not Invoiced" code = "grni" - acc_type = self.env.ref("account.data_account_type_equity") + acc_type = "equity" self.account_grni = self._create_account(acc_type, name, code, self.company) # Create account for Cost of Goods Sold name = "Cost of Goods Sold" code = "cogs" - acc_type = self.env.ref("account.data_account_type_expenses") + acc_type = "expense" self.account_cogs_id = self._create_account(acc_type, name, code, self.company) # Create account for Inventory name = "Inventory" code = "inventory" - acc_type = self.env.ref("account.data_account_type_fixed_assets") + acc_type = "asset_fixed" self.account_inventory = self._create_account( acc_type, name, code, self.company ) # Create account for Inter-OU Clearing name = "Inter-OU Clearing" - code = "inter_ou" - acc_type = self.env.ref("account.data_account_type_equity") + code = "inter.ou" + acc_type = "equity" self.account_inter_ou_clearing = self._create_account( acc_type, name, code, self.company ) @@ -118,7 +117,7 @@ def _create_account(self, acc_type, name, code, company): { "name": name, "code": code, - "user_type_id": acc_type.id, + "account_type": acc_type, "company_id": company.id, } ) @@ -175,12 +174,7 @@ def _confirm_receive(self, user_id, picking): """ picking.action_confirm() picking.action_assign() - res = picking.with_user(user_id).button_validate() - wiz = Form( - self.env[res["res_model"]].with_context(**res["context"]), - view=self.env.ref("stock.view_immediate_transfer"), - ).save() - wiz.process() + picking.with_user(user_id).button_validate() def _check_account_balance( self, account_id, operating_unit=None, expected_balance=0.0