03.02.26
This commit is contained in:
@@ -16,6 +16,43 @@ class PartyExecution(ModelSQL,ModelView):
|
||||
def get_percent(self,name):
|
||||
return 2
|
||||
|
||||
class PartyExecutionSla(ModelSQL,ModelView):
|
||||
"Party Execution Sla"
|
||||
__name__ = 'party.execution.sla'
|
||||
|
||||
party = fields.Many2One('party.party',"Party")
|
||||
reference = fields.Char("Reference")
|
||||
product = fields.Many2One('product.product',"Product")
|
||||
date_from = fields.Date("From")
|
||||
date_to = fields.Date("To")
|
||||
places = fields.One2Many('party.execution.place','pes',"")
|
||||
|
||||
class PartyExecutionPlace(ModelSQL,ModelView):
|
||||
"Party Sla Place"
|
||||
__name__ = 'party.execution.place'
|
||||
|
||||
pes = fields.Many2One('party.execution.sla',"Sla")
|
||||
location = fields.Many2One('stock.location',"Location")
|
||||
cost = fields.Numeric("Cost",digits=(16,4))
|
||||
currency_unit = fields.Selection('get_currency_unit',string="Curr/Unit")
|
||||
|
||||
@staticmethod
|
||||
def get_currency_unit():
|
||||
Currency = Pool().get('currency.currency')
|
||||
Uom = Pool().get('product.uom')
|
||||
|
||||
result = []
|
||||
currencies = Currency.search([('concatenate','=',True)])
|
||||
units = Uom.search([('concatenate','=',True)])
|
||||
result.append(("0_5","USC/lb"))
|
||||
result.append(("0_37","USC/mt"))
|
||||
for c in currencies:
|
||||
for u in units:
|
||||
key = "%s_%s" % (c.id, u.id)
|
||||
value = "%s / %s" % (c.name, u.symbol or u.name)
|
||||
result.append((key, value))
|
||||
return result
|
||||
|
||||
class Party(metaclass=PoolMeta):
|
||||
__name__ = 'party.party'
|
||||
|
||||
@@ -24,6 +61,7 @@ class Party(metaclass=PoolMeta):
|
||||
wb = fields.Many2One('purchase.weight.basis',"Weight basis")
|
||||
association = fields.Many2One('purchase.association',"Association")
|
||||
execution = fields.One2Many('party.execution','party',"")
|
||||
sla = fields.One2Many('party.execution.sla','party', "Sla")
|
||||
|
||||
def IsAvailableForControl(self,sh):
|
||||
return True
|
||||
|
||||
Reference in New Issue
Block a user