summaryrefslogtreecommitdiff
path: root/fixco_custom/models/sale.py
blob: 24ac70aa4e809765fe5a0eae9bcd25a0ce335b54 (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
27
28
29
30
from odoo import api, fields, models, _
from odoo.exceptions import UserError


class SaleOrder(models.Model):
    _inherit = "sale.order"

    carrier = fields.Char(string='Shipping Method')
    invoice_mp = fields.Char(string='Invoice Marketplace')
    order_reference = fields.Char(string='Order Reference') 

    # def open_form_multi_create_invoices(self):
    #     action = self.env['ir.actions.act_window']._for_xml_id('fixco_custom.action_sale_order_multi_invoices')
    #     action['context'] = {
    #         'so_ids': [x.id for x in self]
    #     }
    #     return action

    def open_form_multi_create_invoices(self):
        return {
            'name': _('Create Invoices'),
            'type': 'ir.actions.act_window',
            'res_model': 'sale.order.multi_invoices',
            'view_mode': 'form',
            'target': 'new',
            'context': {
                'so_ids': self.ids,
            }
        }