1200wd / 1200wd_addons

Odoo Apps by 1200 Web Development
Other
1 stars 8 forks source link

8.0 4171 colli info per carrier #60

Closed daramousk closed 6 years ago

daramousk commented 6 years ago

Refactors synchronization code and allows the user to set a different packaging type per carrier

1) Make sure that when the sync is done, server wins (local data will be overwritten) 2) A new table has been created that holds the package types of transsmart 3) A new field has been inserted on res_partner that you can use to set the default package type for that carrier 4) You must set a a default package type on the carriers or on the default carrier, if not the sync will fail with a rather non descriptive error message that will be fixed on a later pull request

@hbrunn @gcapalbo @NL66278 Please review this

daramousk commented 6 years ago

@NL66278 Fully refactored again, cut down to 1/3 of its size

lfreeke commented 6 years ago

2017-10-24 12:49:10,765 7019 ERROR ari_test openerp.sql_db: bad query: ALTER TABLE "res_partner" ADD FOREIGN KEY ("transsmart_package_type_id") REFERENCES "delivery_package_type" ON DELETE set null Traceback (most recent call last): File "/home/odoariacp80/odoo/parts/odoo/openerp/sql_db.py", line 247, in execute res = self._obj.execute(query, params) IntegrityError: insert or update on table "res_partner" violates foreign key constraint "res_partner_transsmart_package_type_id_fkey" DETAIL: Key (transsmart_package_type_id)=(2) is not present in table "delivery_package_type".

Traceback (most recent call last): File "./bin/upgrade_odoo", line 79, in sys.exit(anybox.recipe.odoo.runtime.upgrade.upgrade('/home/odoariacp80/odoo/upgrade.py', 'run', '/home/odoariacp80/odoo/etc/odoo.cfg', '/home/odoariacp80/odoo')) File "/home/odoariacp80/odoo/eggs/anybox.recipe.odoo-1.9.3.dev0-py2.7.egg/anybox/recipe/odoo/runtime/upgrade.py", line 151, in upgrade statuscode = getattr(upgrade_module, upgrade_callable)(session, logger) File "/home/odoariacp80/odoo/upgrade.py", line 19, in run session.update_modules(['all']) File "/home/odoariacp80/odoo/eggs/anybox.recipe.odoo-1.9.3.dev0-py2.7.egg/anybox/recipe/odoo/runtime/session.py", line 418, in update_modules db, update_module=True) File "/home/odoariacp80/odoo/parts/odoo/openerp/modules/registry.py", line 339, in get update_module) File "/home/odoariacp80/odoo/parts/odoo/openerp/modules/registry.py", line 370, in new openerp.modules.load_modules(registry._db, force_demo, status, update_module) File "/home/odoariacp80/odoo/parts/odoo/openerp/modules/loading.py", line 350, in load_modules force, status, report, loaded_modules, update_module) File "/home/odoariacp80/odoo/parts/odoo/openerp/modules/loading.py", line 255, in load_marked_modules loaded, processed = load_module_graph(cr, graph, progressdict, report=report, skip_modules=loaded_modules, perform_checks=perform_checks) File "/home/odoariacp80/odoo/parts/odoo/openerp/modules/loading.py", line 157, in load_module_graph init_module_models(cr, package.name, models) File "/home/odoariacp80/odoo/parts/odoo/openerp/modules/module.py", line 297, in init_module_models obj._auto_end(cr, {'module': module_name}) File "/home/odoariacp80/odoo/parts/pos/pos_remove_pos_category/product.py", line 106, in _auto_end return _auto_end_original(self, cr, context=context) File "/home/odoariacp80/odoo/parts/odoo/openerp/api.py", line 268, in wrapper return old_api(self, *args, *kwargs) File "/home/odoariacp80/odoo/parts/odoo/openerp/models.py", line 2733, in _auto_end cr.execute('ALTER TABLE "%s" ADD FOREIGN KEY ("%s") REFERENCES "%s" ON DELETE %s' % (t, k, r, d)) File "/home/odoariacp80/odoo/parts/odoo/openerp/sql_db.py", line 171, in wrapper return f(self, args, **kwargs) File "/home/odoariacp80/odoo/parts/odoo/openerp/sql_db.py", line 247, in execute res = self._obj.execute(query, params) psycopg2.IntegrityError: insert or update on table "res_partner" violates foreign key constraint "res_partner_transsmart_package_type_id_fkey" DETAIL: Key (transsmart_package_type_id)=(2) is not present in table "delivery_package_type".