mirror of
https://github.com/OCA/account-financial-tools.git
synced 2025-02-02 12:47:26 +02:00
@@ -8,6 +8,9 @@ def post_load_hook():
|
||||
def new_stock_account_prepare_anglo_saxon_out_lines_vals(self):
|
||||
lines_vals_list = []
|
||||
for move in self:
|
||||
# Make the loop multi-company safe when accessing models like product.product
|
||||
move = move.with_context(force_company=move.company_id.id)
|
||||
|
||||
if (
|
||||
not move.is_sale_document(include_receipts=True)
|
||||
or not move.company_id.anglo_saxon_accounting
|
||||
@@ -23,9 +26,9 @@ def post_load_hook():
|
||||
# FIRST HOOK ENDS
|
||||
|
||||
# Retrieve accounts needed to generate the COGS.
|
||||
accounts = line.product_id.product_tmpl_id.with_context(
|
||||
force_company=line.company_id.id
|
||||
).get_product_accounts(fiscal_pos=move.fiscal_position_id)
|
||||
accounts = line.product_id.product_tmpl_id.get_product_accounts(
|
||||
fiscal_pos=move.fiscal_position_id
|
||||
)
|
||||
debit_interim_account = accounts["stock_output"]
|
||||
credit_expense_account = accounts["expense"]
|
||||
if not credit_expense_account:
|
||||
|
||||
Reference in New Issue
Block a user