Use domain of payment_term field for the search of default in prevention of

futur inherit that will add domain
This commit is contained in:
Cédric Krier committed 2008-08-01 16:36:20 +02:00
1 parent 1e6b71548c
commit 4584b6dde2
1 file changed
+2 -2
+2 -2
View File
@@ -98,8 +98,8 @@ class Purchase(OSV):
def default_payment_term(self, cursor, user, context=None):
payment_term_obj = self.pool.get('account.invoice.payment_term')
payment_term_ids = payment_term_obj.search(cursor, user, [],
context=context)
payment_term_ids = payment_term_obj.search(cursor, user,
self.payment_term._domain, context=context)
if len(payment_term_ids) == 1:
return payment_term_obj.name_get(cursor, user, payment_term_ids,
context=context)[0]