Skip to content
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.

  • Loading branch information...
nim-odoo committed Mar 26, 2019
1 parent 11b1e12 commit 422764b6baebe5919bdfc8d6ce6c75032696c8cc
@@ -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 expr="//button[@name='cancel_button']" position="replace">
<button string="Discard" name="action_cancel" type="object" class="btn-primary"/>

0 comments on commit 422764b

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