I get a possible solution making qty_done field as editable with a custom module. It seems to work properly, updating stock quantity without changing consumed materials. But still having an issue, i get two stock move lines, the orignal one with planned quantity of finished goods and other with increased quantity. Is there any way to avoid this constraints?, it makes really poor user friendly reports to final user.
[SOLVED]
After a little research i found a solution that works, i have'nt tested in production stage but i could'nt find errors on tests. If you use the solution and find some issues, please, post it here.
I made a custom module that overrides write and _compute_consumed_less_than_planed to be able to save products produced independent of raw materials.
1. Set qty_done editable
<?xml version="1.0" encoding="utf-8"?>
<odoo>
<record id="mrp_production" model="ir.ui.view">
<field name="name">mrp.production.form</field>
<field name="model">mrp.production</field>
<field name="inherit_id" ref="mrp.mrp_production_form_view"/>
<field name="view_type">form</field>
<field name="arch" type="xml">
<xpath expr="//field[@name='finished_move_line_ids']" position="attributes">
<attribute name="attrs">{'readonly': False}</attribute>
</xpath>
</field>
</record>
</odoo>
2. Override mrp_production methods
class mrp_production(models.Model):
_inherit = 'mrp.production'
# Override write method to set equal quantity of product
# on stock_move and stock_move_line relation
@api.multi
def write (self, vals):
if "finished_move_line_ids" in vals.keys():
id_move = self["move_finished_ids"]["id"]
qty = vals["finished_move_line_ids"][0][2]["qty_done"]
dominio = [('id', '=', id_move)]
move = self.env["stock.move"].search(dominio)
move.write({'ordered_qty': qty, 'product_uom_qty': qty})
res = super(mrp_production, self).write(vals)
return res
#Avoid warning on consumed less than planned after increase product quantity
@api.multi
@api.depends('move_raw_ids.quantity_done', 'move_raw_ids.product_uom_qty')
def _compute_consumed_less_than_planned(self):
for order in self:
order.consumed_less_than_planned = False