Add process method on payment
issue8990 review260831007
This commit is contained in:
1 parent
8805d752c7
commit
ea40c61375
1 file changed
+15
+15
@@ -183,6 +183,9 @@ class Payment(Workflow, ModelSQL, ModelView):
|
||||
('company', '=', Eval('company', -1)),
|
||||
],
|
||||
depends=['state', 'company'])
|
||||
process_method = fields.Function(
|
||||
fields.Selection('get_process_methods', "Process Method"),
|
||||
'on_change_with_process_method')
|
||||
state = fields.Selection([
|
||||
('draft', 'Draft'),
|
||||
('approved', 'Approved'),
|
||||
@@ -295,6 +298,18 @@ class Payment(Workflow, ModelSQL, ModelView):
|
||||
])
|
||||
return [(None, '')] + [(m.model, m.name) for m in models]
|
||||
|
||||
@fields.depends('journal')
|
||||
def on_change_with_process_method(self, name=None):
|
||||
if self.journal:
|
||||
return self.journal.process_method
|
||||
|
||||
@classmethod
|
||||
def get_process_methods(cls):
|
||||
pool = Pool()
|
||||
Journal = pool.get('account.payment.journal')
|
||||
field_name = 'process_method'
|
||||
return Journal.fields_get([field_name])[field_name]['selection']
|
||||
|
||||
@classmethod
|
||||
def delete(cls, payments):
|
||||
for payment in payments:
|
||||
|
||||
Reference in new issue
Block a user