Skip to content
Permalink
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 #32122

Signed-off-by: Nicolas Martinelli (nim) <nim@odoo.com>
  • Loading branch information...
nim-odoo committed Mar 26, 2019
1 parent 80b900e commit f5e99060b66dd62d8154c07f1110bf1c913a1424
@@ -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 comments on commit f5e9906

Please sign in to comment.
You can’t perform that action at this time.