diff options
| author | dusan <dusan@ubuntu> | 2012-12-13 14:07:00 +0100 |
|---|---|---|
| committer | dusan <dusan@ubuntu> | 2012-12-13 14:07:00 +0100 |
| commit | 7484f0aeb70f7c3b0149e4afcfba95362bca42d2 (patch) | |
| tree | 1a26f1cdb6ae17b4dcd09522ac6ad82e414963c3 /addons | |
| parent | de95ce68f7e1e7544e27f5c3be69ca76f630bb54 (diff) | |
| parent | 5d7010c6b767b8aa97dde6e9813df8b667427782 (diff) | |
[MERGE] merge with openobject/addons
bzr revid: dusan@ubuntu-20121213130700-t63ubiogwcfepa5j
Diffstat (limited to 'addons')
| -rw-r--r-- | addons/mrp_repair/mrp_repair.py | 6 | ||||
| -rw-r--r-- | addons/stock/stock.py | 10 | ||||
| -rw-r--r-- | addons/stock/wizard/stock_partial_picking_view.xml | 2 |
3 files changed, 14 insertions, 4 deletions
diff --git a/addons/mrp_repair/mrp_repair.py b/addons/mrp_repair/mrp_repair.py index 905a1b5642f..cd783509bd4 100644 --- a/addons/mrp_repair/mrp_repair.py +++ b/addons/mrp_repair/mrp_repair.py @@ -729,8 +729,9 @@ class mrp_repair_line(osv.osv, ProductChangeMixin): 'location_id': False, 'location_dest_id': False }} + location_obj = self.pool.get('stock.location') warehouse_obj = self.pool.get('stock.warehouse') - location_id = self.pool.get('stock.location').search(cr, uid, [('usage','=','production')], context=context) + location_id = location_obj.search(cr, uid, [('usage','=','production')], context=context) location_id = location_id and location_id[0] or False if type == 'add': @@ -748,11 +749,12 @@ class mrp_repair_line(osv.osv, ProductChangeMixin): 'location_id': stock_id, 'location_dest_id': location_id }} + scrap_location_ids = location_obj.search(cr, uid, [('scrap_location', '=', True)], context=context) return {'value': { 'to_invoice': False, 'location_id': location_id, - 'location_dest_id': False + 'location_dest_id': scrap_location_ids and scrap_location_ids[0] or False, }} mrp_repair_line() diff --git a/addons/stock/stock.py b/addons/stock/stock.py index 9a2ae21fa40..b12c77adfda 100644 --- a/addons/stock/stock.py +++ b/addons/stock/stock.py @@ -1398,6 +1398,14 @@ class stock_picking(osv.osv): """ if context is None: context = {} + lang_obj = self.pool.get('res.lang') + user_lang = self.pool.get('res.users').browse(cr, uid, uid, context=context).context_lang + lang_ids = lang_obj.search(cr, uid, [('code','like',user_lang)]) + if lang_ids: + date_format = lang_obj.browse(cr, uid, lang_ids[0], context=context).date_format + else: + date_format = '%m/%d/%Y' + for pick in self.browse(cr, uid, ids, context=context): msg='' if pick.auto_picking: @@ -1409,7 +1417,7 @@ class stock_picking(osv.osv): } message = type_list.get(pick.type, _('Document')) + " '" + (pick.name or '?') + "' " if pick.min_date: - msg= _(' for the ')+ datetime.strptime(pick.min_date, '%Y-%m-%d %H:%M:%S').strftime('%m/%d/%Y') + msg= _(' for the ')+ datetime.strptime(pick.min_date, '%Y-%m-%d %H:%M:%S').strftime(date_format) state_list = { 'confirmed': _('is scheduled %s.') % msg, 'assigned': _('is ready to process.'), diff --git a/addons/stock/wizard/stock_partial_picking_view.xml b/addons/stock/wizard/stock_partial_picking_view.xml index 14f7f16ac5b..4e0bf302bc6 100644 --- a/addons/stock/wizard/stock_partial_picking_view.xml +++ b/addons/stock/wizard/stock_partial_picking_view.xml @@ -23,7 +23,7 @@ <field name="quantity" /> <field name="product_uom" groups="product.group_uom"/> <field name="tracking" invisible="1"/> - <field name="prodlot_id" context="{'default_product_id':product_id}" domain="[('product_id', '=', product_id)]" invisible="context.get('hide_tracking',False)" attrs="{'required':[('tracking','=',True)]}" groups="stock.group_production_lot"/> + <field name="prodlot_id" domain="[('product_id', '=', product_id)]" invisible="context.get('hide_tracking',False)" attrs="{'required':[('tracking','=',True), ('quantity', '!=', 0)]}" groups="stock.group_production_lot" context="{'default_product_id':product_id}"/> <!-- Removed as this feature is not logic: price must be updated upon reception of invoice --> <field name="update_cost" invisible="1"/> <field name="cost" invisible="1"/> |
