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

Hi,

I want to add a many2many fields in my invoice but when i use _prepare_invoice method i got an empty fields and no records in x_fleet_vehicle_invoice_rel table! so hope someone can help me with this...


class SaleOrderInherited(models.Model):
    _inherit = 'sale.order'

    order_field = fields.Many2many('fleet.vehicle', 'x_fleet_vehicle_sale_order_rel', 'order_id', 'vehicle_id', string='Order Field ')

    @api.multi
    def _prepare_invoice(self):
        res = super(SaleOrder, self)._prepare_invoice()
        res['invoice_field'] = self.order_field
        return res


class AccountInvoiceInherited(models.Model):
    _inherit = 'account.invoice'

    invoice_field = fields.Many2many('fleet.vehicle', 'x_fleet_vehicle_invoice_rel', 'invoice_id', 'vehicle_id', string='Invoice Field')
아바타
취소
관련 게시물 답글 화면 활동
1
8월 21
2323
0
5월 15
9353
0
4월 15
4473
0
3월 15
5602
2
1월 16
9761