Skip to content
Snippets Groups Projects
Commit f5e99060 authored by Nicolas Martinelli's avatar Nicolas Martinelli
Browse files

[FIX] stock: discard scrap


- Process a WO (e.g. 'Manual Assembly' from the demo data)
- Create a scrap for component 'Drawer Black'
- A new wizard appears:
  'The product XXX is not available in sufficient quantity'
- Click on 'Discard'

A scrap is created in draft, but it cannot be canceled.

The scrap shouldn't have been created in a first place, but this cannot
be changed in stable. Therefore, we delete it.

opw-1946254

closes odoo/odoo#32122

Signed-off-by: default avatarNicolas Martinelli (nim) <nim@odoo.com>
parent 80b900ee
No related branches found
No related tags found
No related merge requests found
......@@ -34,3 +34,7 @@ class StockWarnInsufficientQtyScrap(models.TransientModel):
def action_done(self):
return self.scrap_id.do_scrap()
def action_cancel(self):
# FIXME in master: we should not have created the scrap in a first place
return self.scrap_id.sudo().unlink()
......@@ -44,6 +44,9 @@
<xpath expr="//field[@name='product_id']" position="after">
<field name="scrap_id" invisible="1"/>
</xpath>
<xpath expr="//button[@name='cancel_button']" position="replace">
<button string="Discard" name="action_cancel" type="object" class="btn-primary"/>
</xpath>
</field>
</record>
</odoo>
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment