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

hello i want to ask about inherite view form.

i already inherit module sale.order into my new module..

----My code----

from odoo import models, fields, api, exceptions

#from datetime import timedelta

class beli(models.Model):

    # ____________ ORM disini ____________ 

    _name = 'sale.beli'    #(nama model/ Id model)

    _inherit='sale.order'  

    #_inherits='model1,model2'

    _description ='model order'

    #_order ='name asc'  

    #_rec_name="field_pengganti_name" #(overide field name sbg representatif model)

    # ____________ field-field mulai disini ____________ 

is_beli = fields.Boolean(string="Beli?", default=True)


but when I try to inherit sale.order form the result is that the odoo displays another form which I don't know where it came from

-----My code-----

<!--  __________ INHERITED beli view form __________-->

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

    <field name="name">beli.form</field>

    <field name="model">sale.beli</field>

        <field name="inherit_id" ref="sale.view_order_form"/>

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


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

You would need to create an action and menu for your new object.

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

i already make an action and menu for my new object but still the result is odoo displays another form which I don't know where it came from

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

you need to create a new action and menu for that object. In action refer your inherited form id which you want to load

Ảnh đại diện
Huỷ bỏ
Bài viết liên quan Trả lời Lượt xem Hoạt động
V17 Tree, Form view Đã xử lý
1
thg 3 25
1547
4
thg 3 24
3657
1
thg 10 23
5556
1
thg 6 22
6849
4
thg 6 21
16113