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

[14.0][IMP] shopfloor_base: Propagate the shopfloor.app to actions #960

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

Conversation

mt-software-de
Copy link
Contributor

At the moment there is no property on the actions which represents the app.
Since i'm extending right now the scan everything screens, i need to know the warehouse.
Because by scanning a product i want to show the quants. But not all quants only the configured ones on the app.
The warehouse would then be reachable by self.work.app.profile_ids.menu_ids.picking_type_ids.warehouse_id

@simahawk could you maybe give some more information about this?
Why was this f6f54b0 necessary?
Would i be a problem to set the actions_collection like this actions_collection = collection or component_instance.collection

cc @jbaudoux

@OCA-git-bot
Copy link
Contributor

Hi @sebalix, @guewen, @simahawk,
some modules you are maintaining are being modified, check this out!

Copy link
Contributor

@simahawk simahawk left a comment

Choose a reason for hiding this comment

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

@mt-software-de sorry, this fell completely off my radar :)

Comment on lines +34 to +35
if component_instance.collection._name == "shopfloor.app":
kwargs["app"] = component_instance.collection
Copy link
Contributor

Choose a reason for hiding this comment

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

I would add an explicit arg app=None and then

Suggested change
if component_instance.collection._name == "shopfloor.app":
kwargs["app"] = component_instance.collection
if not app and component_instance.collection._name == "shopfloor.app":
app = component_instance.collection
kwargs["app"] = app

Then you can pass the app also from the actions class.
And we should probably add it to _propagate_kwargs.

You could also add work_context.app in the __init___ of the base service class.

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