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

Hello,


I've created a custom invoice (custom because we don't want the fields to show up on the regular invoice)  for a project. When extending the existing views, everything works as expected, but when creating new views and inheriting the existing ones, I get the following view as a create form: https://i.imgur.com/vjMhffP.png . This is the form I want: https://imgur.com/e2YGDyy.png 


I'm sure I'm probably missing something very simple but I've been stuck on this for longer than I want to be and I just want to get this working. I have looked through the forums and tried various things to solve this without success so far.


This is the code I currently have:  



<record id="invoice_form_coaching" model="ir.ui.view">

    <field name="name">account.invoice.form.coaching</field>

    <field name="model">account.invoice.coaching</field>

    <field name="inherit_id" ref="account.invoice_form" />

    <field name="arch" type="xml">

       <xpath expr="//field[@name='invoice_line_ids']/tree/field[@name='quantity']" position="after">

           <field name="sessions" />

       </xpath>

    </field>

 </record>

 <record id="invoice_act_coaching" model="ir.actions.act_window">

    <field name="name">account.invoice.form.coaching</field>

    <field name="res_model">account.invoice.coaching</field>

    <field name="view_type">form</field>

    <field name="inherit_id" ref="account.invoice_form" />

    <field name="form_view_id" ref="invoice_form_coaching" />

    <field name="arch" type="xml">

       <xpath expr="//field[@name='invoice_line_ids']/tree/field[@name='quantity']" position="after">

          <field name="sessions" />

      </xpath>

  </field>

 </record>

I hope someone can help me out. 

Many thanks in advance,

Robrecht

อวตาร
ละทิ้ง

Hello, looking the screencast you provide there is no much info about the issue that you are facing ? Is that not the form you are looking to create ? please specify the problem and what you are looking for

ผู้เขียน

No, the form I want is the default/draft invoice creation form (https://i.imgur.com/e2YGDyy.png)