mirror of
https://bitbucket.org/presik/trytonpsk-production_accounting.git
synced 2023-12-14 05:22:54 +01:00
minor fix in Production/done/get_production_lines
This commit is contained in:
parent
4612b2370d
commit
01516cc3e1
1 changed files with 5 additions and 1 deletions
|
@ -231,14 +231,16 @@ class Production(metaclass=PoolMeta):
|
|||
cost_production = []
|
||||
output = rec.bom.outputs[0]
|
||||
lines = []
|
||||
company = Transaction().context.get('company')
|
||||
for input in rec.inputs:
|
||||
account_id = input.product.account_expense_used.id
|
||||
amount = input.product.cost_price * Decimal(input.quantity)
|
||||
amount = round(input.product.cost_price * Decimal(input.quantity), 2)
|
||||
line = {
|
||||
'description': input.product.rec_name,
|
||||
'account': account_id,
|
||||
'debit': 0,
|
||||
'credit': amount,
|
||||
'party': company,
|
||||
}
|
||||
cost_production.append(amount)
|
||||
cls.set_analytic_lines(line, date_, rec.analytic_account_materials)
|
||||
|
@ -252,6 +254,7 @@ class Production(metaclass=PoolMeta):
|
|||
'account': account_id,
|
||||
'debit': 0,
|
||||
'credit': cost.amount,
|
||||
'party': company,
|
||||
}
|
||||
cls.set_analytic_lines(line_, date_, cost.analytic_account)
|
||||
lines.append(line_)
|
||||
|
@ -262,6 +265,7 @@ class Production(metaclass=PoolMeta):
|
|||
'account': output_account_category.id if output_account_category else None,
|
||||
'debit': sum(cost_production),
|
||||
'credit': 0,
|
||||
'party': company,
|
||||
}
|
||||
lines.append(stock_in)
|
||||
return lines
|
||||
|
|
Loading…
Reference in a new issue