mirror of
https://gitlab.com/datalifeit/trytond-stock_party_warehouse
synced 2023-12-14 06:32:52 +01:00
Added order and fields depends methods.
This commit is contained in:
parent
088b0437ec
commit
0dd4f484da
2 changed files with 9 additions and 2 deletions
5
party.py
5
party.py
|
@ -61,6 +61,11 @@ class PartyWarehouse(ModelSQL, ModelView, ValueMixin):
|
|||
warehouse = fields.Many2One('stock.location', "Warehouse",
|
||||
domain=[('type', '=', 'warehouse')], ondelete='RESTRICT')
|
||||
|
||||
@classmethod
|
||||
def __setup__(cls):
|
||||
super().__setup__()
|
||||
cls._order.insert(0, ('party', 'ASC'))
|
||||
|
||||
@classmethod
|
||||
def __register__(cls, module_name):
|
||||
pool = Pool()
|
||||
|
|
|
@ -23,7 +23,8 @@ class ShipmentInternal(PartyWarehouseMixin, metaclass=PoolMeta):
|
|||
},
|
||||
depends=['state', 'moves', 'from_location', 'to_location'])
|
||||
|
||||
@fields.depends('party', 'from_location', 'to_location')
|
||||
@fields.depends('party', 'from_location', 'to_location',
|
||||
methods=['_get_party_warehouse_pattern'])
|
||||
def on_change_from_location(self):
|
||||
if (self.party
|
||||
and self.from_location
|
||||
|
@ -33,7 +34,8 @@ class ShipmentInternal(PartyWarehouseMixin, metaclass=PoolMeta):
|
|||
if self.from_location.warehouse != warehouse:
|
||||
self.to_location = warehouse.storage_location
|
||||
|
||||
@fields.depends('party', 'from_location', 'to_location')
|
||||
@fields.depends('party', 'from_location', 'to_location',
|
||||
methods=['_get_party_warehouse_pattern'])
|
||||
def on_change_to_location(self):
|
||||
if (self.party
|
||||
and self.to_location
|
||||
|
|
Loading…
Reference in a new issue