Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- class Amendment(metaclass=PoolMeta):
- __name__ = 'sale.amendment'
- customer = fields.Function(fields.Many2One('party.party', 'Customer',
- select=True), 'on_change_with_customer', searcher='search_customer')
- @fields.depends('sale')
- def on_change_with_customer(self, name=None):
- if self.sale:
- return self.sale.party.id
- @classmethod
- def search_customer(cls, name, clause):
- return [('sale.party',) + tuple(clause[1:])]
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement