summaryrefslogtreecommitdiff
path: root/indoteknik_custom/models/account_move_multi_update.py
blob: 4b650868aa3af5e172ce6eeeff4645c7d8f4f8bc (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
from odoo import models, fields
import logging

_logger = logging.getLogger(__name__)


class AccountMoveMultiUpdate(models.TransientModel):
    _name = 'account.move.multi_update'

    payment_schedule = fields.Date(string="Jadwal Pembayaran")
    
    def save_multi_update(self):
        move_ids = self._context['move_ids']
        moves = self.env['account.move'].browse(move_ids)
        moves.update({
            'payment_schedule': self.payment_schedule
        })
        return {
            'type': 'ir.actions.client',
            'tag': 'display_notification',
            'params': {
                'title': 'Notification',
                'message': 'Account Move berhasil diubah',
                'next': {'type': 'ir.actions.act_window_close'},
            }
        }