Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[ADD] fleet_vehicle_purchase #128

Merged
merged 1 commit into from
Feb 27, 2024
Merged

[ADD] fleet_vehicle_purchase #128

merged 1 commit into from
Feb 27, 2024

Conversation

etobella
Copy link
Member

Allow to define fleet vehicles on Purchase Orders in order to inherit them properly

@rpsjr
Copy link

rpsjr commented Nov 23, 2023

runboat functional test fails, trying to associate a veichle to a purchase order

image
image

Error:
Odoo Server Error

Traceback (most recent call last):
File "/opt/odoo/odoo/addons/base/models/ir_http.py", line 237, in _dispatch
result = request.dispatch()
File "/opt/odoo/odoo/http.py", line 696, in dispatch
result = self._call_function(**self.params)
File "/opt/odoo/odoo/http.py", line 370, in _call_function
return checked_call(self.db, *args, **kwargs)
File "/opt/odoo/odoo/service/model.py", line 94, in wrapper
return f(dbname, *args, **kwargs)
File "/opt/odoo/odoo/http.py", line 358, in checked_call
result = self.endpoint(*a, **kw)
File "/opt/odoo/odoo/http.py", line 919, in call
return self.method(*args, **kw)
File "/opt/odoo/odoo/http.py", line 544, in response_wrap
response = f(*args, **kw)
File "/opt/odoo/addons/web/controllers/main.py", line 1370, in call_kw
return self._call_kw(model, method, args, kwargs)
File "/opt/odoo/addons/web/controllers/main.py", line 1362, in _call_kw
return call_kw(request.env[model], method, args, kwargs)
File "/opt/odoo/odoo/api.py", line 400, in call_kw
result = _call_kw_model(method, model, args, kwargs)
File "/opt/odoo/odoo/api.py", line 373, in _call_kw_model
result = method(recs, *args, **kwargs)
File "/opt/odoo/odoo/models.py", line 1805, in name_search
return self.browse(ids).sudo().name_get()
File "/opt/odoo/odoo/models.py", line 1750, in name_get
result.append((record.id, convert(record[name], record)))
File "/opt/odoo/odoo/models.py", line 5716, in getitem
return self._fields[key].get(self, type(self))
File "/opt/odoo/odoo/fields.py", line 1019, in get
recs._fetch_field(self)
File "/opt/odoo/odoo/models.py", line 3078, in _fetch_field
self._read(fnames)
File "/opt/odoo/odoo/models.py", line 3145, in _read
cr.execute(query_str, params + [sub_ids])
File "", line 2, in execute
File "/opt/odoo/odoo/sql_db.py", line 101, in check
return f(self, *args, **kwargs)
File "/opt/odoo/odoo/sql_db.py", line 301, in execute
res = self._obj.execute(query, params)
File "/opt/odoo-venv/lib/python3.8/site-packages/psycopg2/extensions.py", line 126, in getquoted
qobjs = [o.getquoted() for o in pobjs]
File "/opt/odoo-venv/lib/python3.8/site-packages/psycopg2/extensions.py", line 126, in
qobjs = [o.getquoted() for o in pobjs]
File "/opt/odoo-venv/lib/python3.8/site-packages/psycopg2/extensions.py", line 121, in getquoted
pobjs = [adapt(o) for o in self._seq]
File "/opt/odoo-venv/lib/python3.8/site-packages/psycopg2/extensions.py", line 121, in
pobjs = [adapt(o) for o in self._seq]
Exception

The above exception was the direct cause of the following exception:

Traceback (most recent call last):
File "/opt/odoo/odoo/http.py", line 652, in _handle_exception
return super(JsonRequest, self)._handle_exception(exception)
File "/opt/odoo/odoo/http.py", line 317, in _handle_exception
raise exception.with_traceback(None) from new_cause
psycopg2.ProgrammingError: can't adapt type 'lazy'

@etobella
Copy link
Member Author

I see the issue, but it is unrelated to this module. Obviously, If you go to services and try to change the vehicle, the same error is raised. Anyway, I will check why this happens

@rpsjr
Copy link

rpsjr commented Nov 27, 2023

I see the issue, but it is unrelated to this module. Obviously, If you go to services and try to change the vehicle, the same error is raised. Anyway, I will check why this happens

the patch solved the error, could u rebase?

and, what do u think about add vehicle field to the purchase PDF reports?

Copy link

@ivantodorovich ivantodorovich left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, thanks! :)

@marcelsavegnago
Copy link
Member

@etobella Can you do a rebase, please?

Copy link
Member

@marcelsavegnago marcelsavegnago left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM. ❤️

@etobella
Copy link
Member Author

/ocabot merge nobump

@OCA-git-bot
Copy link
Contributor

This PR looks fantastic, let's merge it!
Prepared branch 14.0-ocabot-merge-pr-128-by-etobella-bump-nobump, awaiting test results.

@OCA-git-bot OCA-git-bot merged commit 047f26e into OCA:14.0 Feb 27, 2024
6 of 7 checks passed
@OCA-git-bot
Copy link
Contributor

Congratulations, your PR was merged at c2ce6ac. Thanks a lot for contributing to OCA. ❤️

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants