Guest User

Untitled

a guest
Dec 20th, 2019
69
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. class Amendment(metaclass=PoolMeta):
  2.     __name__ = 'sale.amendment'
  3.  
  4.     customer = fields.Function(fields.Many2One('party.party', 'Customer',
  5.         select=True), 'on_change_with_customer', searcher='search_customer')
  6.  
  7.     @fields.depends('sale')
  8.     def on_change_with_customer(self, name=None):
  9.         if self.sale:
  10.             return self.sale.party.id
  11.  
  12.     @classmethod
  13.     def search_customer(cls, name, clause):
  14.         return [('sale.party',) + tuple(clause[1:])]
RAW Paste Data