account 1. We introduced a new Production Cost account that can be set on locations with Production type. When products move into/out of a production location. The account entry will be post on this account instead of previous Stock in/out account. 2. On the accounting setting page, we can now set the default values for all stock accounts. Users can also disable automatically accounting for stock there. Task-3046333 closes odoo/odoo#113973 Related: odoo/enterprise#37653 Signed-off-by: Tiffany Chang <tic@odoo.com>
15 lines
801 B
Python
15 lines
801 B
Python
# -*- coding: utf-8 -*-
|
|
# Part of Odoo. See LICENSE file for full copyright and licensing details.
|
|
from . import models
|
|
|
|
|
|
def _configure_journals(env):
|
|
# if we already have a coa installed, create journal and set property field
|
|
for company in env['res.company'].search([('chart_template', '!=', False)]):
|
|
ChartTemplate = env['account.chart.template'].with_company(company)
|
|
template_code = company.chart_template
|
|
template_data = ChartTemplate._get_chart_template_data(template_code)['template_data']
|
|
if 'property_stock_account_production_cost_id' in template_data:
|
|
data = {'property_stock_account_production_cost_id': template_data['property_stock_account_production_cost_id']}
|
|
ChartTemplate._post_load_data(template_code, company, data)
|