summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRajesh Prajapati (OpenERP) <rpr@tinyerp.com>2012-07-24 16:54:57 +0530
committerRajesh Prajapati (OpenERP) <rpr@tinyerp.com>2012-07-24 16:54:57 +0530
commit3f234902002394311cd27ebf0bc4e3a200cccf5d (patch)
treeecf716e7c4d0523ee5d0ba12e149fa1e7a73a338
parent61f361bfee1ae021aedef0ebbf3c91d15083cf1a (diff)
[IMP] default value added in mrp_production : default added to location_src_id and location_dest_id
bzr revid: rpr@tinyerp.com-20120724112457-euf51mv6h9g8ko3o
-rw-r--r--addons/mrp/mrp.py10
1 files changed, 10 insertions, 0 deletions
diff --git a/addons/mrp/mrp.py b/addons/mrp/mrp.py
index 56ac47095a1..07c8e022e8e 100644
--- a/addons/mrp/mrp.py
+++ b/addons/mrp/mrp.py
@@ -448,6 +448,14 @@ class mrp_production(osv.osv):
result[prod.id] = prod.date_planned[:10]
return result
+ def _src_id_default(self, cr, uid, ids, context=None):
+ src_location_id = self.pool.get('ir.model.data').get_object(cr, uid, 'stock', 'stock_location_stock', context=context)
+ return src_location_id.id
+
+ def _dest_id_default(self, cr, uid, ids, context=None):
+ dest_location_id = self.pool.get('ir.model.data').get_object(cr, uid, 'stock', 'stock_location_stock', context=context)
+ return dest_location_id.id
+
_columns = {
'name': fields.char('Reference', size=64, required=True),
'origin': fields.char('Source Document', size=64, help="Reference of the document that generated this production order request."),
@@ -496,6 +504,8 @@ class mrp_production(osv.osv):
'product_qty': lambda *a: 1.0,
'name': lambda x, y, z, c: x.pool.get('ir.sequence').get(y, z, 'mrp.production') or '/',
'company_id': lambda self, cr, uid, c: self.pool.get('res.company')._company_default_get(cr, uid, 'mrp.production', context=c),
+ 'location_src_id': _src_id_default,
+ 'location_dest_id': _dest_id_default
}
_sql_constraints = [
('name_uniq', 'unique(name, company_id)', 'Reference must be unique per Company!'),