Skip to content

Comments

[FIX] product_code_unique - remove duplicate warning for "Internal Reference"#2184

Open
anthonissen-a wants to merge 1 commit intoOCA:18.0from
acsone:18.0-fix-product_code_unique-aan
Open

[FIX] product_code_unique - remove duplicate warning for "Internal Reference"#2184
anthonissen-a wants to merge 1 commit intoOCA:18.0from
acsone:18.0-fix-product_code_unique-aan

Conversation

@anthonissen-a
Copy link

Remove the standard warnings from Odoo when trying to save a duplicate "Internal Reference", because this module already introduces a constraint avoiding duplicates.

Copy link
Member

@rvalyi rvalyi left a comment

Choose a reason for hiding this comment

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

doing it this way feels a bit dangerous as it bypasses the method chain entirely. Imagine some module is doing something important in _onchange_default_code, it may not be called anymore because super is not called...

What about calling super and removing the "warning" key from the super result instead?

]

@api.onchange()
def _onchange_default_code(self):
Copy link
Contributor

Choose a reason for hiding this comment

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

You cannot do that as you are not aware of other modules overriding this

Copy link
Contributor

Choose a reason for hiding this comment

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

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.

3 participants