Skip to Content
Menu
This question has been flagged
5 Replies
6110 Views

Sorry if there is a simple answer to this but i have looked and can not find what i am looking for,
im using odoo 13

I have inherited the sales module and added fields i require adding, the new module i created is under a new name and i can select it from the menu in this name.

But all the new fields i have created are also pressent and shown on the sales module which i do not want.

What my aim was is to inherite the sales module, add fileds to the inherited module and leave the sales module as it was.

What am i doing wrong please?

<py>

# -*- coding: utf-8 -*-

from odoo import models, fields

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

</py>


<xml>

<?xml version="1.0" encoding="utf-8"?>

<odoo>

<!-- inherit the view from sale order -->
<record id="saleOrderInherit" model="ir.ui.view">
<field name="name">sale.order.inherit</field>
<field name="model">sale.order</field>
<field name="inherit_id" ref="sale.view_order_form"/>

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

</xml>

Avatar
Discard
Best Answer

Anyone found a solution yet. I had the same i.e. when adding the lines:

<field name="mode">primary</field> and   <field name="priority" eval="20"/> 

in all combinations it either displays the additional fields in all views (including the custom one) or in neither of them


Avatar
Discard
Best Answer

Hi,

Try this,

<record id="saleOrderInherit" model="ir.ui.view">
<field name="name">sale.order.inherit</field>
<field name="model">sale.order</field>
<field name="mode">primary</field>
  <field name="priority" eval="20"/>


<field name="inherit_id" ref="sale.view_order_form"/>
<field name="arch" type="xml">
</field>
</record>

Thanks

Avatar
Discard
Author Best Answer

Thank you.

I added 

<field name="mode">primary</field>
But i loose all the new fields created in sales and also the new module that inherits sale.order

Anything else i can try please.

Thank you.

Update when i removed this line i still could not see the added fields i had to delete the database in restore i then had the fields back that was created.

Avatar
Discard

Add this line too: <field name="priority" eval="20"/>

Author

Thank you for your time to look at this for me.. Still the same looses fields on both with line added

Related Posts Replies Views Activity
0
Nov 24
4353
1
Aug 15
8678
2
Jun 20
3766
1
Jun 16
2463
1
Jun 15
1182