diff --git a/__tryton__.py b/__tryton__.py
index e3ddb78e3f..2615c8db0c 100644
--- a/__tryton__.py
+++ b/__tryton__.py
@@ -7,7 +7,11 @@
'category': 'Generic Modules',
'description': 'Stock Management and Inventory Control',
'depends': [
- 'partner', 'product'
+ 'ir',
+ 'workflow',
+ 'partner',
+ 'product',
+ 'company',
],
'xml': [
'product.xml',
diff --git a/move.py b/move.py
index 4a7b02a78c..bfb5568233 100644
--- a/move.py
+++ b/move.py
@@ -39,6 +39,10 @@ class Move(OSV):
('waiting', 'Waiting'),
('assigned', 'Assigned'),
], 'State', select=1, readonly=True)
+ company = fields.Many2One('company.company', 'Company', required=True,
+ states={
+ 'readonly': "state != 'draft'",
+ })
def __init__(self):
super(Move, self).__init__()
@@ -103,6 +107,15 @@ class Move(OSV):
return 'done'
return 'draft'
+ def default_company(self, cursor, user, context=None):
+ company_obj = self.pool.get('company.company')
+ if context is None:
+ context = {}
+ if context.get('company'):
+ return company_obj.name_get(cursor, user, context['company'],
+ context=context)[0]
+ return False
+
def on_change_product(self, cursor, user, ids, value, context=None):
if 'product' in value and value['product']:
product = self.pool.get('product.product').browse(
diff --git a/move.xml b/move.xml
index a643a4dd06..a9ffc78237 100644
--- a/move.xml
+++ b/move.xml
@@ -22,6 +22,9 @@
+
+
+
@@ -134,8 +137,7 @@
Moves to customers
stock.move
form
-
- [('to_location.type', '=', 'customer')]
+ [('to_location.type', '=', 'customer')]
@@ -151,5 +153,16 @@
+
+
+
+
+
+
+
+ =
+ User/Current Company
+
+