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

_logger = logging.getLogger(__name__)


class PurchasingJobMultiUpdate(models.TransientModel):
    _name = 'purchasing.job.multi.update'

    def save_multi_update_purchasing_job(self):
        product_ids = self._context['product_ids']
        product = self.env['v.purchasing.job'].browse(product_ids)
        product.generate_request_po()
        return {
            'type': 'ir.actions.client',
            'tag': 'display_notification',
            'params': {
                'title': 'Notification',
                'message': 'Berhasil membuat Automatic Purchase',
                'next': {'type': 'ir.actions.act_window_close'},
            }
        }