Set null account/taxes product categories

This commit is contained in:
Raimon Esteve 2018-09-25 21:42:33 +02:00
parent ce7b343706
commit 08095594ec
2 changed files with 16 additions and 5 deletions

View file

@ -96,6 +96,22 @@ with Transaction().start(dbname, 1, context=context):
if to_write:
Template.write(*to_write)
logger.info('%s: Upgrading Account Categories' % (company.rec_name))
for category in Category.search([('accounting', '=', False)]):
category.account_expense = None
category.account_revenue = None
category.save()
query = "DROP TABLE if exists product_customer_taxes_rel;"
cursor.execute(query)
query = "DROP TABLE if exists product_supplier_taxes_rel;"
cursor.execute(query)
query = "DROP TABLE if exists product_category_customer_taxes_rel;"
cursor.execute(query)
query = "DROP TABLE if exists product_category_supplier_taxes_rel;"
cursor.execute(query)
Transaction().cursor.commit()
logger.info('Done')

View file

@ -406,11 +406,6 @@ after:
query: DELETE from res_user where login in ('user_cron_purchase_request', 'user_cron_internal_shipment');
DELETE from ir_model_data where module = 'stock_supply' and model = 'res.user';
- comment: # Drop customer/taxes tables don't use
version: 5.0
query: DROP TABLE if exists product_customer_taxes_rel;
DROP TABLE if exists product_supplier_taxes_rel;
# - comment: # upgrade configuration models from ir_property
# version: 4.8
# script: ./upgrades/after/migration_properties.py