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

[16.0][ADD] check_current_company_for_validation module #700

Open
wants to merge 1 commit into
base: 16.0
Choose a base branch
from

Conversation

Kev-Roche
Copy link
Contributor

Small mixin checkin if the current company is the same as the record company.
It's come with the check on sale.order

@Kev-Roche Kev-Roche changed the title [16.0][ADD] check_current_company_for_validation [16.0][ADD] check_current_company_for_validation module Sep 25, 2024
_description = "Check Current Company Mixin"

def check_current_company(self):
if self.env.company != self.company_id:
Copy link

Choose a reason for hiding this comment

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

This can fail if you have a recordset with different companies

Suggested change
if self.env.company != self.company_id:
if self.filtered(lambda x: x.company_id != self.env.company)

or loop through all the recordset

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

Successfully merging this pull request may close these issues.

2 participants