-
-
Notifications
You must be signed in to change notification settings - Fork 1.1k
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
[17.0][MIG]sale_order_line_input: Migration to version 17.0 #3232
[17.0][MIG]sale_order_line_input: Migration to version 17.0 #3232
Conversation
Please check CI. Remember to pass pre-commit always before submitting. It can be trigger automatically if you do |
/ocabot migration sale_order_line_input |
47f5a37
to
0753f33
Compare
@sbidoul I see the problem comes from this commit that entered the other day: The DB should have |
edcb089
to
a65b589
Compare
@sbidoul @pedrobaeza It seems it has been fixed in the meanwhile: odoo/odoo#173101 |
Yes, it has been tracked in OCA/oca-ci#74, but they have found and solved soon the problem. It was not their intention to have the extra dependency when optimizing it. Anyway, it's very interesting to have the extension on production databases to benefit from these optimizations. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Also rebase to fix the CI
groups="product.group_stock_packaging" | ||
optional="show" | ||
/> | ||
<field | ||
name="product_packaging_id" | ||
attrs="{'invisible': [('product_id', '=', False)]}" | ||
column_invisible="product_id == False" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It's probably valid in the views, but better state it as:
column_invisible="product_id == False" | |
column_invisible="not product_id" |
'required': [('display_type', '=', False)], | ||
}" | ||
readonly="product_uom_readonly" | ||
required="display_type == False" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
same here. we want to coherce any falsey value not just False
:
required="not display_type"
readonly="product_updatable == False" | ||
required="display_type == False" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
readonly="not product_updatable"
required="not display_type"
readonly="product_updatable == False" | ||
required="display_type == False" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
readonly="not product_updatable"
required="not display_type"
@@ -47,18 +48,16 @@ | |||
context="{'res_partner_search_mode': 'customer', 'default_is_company': True, 'default_customer_rank': 1}" | |||
options='{"always_reload": True}' | |||
required="1" | |||
attrs="{'readonly': [('order_partner_id', '!=', False), ('order_id', '!=', False)]}" | |||
readonly="'order_id', 'order_partner_id'" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You have to do a python statement equivalent to the former attr readonly domain.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks like pre-commit brought changes to another module in the repo. It would be prefereble to have them in another commit at least (or even in another repo!)
0a2272f
to
3c14d1e
Compare
What is missing here? |
3c14d1e
to
bb663fa
Compare
codecov/patch was returning an error for the _onchange_order_partner_id function because it was not fully covered by the test. I have modified it, and it is now correct. |
bb663fa
to
b8d138c
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
An error occurred during functional tests.
- Open the Sales Order Lines list view
- Create a new sale order line
- Select a product first
After selecting the product, the error below occurs. Seems related to Disabling the module does not fix the issue.product_supplierinfo_for_customer_sale
. Can you confirm?
Traceback (most recent call last):
File "/opt/odoo/odoo/models.py", line 5856, in ensure_one
_id, = self._ids
ValueError: not enough values to unpack (expected 1, got 0)
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "/opt/odoo/odoo/http.py", line 1764, in _serve_db
return service_model.retrying(self._serve_ir_http, self.env)
File "/opt/odoo/odoo/service/model.py", line 133, in retrying
result = func()
File "/opt/odoo/odoo/http.py", line 1791, in _serve_ir_http
response = self.dispatcher.dispatch(rule.endpoint, args)
File "/opt/odoo/odoo/http.py", line 1995, in dispatch
result = self.request.registry['ir.http']._dispatch(endpoint)
File "/opt/odoo/odoo/addons/base/models/ir_http.py", line 222, in _dispatch
result = endpoint(**request.params)
File "/opt/odoo/odoo/http.py", line 741, in route_wrapper
result = endpoint(self, *args, **params_ok)
File "/opt/odoo/addons/web/controllers/dataset.py", line 24, in call_kw
return self._call_kw(model, method, args, kwargs)
File "/opt/odoo/addons/web/controllers/dataset.py", line 20, in _call_kw
return call_kw(request.env[model], method, args, kwargs)
File "/opt/odoo/odoo/api.py", line 468, in call_kw
result = _call_kw_multi(method, model, args, kwargs)
File "/opt/odoo/odoo/api.py", line 453, in _call_kw_multi
result = method(recs, *args, **kwargs)
File "/opt/odoo/addons/web/models/models.py", line 1073, in onchange
todo = [
File "/opt/odoo/addons/web/models/models.py", line 1076, in <listcomp>
if field_name not in done and snapshot0.has_changed(field_name)
File "/opt/odoo/addons/web/models/models.py", line 1189, in has_changed
return self[field_name] != self.record[field_name]
File "/opt/odoo/odoo/models.py", line 6638, in __getitem__
return self._fields[key].__get__(self, self.env.registry[self._name])
File "/opt/odoo/odoo/fields.py", line 1152, in __get__
self.recompute(record)
File "/opt/odoo/odoo/fields.py", line 1367, in recompute
apply_except_missing(self.compute_value, recs)
File "/opt/odoo/odoo/fields.py", line 1340, in apply_except_missing
func(records)
File "/opt/odoo/odoo/fields.py", line 1389, in compute_value
records._compute_field_value(self)
File "/opt/odoo/odoo/models.py", line 4882, in _compute_field_value
fields.determine(field.compute, self)
File "/opt/odoo/odoo/fields.py", line 102, in determine
return needle(*args)
File "/opt/odoo/addons/sale_management/models/sale_order_line.py", line 16, in _compute_name
super()._compute_name()
File "/mnt/data/odoo-addons-dir/product_supplierinfo_for_customer_sale/models/sale_order_line.py", line 42, in _compute_name
super(SaleOrderLine, item)._compute_name()
File "/opt/odoo/addons/sale/models/sale_order_line.py", line 319, in _compute_name
lang = line.order_id._get_lang()
File "/opt/odoo/addons/sale/models/sale_order.py", line 1948, in _get_lang
self.ensure_one()
File "/opt/odoo/odoo/models.py", line 5859, in ensure_one
raise ValueError("Expected singleton: %s" % self)
ValueError: Expected singleton: sale.order()
The above server error caused the following client error:
RPC_ERROR: Odoo Server Error
RPCError@http://oca-sale-workflow-17-0-pr3232-b8d138ccacb4.runboat.odoo-community.org/web/assets/302b793/web.assets_web.min.js:2883:324
makeErrorFromResponse@http://oca-sale-workflow-17-0-pr3232-b8d138ccacb4.runboat.odoo-community.org/web/assets/302b793/web.assets_web.min.js:2886:175
@http://oca-sale-workflow-17-0-pr3232-b8d138ccacb4.runboat.odoo-community.org/web/assets/302b793/web.assets_web.min.js:2890:34
@sanderlienaerts the problem seems to be with module |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@juanjosesegui-tecnativa as a suggestion, you could use this module to facilitate the migration of attrs to Python expressions
/> | ||
<field | ||
name="product_packaging_qty" | ||
invisible="'|', not product_id, not product_packaging_id" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please check this expression is wrong, convert to python expression
invisible="'|', not product_id, not product_packaging_id" | |
invisible="not product_id or not product_packaging_id" |
context="{'res_partner_search_mode': 'customer', 'default_is_company': True, 'default_customer_rank': 1}" | ||
options='{"always_reload": True}' | ||
required="1" | ||
readonly="('order_partner_id', '!=', False), ('order_id', '!=', False)" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
check expression
decoration-bf="(not display_type and invoice_status == 'to invoice')" | ||
string="Delivered" | ||
invisible="state != 'sale'" | ||
readonly="'qty_delivered_method' != 'manual'" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think it must be evaluated as an expression instead of a string.
readonly="'qty_delivered_method' != 'manual'" | |
readonly="qty_delivered_method != 'manual'" |
<field | ||
name="price_total" | ||
widget="monetary" | ||
invisible="(is_downpayment),('tax_calculation_rounding_method', '=' ,'round_globally')" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
and here
That work has potential to be converted into a great contribution to https://github.com/OCA/odoo-module-migrator |
5bbdbdb
to
882a124
Compare
[UPD] README.rst [UPD] Update sale_order_line_input.pot
[UPD] Update sale_order_line_input.pot [UPD] README.rst Update translation files Updated by "Update PO files to match POT (msgmerge)" hook in Weblate. Translation: sale-workflow-12.0/sale-workflow-12.0-sale_order_line_input Translate-URL: https://translation.odoo-community.org/projects/sale-workflow-12-0/sale-workflow-12-0-sale_order_line_input/
[UPD] Update sale_order_line_input.pot [UPD] README.rst
to solve a pypi upload issue
Since v13 the customer field on res.partner model has been disappeared, so when we try to add a value on the field order_partner_id we get an error. sale_order_line_input 13.0.1.1.0
…any domains don't work. Taxes empty
[MIG] sale_order_line_input: Migration to 14.0
[UPD] Update sale_order_line_input.pot [UPD] README.rst [IMP] update dotfiles [ci skip] [UPD] README.rst [UPD] README.rst
…d to show order from order line
Currently translated at 100.0% (22 of 22 strings) Translation: sale-workflow-16.0/sale-workflow-16.0-sale_order_line_input Translate-URL: https://translation.odoo-community.org/projects/sale-workflow-16-0/sale-workflow-16-0-sale_order_line_input/it/
decoration-info="invoice_status =='to invoice'" | ||
decoration-warning="state =='draft'" | ||
decoration-muted="state =='cancel'" | ||
decoration-success="order_locked == True" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'd simply change this to decoration-success="invoice_status =='invoiced'" and get rid of the order_locked
stuff
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, because the locked field of sale.order is a flag that is controlled by the setting of blocking confirmed sales orders, so it is not valid to use it as a flag. Thanks
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I have added the changes and also reverted the pre-commit changes in another module.
882a124
to
3f99e05
Compare
You can try again, it should be solved. Thanks |
@carlos-lopez-tecnativa Can you check again? Thanks |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Some changes from other module slipped into your PR
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
removed
3f99e05
to
38f6cd2
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Test and code 👍
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM thanks
/ocabot merge nobump |
This PR looks fantastic, let's merge it! |
Congratulations, your PR was merged at d618cf6. Thanks a lot for contributing to OCA. ❤️ |
@Tecnativa TT50121