Bỏ qua để đến Nội dung
Menu
Câu hỏi này đã bị gắn cờ
3 Trả lời
8549 Lượt xem

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

Ảnh đại diện
Huỷ bỏ
Tác giả

Thnx

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

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

Câu trả lời hay nhất

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

Ảnh đại diện
Huỷ bỏ
Tác giả

Thank you

Bài viết liên quan Trả lời Lượt xem Hoạt động
1
thg 6 25
24962
2
thg 7 22
4140
1
thg 9 21
3773
2
thg 9 21
9425
1
thg 9 21
2999