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] shopinvader_schema_sale: allow to hide some line in the schema (like delivery...) #1564

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

Conversation

sebastienbeau
Copy link
Contributor

@sebastienbeau sebastienbeau commented Aug 1, 2024

Add hook to be able to hide "technical" product in the api

See use case here: shopinvader/odoo-shopinvader-carrier#11

@sebastienbeau
Copy link
Contributor Author

@paradoxxxzero can you check why the test are failing ?

@sebastienbeau sebastienbeau added this to the 16.0 milestone Sep 19, 2024
@paradoxxxzero paradoxxxzero force-pushed the 16.0-add-visible-in-api branch from 1ca2b66 to eeb5766 Compare October 16, 2024 08:29
@sbidoul
Copy link
Member

sbidoul commented Oct 23, 2024

Is it ok for a schema module to have a model?

@paradoxxxzero paradoxxxzero force-pushed the 16.0-add-visible-in-api branch from eeb5766 to 74268a5 Compare December 2, 2024 12:24
@sebastienbeau
Copy link
Contributor Author

@sbidoul maybe we should move the logic in sale_cart ?

but before let's see my comment here : shopinvader/odoo-shopinvader-carrier#11 (comment)

@simahawk
Copy link
Contributor

simahawk commented Dec 6, 2024

Is it ok for a schema module to have a model?

If it is functional to the schema IMO it makes sense.

)

def _is_visible_in_shopinvader_api(self):
self.ensure_one()
Copy link
Contributor

@simahawk simahawk Dec 6, 2024

Choose a reason for hiding this comment

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

Using ensure_one on internal methods meant to be used in loops is useless IMO if not counter productive: you'll check N times something that you know.

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.

4 participants