콘텐츠로 건너뛰기
메뉴
커뮤니티에 참여하려면 회원 가입을 하시기 바랍니다.
신고된 질문입니다
3 답글
8552 화면

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
24966
2
7월 22
4140
1
9월 21
3773
2
9월 21
9427
1
9월 21
2999