Skip to Content
เมนู
คุณต้องลงทะเบียนเพื่อโต้ตอบกับคอมมูนิตี้
คำถามนี้ถูกตั้งค่าสถานะ
2 ตอบกลับ
3107 มุมมอง

I would like to be able to add several fields on the report invoice.

setting up for a  garage; i d like to be able to set on the invoice :

  • the insurance company that make the request ( this would be the customer of the invoice)
  • the insurance customer : that would be the person which we act for in name of the insurance company
  • the car model/ id plate


อวตาร
ละทิ้ง
ผู้เขียน คำตอบที่ดีที่สุด

thanks for this will have a look

cheers.


อวตาร
ละทิ้ง
คำตอบที่ดีที่สุด

Hi,

Add these fields by inheriting the account.move the model and extending the account.report_invoice_document template

Refer the following code

class AccountInvoiceInherit(models.Model):
_inherit = "account.move"

insurance_customer_id = fields.Many2one('res.partner',string='Insurance Customer')
car_model = fields.Many2one('fleet.vehicle',string="Car Model")

<template id="report_invoice_document_inherit_unit" inherit_id="account.report_invoice_document">


    <xpath expr="//div[@class='page']" position="inside">


        <div t-if='o.partner_id'>


            <b>Insurance Company:</b>


            <span t-field="o.partner_id"/>


        </div>


        <div t-if='o.insurance_customer_id'>


            <b>Insurance Customer:</b>


            <span t-field="o.insurance_customer_id"/>


        </div>


        <div t-if='o.car_model'>


            <b>Car Model:</b>


            <span t-field="o.car_model"/>


        </div>


    </xpath>


</template>


Regards

อวตาร
ละทิ้ง
Related Posts ตอบกลับ มุมมอง กิจกรรม
1
ม.ค. 20
4571
0
ส.ค. 15
3133
0
เม.ย. 22
2448
5
ก.พ. 22
5971
0
ต.ค. 21
1761