You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
@api.onchange('product_ids')
def onchange_product_ids(self):
product_ids = self.product_ids
mayor = 0
if product_ids:
for line in self.product_ids:
if line.cost_compra_fob > mayor:
print line.cost_compra_fob
mayor = line.cost_compra_fob
self.cost_compra_fob = mayor
GetName
@api.multi
def name_get(self):
res = super(ProcesoAdministracion, self).name_get()
result = []
for element in res:
product_id = element[0]
code = self.name
if self.property_id:
rol = self.property_id.street
else:
rol = '-'
name = code and '[%s] %s' % (code, rol) or '%s' % rol
result.append((product_id, name))
return result
class ListDiscounts(models.Model):
_name = 'list.discounts'
_description = 'Lista de Descuentos'
_rec_name = 'product_id'
@api.model
def name_search(self, name='', args=None, operator='ilike', limit=100):
records = self.search((args or []) + [('desc', operator, name)])
if records:
return records.name_get()
return super(HrHaberesydesc, self).name_search(name, args, operator, limit)
Ejecutar Boton
@api.multi
def exe_stock(self):
self.state = 'stock_disponible'
<button name="exe_next" string="Próximo" class="oe_highlight" type="object"
confirm="¿Estás seguro de adelantar el paso?"/>