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

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
أغسطس 21
2189
0
مايو 15
9151
0
أبريل 15
4352
0
مارس 15
5397
2
يناير 16
9571