Skip to Content
เมนู
คุณต้องลงทะเบียนเพื่อโต้ตอบกับคอมมูนิตี้
คำถามนี้ถูกตั้งค่าสถานะ
4 ตอบกลับ
8145 มุมมอง

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">


อวตาร
ละทิ้ง
คำตอบที่ดีที่สุด

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

อวตาร
ละทิ้ง
ผู้เขียน คำตอบที่ดีที่สุด

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

อวตาร
ละทิ้ง
คำตอบที่ดีที่สุด

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

อวตาร
ละทิ้ง
Related Posts ตอบกลับ มุมมอง กิจกรรม
V17 Tree, Form view แก้ไขแล้ว
1
มี.ค. 25
1802
4
มี.ค. 24
3882
1
ต.ค. 23
5746
1
มิ.ย. 22
7037
How to inherits only one fields แก้ไขแล้ว
4
มิ.ย. 21
16310