Skip to Content
Menu
This question has been flagged
3 Replies
7974 Views

Hi,

I have a button that update the phase of a payment, i want to create journal entries when i click this button

is this possible?  if so, how?

here's my button code.

class AccountPaymentsPhaseWizard(models.TransientModel):
_name = 'account.payments.phase.wizard'

phase = fields.Many2one('account.journal', string='Phase')
@api.multi
def update_payments_phase(self):
payments = self.env['account.payment'].browse(self.env.context.get('active_ids', []))
for payment in payments:
payment.phase = self.phase

Thanks

Avatar
Discard
Author

Thnx

self.env['account.move'].create(

{'field_1':a, 'field_2':2})

Best Answer

same function u can use the create method to create the entries in journal
like self.env['account.move'].create({vals})
also take care how many times the button pressed and its functional flow

Avatar
Discard
Author

Thank you

Related Posts Replies Views Activity
1
Feb 25
23581
2
Jul 22
3616
1
Sep 21
3128
2
Sep 21
8659
1
Sep 21
2605