This commit is contained in:
Bertrand Chenal committed 2008-05-06 11:25:46 +02:00
commit 9c63ede797
4 files changed
+57 -7

No files matched your search

+21 -1
View File
@@ -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()
+22
View File
@@ -160,6 +160,28 @@
<field name="output_location" ref="location_output"/>
<field name="storage_location" ref="location_storage"/>
</record>
<record model="stock.location" id="location_supplier">
<field name="name">Supplier</field>
<field name="code">SUP</field>
<field name="type">supplier</field>
</record>
<record model="stock.location" id="location_customer">
<field name="name">Customer</field>
<field name="code">CUS</field>
<field name="type">customer</field>
</record>
<record model="ir.property" id="property_supplier_location">
<field name="name">supplier_location</field>
<field name="field"
search="[('model.model', '=', 'partner.partner'), ('name', '=', 'supplier_location')]"/>
<field name="value" eval="'stock.location,' + str(ref('location_supplier'))"/>
</record>
<record model="ir.property" id="property_customer_location">
<field name="name">customer_location</field>
<field name="field"
search="[('model.model', '=', 'partner.partner'), ('name', '=', 'customer_location')]"/>
<field name="value" eval="'stock.location,' + str(ref('location_customer'))"/>
</record>
</data>
</tryton>
+13 -6
View File
@@ -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')
+1
View File
@@ -7,6 +7,7 @@ STATES = {
'readonly': "state in ('cancel', 'done')",
}
class PackingIn(OSV):
"Supplier Packing"
_name = 'stock.packing.in'