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

ADD: siren/siret fields are now displayed according to a boolean computed field #568

Open
wants to merge 2 commits into
base: 14.0
Choose a base branch
from

Conversation

damdam-s
Copy link
Member

No description provided.

@OCA-git-bot
Copy link
Contributor

Hi @alexis-via,
some modules you are maintaining are being modified, check this out!

@damdam-s damdam-s force-pushed the l10n_fr_siret_display_fields_on_partner branch 2 times, most recently from 8e1535d to 3fe34b6 Compare September 25, 2024 13:40
@damdam-s damdam-s force-pushed the l10n_fr_siret_display_fields_on_partner branch from 3fe34b6 to f467862 Compare September 25, 2024 13:48
@damdam-s damdam-s marked this pull request as ready for review September 25, 2024 14:00
@damdam-s damdam-s changed the title ADD: siren/siret fields are not displayed according to a boolean computed field ADD: siren/siret fields are now displayed according to a boolean computed field Sep 25, 2024
Comment on lines 144 to 150
countries_show_siret = self.env["res.country"].search(
[("show_siret_fields", "=", True)]
)
for record in self:
record.show_siret_fields = record.country_id in countries_show_siret and (
record.is_company or record.parent_is_company
)

Choose a reason for hiding this comment

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

instead to search all countries to display siret, could we write something like this:

Suggested change
countries_show_siret = self.env["res.country"].search(
[("show_siret_fields", "=", True)]
)
for record in self:
record.show_siret_fields = record.country_id in countries_show_siret and (
record.is_company or record.parent_is_company
)
for record in self:
record.show_siret_fields = record.country_id.show_siret_fields and (
record.is_company or record.parent_is_company
)

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.

3 participants