odoo/odoo#89472
Created by fw-bot
Merged
at 715e21741196b312fc6dee6b9f72a3624a6560a2
Statuses:
- legal/cla: Contributor License Agreement check
- ci/runbot: Odoo Test Suite
- ci/upgrade_enterprise: Test upgrades for enterprise master
- ci/template: Contact runbot team for help in case of failure.
- ci/style: Optional style check. Ignore it only if strictly necessary.
- ci/security: Required security check. Can only be ignored by security team.
- label
- odoo-dev:saas-12.3-12.0-13.0-fix_ambiguous_column_reference-arg-x7uu-fw
- head
- 5c2bdffd4bd830e3e2fdd04e037d0693e178a451
- merged
- 3 years ago by Upgrade, Christophe Simonis (chs)
odoo/odoo | |
---|---|
12.0 | #89218 |
saas-12.3 | #89472 |
13.0 | #89481 |
14.0 | #89498 |
[FW][FW][FIX] pos_sale: Abiguous column reference
In this database, the custom megaprint_fel
module add the
pos_order.qty
field. Then, when executing this query [1],
the AmbiguousColumn
error is raised.
(The fix has also been applied from 14.0)
[1] https://github.com/odoo/odoo/blob/12.0/addons/pos_sale/report/sale_report.py#L31-L32
arg_276911=> select id,module,name,model from ir_model_data where id = 23811;
id | module | name | model
-------+---------------+---------------------+-----------------
23811 | megaprint_fel | field_pos_order_qty | ir.model.fields
(1 row)
Traceback (most recent call last):
File "/home/odoo/src/odoo/12.0/odoo/service/server.py", line 1164, in preload_registries
registry = Registry.new(dbname, update_module=update_module)
File "/home/odoo/src/odoo/12.0/odoo/modules/registry.py", line 86, in new
odoo.modules.load_modules(registry._db, force_demo, status, update_module)
File "/home/odoo/src/odoo/12.0/odoo/modules/loading.py", line 417, in load_modules
force, status, report, loaded_modules, update_module, models_to_check)
File "/home/odoo/src/odoo/12.0/odoo/modules/loading.py", line 313, in load_marked_modules
perform_checks=perform_checks, models_to_check=models_to_check
File "/home/odoo/src/odoo/12.0/odoo/modules/loading.py", line 195, in load_module_graph
registry.init_models(cr, model_names, {'module': package.name})
File "/home/odoo/src/odoo/12.0/odoo/modules/registry.py", line 313, in init_models
model.init()
File "/home/odoo/src/odoo/12.0/addons/sale/report/sale_report.py", line 139, in init
self.env.cr.execute("""CREATE or REPLACE VIEW %s as (%s)""" % (self._table, self._query()))
File "/home/odoo/src/odoo/12.0/odoo/sql_db.py", line 148, in wrapper
return f(self, *args, **kwargs)
File "/home/odoo/src/odoo/12.0/odoo/sql_db.py", line 225, in execute
res = self._obj.execute(query, params)
psycopg2.errors.AmbiguousColumn: column reference "qty" is ambiguous
LINE 70: ... CASE WHEN pos.state = 'invoiced' THEN sum(qty) ELSE ...
^
--
I confirm I have signed the CLA and read the PR guidelines at www.odoo.com/submit-pr
Forward-Port-Of: #89218