mth-odoo eac4dca6dd [FIX] account: updated the alias for an ambiguous column
Before this commit
------------------
Before this commit, the db migration from the 15.0 to 16.0  test case is failing
while this is migrating analytic_account, in computing methods
trying to use a direct field without reference.

 Traceback (most recent call last):
   File "/tmp/tmpmjg7gno3/migrations/base/tests/test_mock_crawl.py", line 223, in crawl_menu
    self.mock_action(action_vals)
   File "/tmp/tmpmjg7gno3/migrations/base/tests/test_mock_crawl.py", line 377, in mock_action
    mock_method(model, view, fields_list, domain, group_by)
   File "/tmp/tmpmjg7gno3/migrations/base/tests/test_mock_crawl.py", line 405, in mock_view_form
    [data] = record.read(fields_list)
   File "/home/odoo/src/odoo/16.0/odoo/models.py", line 2977, in read
    return self._read_format(fnames=fields, load=load)
   File "/home/odoo/src/odoo/16.0/odoo/models.py", line 3126, in _read_format
    vals[name] = convert(record[name], record, use_name_get)
   File "/home/odoo/src/odoo/16.0/odoo/models.py", line 5847, in __getitem__
    return self._fields[key].__get__(self, type(self))
   File "/home/odoo/src/odoo/16.0/odoo/fields.py", line 1188, in __get__
    self.compute_value(recs)
   File "/home/odoo/src/odoo/16.0/odoo/fields.py", line 1347, in compute_value
    records._compute_field_value(self)
   File "/home/odoo/src/odoo/16.0/addons/mail/models/mail_thread.py", line 403, in _compute_field_value
    return super()._compute_field_value(field)
   File "/home/odoo/src/odoo/16.0/odoo/models.py", line 4186, in _compute_field_value
    getattr(self, field.compute)()
   File "/home/odoo/src/odoo/16.0/addons/account/models/account_analytic_account.py", line 38, in _compute_invoice_count
    self._cr.execute(query_string, query_param)
   File "/home/odoo/src/odoo/16.0/odoo/sql_db.py", line 516, in execute
    return self._cursor.execute(*args, **kwargs)
   File "/home/odoo/src/odoo/16.0/odoo/sql_db.py", line 313, in execute
    res = self._obj.execute(query, params)
 psycopg2.errors.AmbiguousColumn: column reference "move_id" is ambiguous
LINE 1: ...lytic_distribution) as account_id, COUNT(DISTINCT(move_id)) ...

After this commit
-----------------
In this commit added the reference to the move_id which is used without reference.

closes odoo/odoo#115160

Taskid: 3141476
X-original-commit: 6ae96c7f707cdd2beac241280957bd3b3661b94d
Signed-off-by: William André (wan) <wan@odoo.com>
2023-03-14 12:24:15 +01:00
…
…
…
…
…
…
…

Build Status Tech Doc Help Nightly Builds

Odoo

Odoo is a suite of web based open source business apps.

The main Odoo Apps include an Open Source CRM, Website Builder, eCommerce, Warehouse Management, Project Management, Billing & Accounting, Point of Sale, Human Resources, Marketing, Manufacturing, ...

Odoo Apps can be used as stand-alone applications, but they also integrate seamlessly so you get a full-featured Open Source ERP when you install several Apps.

Getting started with Odoo

For a standard installation please follow the Setup instructions from the documentation.

To learn the software, we recommend the Odoo eLearning, or Scale-up, the business game. Developers can start with the developer tutorials

S
Description
No description provided
Readme LGPL-3.0
3.4 GiB
Languages
Python 49.6%
JavaScript 47.8%
SCSS 2%
CSS 0.3%
HTML 0.2%