[REF] stock: visibility of the scrap button/moves

* do not display the scrap button in receipt (we don't want to allow
products not coming from your stock)
* no scrap button when any picking is done
* don't display the scrap moves, the user needs to go to the stat button

Task ID 1913275

closes odoo/odoo#29097
This commit is contained in:
Nimesh Jethva
2018-12-03 13:09:36 +00:00
committed by Simon Lejeune
parent a4cbfbec4e
commit 6afa3578e1
2 changed files with 2 additions and 2 deletions
+1 -1
View File
@@ -640,7 +640,7 @@ class Picking(models.Model):
move_ids_without_package |= move
else:
move_ids_without_package |= move
picking.move_ids_without_package = move_ids_without_package
picking.move_ids_without_package = move_ids_without_package.filtered(lambda ml: ml.scrapped == False)
def _set_move_without_package(self):
self.move_lines |= self.move_ids_without_package
+1 -1
View File
@@ -224,7 +224,7 @@
<field name="show_operations" invisible="1" readonly="1"/>
<field name="move_line_exist" invisible="1"/>
<field name="has_packages" invisible="1"/>
<button name="button_scrap" type="object" string="Scrap" attrs="{'invisible': ['|', '|', '&amp;', ('picking_type_code', '!=', 'incoming'), ('state', 'in', ('draft', 'cancel', 'waiting')), '&amp;', ('picking_type_code', '=', 'incoming'), ('state', '!=', 'done'), ('is_locked', '=', False)]}"/>
<button name="button_scrap" type="object" string="Scrap" attrs="{'invisible': ['|', '|', ('picking_type_code', '=', 'incoming'), ('state', 'in', ('draft', 'cancel', 'waiting', 'done')), ('is_locked', '=', False)]}"/>
<button name="action_toggle_is_locked" attrs="{'invisible': ['|', ('state', 'in', ('draft','cancel')), ('is_locked', '=', False)]}" string="Unlock" groups="stock.group_stock_manager" type="object" help="If the picking is unlocked you can edit initial demand (for a draft picking) or done quantities (for a done picking)."/>
<button name="action_toggle_is_locked" attrs="{'invisible': [('is_locked', '=', True)]}" string="Lock" class="oe_highlight" groups="stock.group_stock_manager" type="object"/>
<field name="state" widget="statusbar" statusbar_visible="draft,confirmed,partially_available,assigned,done" />