diff --git a/before/migration_account_category.py b/before/migration_account_category.py index 5641728..ac41cb3 100755 --- a/before/migration_account_category.py +++ b/before/migration_account_category.py @@ -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') diff --git a/config.yml b/config.yml index 3b28a81..e345337 100644 --- a/config.yml +++ b/config.yml @@ -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