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

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>

الصورة الرمزية
إهمال
أفضل إجابة

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


الصورة الرمزية
إهمال
أفضل إجابة

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

الصورة الرمزية
إهمال
الكاتب أفضل إجابة

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.

الصورة الرمزية
إهمال

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

الكاتب

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

المنشورات ذات الصلة الردود أدوات العرض النشاط
0
نوفمبر 24
5241
1
أغسطس 15
10025
2
يونيو 20
4844
1
يونيو 16
3406
1
يونيو 15
1182