Skip to content

Commit

Permalink
[MIG] stock_account_operating_unit: Migration to 17.0
Browse files Browse the repository at this point in the history
  • Loading branch information
BT-dherreros committed Jan 3, 2025
1 parent 9221c19 commit e6fc13f
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 14 deletions.
2 changes: 1 addition & 1 deletion stock_account_operating_unit/__manifest__.py
Original file line number Diff line number Diff line change
Expand Up @@ -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.,"
Expand Down
3 changes: 3 additions & 0 deletions stock_account_operating_unit/model/stock_move.py
Original file line number Diff line number Diff line change
Expand Up @@ -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(
Expand All @@ -25,6 +26,7 @@ def _generate_valuation_lines_data(
credit_value,
debit_account_id,
credit_account_id,
svl_id,
description,
)
if res:
Expand Down Expand Up @@ -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 = (
Expand Down
1 change: 1 addition & 0 deletions stock_account_operating_unit/readme/CONTRIBUTORS.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,3 +2,4 @@
\<<contact@eficent.com>\>
- Serpent Consulting Services Pvt. Ltd. \<<support@serpentcs.com>\>
- Jarsa Sistemas \<<info@jarsa.com.mx>\>
- Daniel Herreros \<<daniel.herreros@braintec.com>\>
Original file line number Diff line number Diff line change
Expand Up @@ -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"]
Expand Down Expand Up @@ -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
)
Expand Down Expand Up @@ -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,
}
)
Expand Down Expand Up @@ -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
Expand Down

0 comments on commit e6fc13f

Please sign in to comment.