[FIX] mrp_account: produce mo when production account given
This issue occurs when the user has not provided production account and is trying to produce the manufacturing order. steps to produce: - Install `mrp_production`, `account_accountant`. - From Settings > Users > Manage Users select a user (eg: Mitchell Admin) and under `Technical` select `Stock Accounting Automatic group`. - Inventry > Configuration > Products > Product Categories open a category and change it's `Inventry Valuation` (property_valuation) to Automated. - Through Accounting > Configuaration > Settings > Stock Valuation check `Automatic Accounting` and remove Production Account and save it. (You will see that production account got removed from the product category). - Now create a manufacturing order by Manufacturing > Operations > Manufacturing Orders - While creating manufacturing order select the product which comes under product category you have modified, then confirm the manufacturing order. - Once it is confirmed click on `Produce All`. video: https://encr.pw/09a2c Error: `AttributeError: 'bool' object has no attribute 'id'` Through our commit if the user does not specify a `Production Account` then the user will face the UserError. The error is specified in `_get_accounting_data_for_valuation` function while checking for `account_src` or `account_dest`. sentry-4271608065 closes odoo/odoo#128594 X-original-commit: 9265e785dedd8943296573fc6e5218925a33c522 Signed-off-by: William Henrotin (whe) <whe@odoo.com>
This commit is contained in:
@@ -12,7 +12,7 @@ class ProductTemplate(models.Model):
|
||||
def _get_product_accounts(self):
|
||||
accounts = super()._get_product_accounts()
|
||||
accounts.update({
|
||||
'production': self.categ_id.property_stock_account_production_cost_id or False,
|
||||
'production': self.categ_id.property_stock_account_production_cost_id,
|
||||
})
|
||||
return accounts
|
||||
|
||||
|
||||
Reference in New Issue
Block a user