[FIX]scrap: wizard default qty set to zero and remove constraint introduce in revid:qdp-launchpad@openerp.com-20130319125216-pdfo2i9jx5mcea2l

+ add label/cosmetic in picking view

bzr revid: csn@openerp.com-20130904083118-1scykl2z960zmyla
This commit is contained in:
Cedric Snauwaert 2013-09-04 10:31:18 +02:00
parent e0e2f8c82f
commit a792608e87
3 changed files with 5 additions and 5 deletions

View File

@ -1554,9 +1554,10 @@ class stock_move(osv.osv):
source_location = move.location_id
if move.state == 'done':
source_location = move.location_dest_id
if source_location.usage != 'internal':
#Previously used to prevent scraping from virtual location but not necessary anymore
#if source_location.usage != 'internal':
#restrict to scrap from a virtual location because it's meaningless and it may introduce errors in stock ('creating' new products from nowhere)
raise osv.except_osv(_('Error!'), _('Forbidden operation: it is not allowed to scrap products from a virtual location.'))
#raise osv.except_osv(_('Error!'), _('Forbidden operation: it is not allowed to scrap products from a virtual location.'))
move_qty = move.product_qty
uos_qty = quantity / move_qty * move.product_uos_qty
default_val = {

View File

@ -595,7 +595,6 @@
<group>
<field name="partner_id"/>
<field name="backorder_id" readonly="1" attrs="{'invisible': [('backorder_id','=',False)]}"/>
<field name="picking_type_id"/>
</group>
<group>
<field name="date"/>
@ -618,6 +617,7 @@
<field name="result_package_id" groups="stock.group_tracking_lot"/>
</tree>
</field>
<separator string="Expected Quantities"/>
<field name="move_lines" context="{'address_in_id': partner_id, 'form_view_ref':'view_move_picking_form', 'tree_view_ref':'view_move_picking_tree', 'default_picking_type_id': picking_type_id}"/>
<field name="note" placeholder="Add an internal note..." class="oe_inline"/>
</page>
@ -625,6 +625,7 @@
<group>
<group>
<field name="move_type"/>
<field name="picking_type_id"/>
</group>
<group>
<field name="company_id" groups="base.group_multi_company" widget="selection"/>

View File

@ -109,8 +109,6 @@ class stock_move_scrap(osv.osv_memory):
res.update({'product_id': move.product_id.id})
if 'product_uom' in fields:
res.update({'product_uom': move.product_uom.id})
if 'product_qty' in fields:
res.update({'product_qty': move.product_qty})
if 'location_id' in fields:
if scrap_location_id:
res.update({'location_id': scrap_location_id[0]})