Ir al contenido
Menú
Se marcó esta pregunta
3 Respuestas
8244 Vistas

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
Descartar
Autor

Thnx

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

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

Mejor respuesta

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
Descartar
Autor

Thank you

Publicaciones relacionadas Respuestas Vistas Actividad
1
jun 25
24104
2
jul 22
3840
1
sept 21
3417
2
sept 21
8964
1
sept 21
2767