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

Sale Order Line on change not updating product name #73

Open
john-herholz-dt opened this issue Sep 12, 2022 · 0 comments
Open

Sale Order Line on change not updating product name #73

john-herholz-dt opened this issue Sep 12, 2022 · 0 comments
Labels

Comments

@john-herholz-dt
Copy link

john-herholz-dt commented Sep 12, 2022

I was investigating why the product name was not updated after the onchange event on sale order line product_id field.
The onchange was triggered but I found following problem that I cannot explain:

Module

connector-ecommerce

Describe the bug

Product name not updating via sale_order_onchange component

To Reproduce

14.0

Steps to reproduce the behavior:

  1. Import sale order through connector framework (I used Magento Connector customized)

Expected behavior
Product name in the sale order line updating

Problem found here

 def get_new_values(self, record, on_change_result, model=None):
        vals = on_change_result.get("value", {})
        new_values = {}
        for fieldname, value in vals.items():
            if fieldname not in record:
                if model:
                    column = self.env[model]._fields[fieldname]
                    if column.type == "many2one":
                        value = value[0]  # many2one are tuple (id, name)
                new_values[fieldname] = value
        return new_values

file components/sale_order_onchange.py line 17:
if fieldname not in record

This prevents the update, because the name field is in the record.
Can it be the "not" is wrong here? Why is it there actually?

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

No branches or pull requests

1 participant