Zum Inhalt springen
Menü
Sie müssen registriert sein, um mit der Community zu interagieren.
Diese Frage wurde gekennzeichnet

I have two different views on the same model purchase.order.shipment


view 1:
 <notebook><pagestring="Products"><fieldname="shipment_lines"attrs="{'readonly': [('state', '!=', 'draft')]}"widget="section_and_note_one2many"mode="tree">
<treecreate="false"string="Shipment Order Lines"editable="bottom"><fieldname="shipment_id"invisible="1"/><fieldname="product_id"readonly='1'force_save="1"/><fieldname="product_uom"invisible='1'force_save="1"/><fieldname="product_qty"readonly='1'force_save="1"/><fieldname="qty_received"readonly='1'force_save="1"/><fieldname="remaining_qty"readonly='1'force_save="1"/>
<fieldname="shipment_qty_received"required='1'force_save="1"/>
tree>field>page>notebook>

view 2: <pagestring="Assesment"name="assesment"><fieldname="shipment_lines"><treename="assesment"create="false"editable="bottom"><fieldname="shipment_id"invisible="1"/><fieldname="product_id"readonly='1'/><fieldname="hs_code"readonly='1'/><fieldname="shipment_qty_pieces"readonly='1'/><fieldname="product_qty"invisible="1"/><fieldname="price_unit"invisible="1"/><fieldname="net_weight"readonly='1'/><fieldname="price_subtotal"readonly='1'/><fieldname="mav"/><fieldname="assessable_value_bdt"/><fieldname="cd"/><fieldname="rd"/><fieldname="sd"/><fieldname="vat"/><fieldname="ait"/><fieldname="at"/><fieldname="psi"/><fieldname="total_duty_tax"/>tree>field>page>
but view 2 is overlaping view 1



For view 1 i was expecting this view:


Avatar
Verwerfen
Beste Antwort

Hi, 

Here the issue is that in some cases we couldn't add multiple tree views for the same one2many field, When we add like that it will always overlap the first view. So try to add another one2many field with the same functionalities as the field 'shipment_lines' and add that one2many field to the second view.

Python:// Add the new one2many field

shipment_lines = fields.One2many( ) //Existing field
new_shipment_lines_ids = fields.One2many( ) // New field with same functionalioties of field 'shipment_lines'

XML View:

View 1

<record id="action_task_generation" model="ir.cron">
    <field name="name">Auto Task Generation</field>
    <field name="model_id" ref="model_crm_lead"/>
    <field name="state">code</field>
    <field name="code">model.action_generate_task()</field>
    <field name="interval_number">1</field>
    <field name="interval_type">days</field>
    <field name="numbercall">-1</field>
    <field name="active" eval="True"/>
    <field name="doall" eval="True"/>
</record>


View 2:

<pagestring="Assesment"name="assesment">

<fieldname="new_shipment_lines_ids">

<treename="assesment"create="false"editable="bottom">

<fieldname="shipment_id"invisible="1"/>

<fieldname="product_id"readonly='1'/>

<fieldname="hs_code"readonly='1'/>

<fieldname="shipment_qty_pieces"readonly='1'/>

<fieldname="product_qty"invisible="1"/>

<fieldname="price_unit"invisible="1"/>

<fieldname="net_weight"readonly='1'/>

<fieldname="price_subtotal"readonly='1'/>

<fieldname="mav"/>

<fieldname="assessable_value_bdt"/>

<fieldname="cd"/><fieldname="rd"/>

<fieldname="sd"/><fieldname="vat"/>

<fieldname="ait"/><fieldname="at"/>

<fieldname="psi"/><fieldname="total_duty_tax"/>tree>field>page>


Hope it helps

Avatar
Verwerfen
Verknüpfte Beiträge Antworten Ansichten Aktivität
1
Juli 25
1970
2
Juli 23
1891
2
Sept. 23
5850
0
März 23
2238
0
Apr. 22
3754