跳至内容
菜单
此问题已终结
3 回复
8445 查看

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

形象
丢弃
编写者

Thnx

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

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

最佳答案

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

形象
丢弃
编写者

Thank you

相关帖文 回复 查看 活动
1
6月 25
24704
2
7月 22
4037
1
9月 21
3656
2
9月 21
9251
1
9月 21
2909