تخطي للذهاب إلى المحتوى
القائمة
لقد تم الإبلاغ عن هذا السؤال
3 الردود
8604 أدوات العرض

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
يونيو 25
25011
2
يوليو 22
4188
1
سبتمبر 21
3813
2
سبتمبر 21
9463
1
سبتمبر 21
3030