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

[12.0][FIX] stock: company_id of stock rule should be the same as the warehouse #2456

Closed
wants to merge 1 commit into from

Conversation

MiquelRForgeFlow
Copy link
Contributor

This is not literally an "issue" in v12, but it's good to have data correctness.

--
I confirm I have signed the CLA and read the PR guidelines at www.odoo.com/submit-pr

@pedrobaeza
Copy link
Member

In which cases this is not happening? Is due to bad manual configuration or migrated DB or migrated DB with current script-set?

@pedrobaeza
Copy link
Member

Anyway, please change it only when it's different (and take care about the comparison with NULL).

@MiquelRForgeFlow
Copy link
Contributor Author

In which cases this is not happening? Is due to bad manual configuration or migrated DB or migrated DB with current script-set?

I just found migrating a DB, and found check in v13. I think the problem is due to company_id having the default=lambda self: self.env.user.company_id. Thus, if rules are created with sudo or during migration, then they will have the company of the admin.

@MiquelRForgeFlow
Copy link
Contributor Author

and take care about the comparison with NULL

Is not enough adding "AND sw.company_id != sr.company_id"?

@pedrobaeza
Copy link
Member

It seems not all comparisons with possible values are working well with NULL.

@MiquelRForgeFlow
Copy link
Contributor Author

Closing in favor of #2456 due to wrong remote.

@MiquelRForgeFlow MiquelRForgeFlow deleted the 12.0-fix-stock-rule-company branch November 30, 2020 19:18
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.

None yet

2 participants