Bỏ qua để đến Nội dung
Menu
Câu hỏi này đã bị gắn cờ
5 Trả lời
7289 Lượt xem

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>

Ảnh đại diện
Huỷ bỏ
Câu trả lời hay nhất

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


Ảnh đại diện
Huỷ bỏ
Câu trả lời hay nhất

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

Ảnh đại diện
Huỷ bỏ
Tác giả Câu trả lời hay nhất

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.

Ảnh đại diện
Huỷ bỏ

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

Tác giả

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

Bài viết liên quan Trả lời Lượt xem Hoạt động
0
thg 11 24
5254
1
thg 8 15
10051
2
thg 6 20
4884
1
thg 6 16
3423
1
thg 6 15
1182