I cann't mark a workorder as done,
When i click button "MARK AS DONE", A dialog show " Odoo Server Error - You can not change the finished work order."
But my workorer is in 'progress' state.
the button call do_finish() function
def do_finish(self):
self.record_production()
action = self.env.ref('mrp_workorder.mrp_workorder_action_tablet').read()[0]
action['domain'] = [('state', 'not in', ['done', 'cancel', 'pending']), ('workcenter_id', '=', self.workcenter_id.id)]
return action
and the action is:
<record model="ir.actions.act_window" id="mrp_workorder_action_tablet">
<field name="name">Work Orders</field>
<field name="type">ir.actions.act_window</field>
<field name="res_model">mrp.workorder</field>
<field name="view_type">form</field>
<field name="view_mode">kanban,tree,form</field>
<field name="view_ids" eval="[(5, 0, 0),
(0, 0, {'view_mode': 'kanban', 'view_id': ref('mrp.workcenter_line_kanban')}),
(0, 0, {'view_mode': 'tree', 'view_id': ref('mrp.mrp_production_workorder_tree_view_inherit')}),
(0, 0, {'view_mode': 'form', 'view_id': ref('mrp_workorder_view_form_tablet')})]"/>
<field name="target">fullscreen</field>
<field name="domain">[('state', 'not in', ['done', 'cancel']), ('workcenter_id','=',active_id)]</field>
<field name="context">{'form_view_initial_mode': 'edit', 'no_breadcrumbs': True}</field>
<field name="help" type="html">
<p class="o_view_nocontent_smiling_face">
Start a new work order
</p><p>
Plan some work orders from your manufacturing orders.
</p>
</field>
</record>