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

[REF] mrp: state refactoring #28034

wants to merge 5 commits into
base: master


None yet
5 participants

amoyaux commented Oct 22, 2018

The purpose of this PR is to allow more flexibility on Manufacturing.
It will allows:

  • Pull and Push rules are no more directly trigger. It will require a confirmation from the user in order to launch them. (except when it comes from another rule)
  • The user will be able to add extra components. Those components will follow the classic flow (trigger rules, will be present in workorders and produce wizard, ...)
  • State will be computed and will not require explicit write
  • Advanced filter

I confirm I have signed the CLA and read the PR guidelines at

@amoyaux amoyaux changed the title from Master mrp arm to [REF] mrp: state refactoring Oct 22, 2018

('waiting', 'Waiting Another Operation')],
string='Material availability',
compute='_compute_state', copy=False, index=True, readonly=True,
store=True, track_visibility='onchange',

This comment has been minimized.


mreficent Oct 22, 2018


@C3POdoo C3POdoo added the RD label Oct 23, 2018

@robodoo robodoo added CI 🤖 and removed CI 🤖 labels Oct 23, 2018

""" returns 'assigned' if enough components are reserved in order to complete
the first operation in the routing. If not returns 'waiting'
first_operation = self.routing_id.operation_ids[0]

This comment has been minimized.


Whenrow Oct 30, 2018


Sure it will always be the first ? why not use the sequence?

@@ -517,7 +577,7 @@ def button_plan(self):
quantity = order.product_uom_id._compute_quantity(order.product_qty, order.bom_id.product_uom_id) / order.bom_id.product_qty
boms, lines = order.bom_id.explode(order.product_id, quantity, picking_type=order.bom_id.picking_type_id)
return orders_to_plan.write({'state': 'planned'})
return True

This comment has been minimized.


Whenrow Oct 30, 2018


Are you sure the state will be recomputed ?

<button name="button_mark_done" attrs="{'invisible': ['|', ('check_to_done', '=', False), ('consumed_less_than_planned', '=', True)]}" string="Mark as Done" type="object" class="oe_highlight"/>
<button name="button_mark_done" attrs="{'invisible': ['|', ('check_to_done', '=', False), ('consumed_less_than_planned', '=', False)]}" string="Mark as Done" type="object" class="oe_highlight" confirm="You have consumed less material than what was planned. Are you sure you want to close this MO?"/>
<button name="action_assign" attrs="{'invisible': ['|', ('availability', 'in', ('assigned', 'none')), ('is_locked', '=', False)]}" string="Check availability" type="object" class="oe_highlight"/>
<button name="button_mark_done" attrs="{'invisible': ['|', ('state', '!=', 'to_close'), ('consumed_less_than_planned', '=', True)]}" string="Mark as Done" type="object" class="oe_highlight"/>

This comment has been minimized.


Whenrow Oct 30, 2018


what if state = cancel ?

@robodoo robodoo added CI 🤖 and removed CI 🤖 labels Nov 6, 2018

@robodoo robodoo added CI 🤖 and removed CI 🤖 labels Nov 14, 2018

amoyaux added some commits Oct 22, 2018

[REF] mrp: compute state for production
Refactor production order state:
- Directly have an idea of linked workorders's state
- Computed in order to manage it in a single method
- Add tooltips for each state

Remove the None in availability selection field instead use a False

Also refactor the ready_to_produce field in order to only set as
assigned a production order that have the component for its first
[IMP] mrp: add a 'draft' state to MO
The purpose is to be able to plan manufacturing order
without propagate the components's documents directly.
Except when the manufacturing comes from a pull rule, it will
be confirmed directly.

In order to do it, it will just create the moves without confirm them.
They will be only confirmed after a 'Mark as Todo' click.

@robodoo robodoo added the CI 🤖 label Nov 16, 2018

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment