diff --git a/location.py b/location.py
index 9b0e5484ea..7199a21bac 100644
--- a/location.py
+++ b/location.py
@@ -8,6 +8,8 @@ STATES_WH = {
'invisible': "type != 'warehouse'",
'readonly': "not active",
}
+
+
class Location(OSV):
"Stock Location"
_name = 'stock.location'
@@ -49,7 +51,7 @@ class Location(OSV):
return True
def default_type(self, cursor, user, context=None):
- return 'storage'
+ return 'storage'
def name_search(self, cursor, user, name, args=None, operator='ilike',
context=None, limit=None):
@@ -66,3 +68,21 @@ class Location(OSV):
return result
Location()
+
+
+class Partner(OSV):
+ _name = 'partner.partner'
+ supplier_location = fields.Property(type='many2one',
+ relation='stock.location', string='Supplier Location',
+ group_name='Stock Properties', view_load=True,
+ domain=[('type', '=', 'supplier')],
+ help='The default source location ' \
+ 'when receiving products from the partner.')
+ customer_location = fields.Property(type='many2one',
+ relation='stock.location', string='Customer Location',
+ group_name='Stock Properties', view_load=True,
+ domain=[('type', '=', 'customer')],
+ help='The default destination location ' \
+ 'when sending products to the partner.')
+
+Partner()
diff --git a/location.xml b/location.xml
index 602fa52120..85fc6838bf 100644
--- a/location.xml
+++ b/location.xml
@@ -160,6 +160,28 @@
+
+ Supplier
+ SUP
+ supplier
+
+
+ Customer
+ CUS
+ customer
+
+
+ supplier_location
+
+
+
+
+ customer_location
+
+
+
diff --git a/move.py b/move.py
index f9d54c1b97..883be56459 100644
--- a/move.py
+++ b/move.py
@@ -7,6 +7,7 @@ STATES = {
'readonly': "(state in ('cancel', 'done'))",
}
+
class Move(OSV):
"Stock Move"
_name = 'stock.move'
@@ -37,10 +38,13 @@ class Move(OSV):
select=1)
planned_date = fields.Date("Planned Date", states=STATES,)
effective_date = fields.Date("Effective Date", readonly=True)
- state = fields.Selection(
- [('draft', 'Draft'), ('done', 'Done'), ('cancel', 'Cancel'),
- ('waiting', 'Waiting'), ('assigned', 'Assigned')], 'State', select=1, readonly=True)
-
+ state = fields.Selection([
+ ('draft', 'Draft'),
+ ('done', 'Done'),
+ ('cancel', 'Cancel'),
+ ('waiting', 'Waiting'),
+ ('assigned', 'Assigned'),
+ ], 'State', select=1, readonly=True)
def __init__(self):
super(Move, self).__init__()
@@ -191,8 +195,10 @@ Move()
class CreatePackingWarn(WizardOSV):
_name = 'stock.move.create_packing.warn'
+
CreatePackingWarn()
+
class CreatePacking(Wizard):
'Create Packing'
_name = 'stock.move.create_packing'
@@ -202,10 +208,11 @@ class CreatePacking(Wizard):
'type': 'action',
'action': '_create',
'state': 'end',
- },
},
+ },
+
+ }
- }
def _create(self, cursor, user, data, context=None):
move_obj = self.pool.get('stock.move')
diff --git a/packing.py b/packing.py
index 5c4d277f1c..42110172a5 100644
--- a/packing.py
+++ b/packing.py
@@ -7,6 +7,7 @@ STATES = {
'readonly': "state in ('cancel', 'done')",
}
+
class PackingIn(OSV):
"Supplier Packing"
_name = 'stock.packing.in'