adapt to 5.2
This commit is contained in:
parent
0d387b52b9
commit
7344a37678
|
@ -69,10 +69,12 @@ with Transaction().start(dbname, 0, context=context):
|
|||
|
||||
for company in Company.search([]):
|
||||
with Transaction().set_context(company=company.id):
|
||||
print("company:", company.id)
|
||||
accountConfig = AccountConfiguration(1)
|
||||
for field in ('account_receivable', 'account_payable',
|
||||
'account_expense', 'account_revenue'):
|
||||
value = get_property_value(field, company.id)
|
||||
print("Account:", field, value)
|
||||
if not value:
|
||||
continue
|
||||
setattr(accountConfig, mapping[field], value)
|
||||
|
@ -89,7 +91,7 @@ with Transaction().start(dbname, 0, context=context):
|
|||
accountConfig.save()
|
||||
Transaction().commit()
|
||||
|
||||
# with Transaction().start(dbname, 0, context=context):
|
||||
#with Transaction().start(dbname, 0, context=context):
|
||||
# Company = pool.get('company.company')
|
||||
# Model = pool.get('ir.model')
|
||||
# Field = pool.get('ir.model.field')
|
||||
|
|
|
@ -38,7 +38,7 @@ with Transaction().start(dbname, 1, context=context):
|
|||
config = Configuration(1)
|
||||
cdigits = config.default_account_code_digits or 8
|
||||
|
||||
for account in Account.search([('kind', '!=', 'view')]):
|
||||
for account in Account.search([('type', '!=', None)]):
|
||||
if account.code and len(account.code) < cdigits:
|
||||
digits = int(cdigits - len(account.code))
|
||||
if '%' in account.code:
|
||||
|
|
|
@ -456,6 +456,9 @@ before:
|
|||
- comment: # Change cast of weekday on account_invoice_payment_term_line
|
||||
version: 5.1
|
||||
query: alter table account_invoice_payment_term_line alter COLUMN weekday type integer using weekday::int
|
||||
- comment: # Set Second Currency of account_Account null if it's equal of company currency
|
||||
version: 5.1
|
||||
query: update account_account set second_currency = null where second_currency=(select currency from company_company where id=company)
|
||||
|
||||
after:
|
||||
|
||||
|
|
Loading…
Reference in New Issue