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

hello,
So after adding the form view I can't see the list view,if I clieck on the app from the app list it opens the form not the list
here is my  custom_module/model,
from odoo import models, fields



class ResPartner(models.Model):

_inherit = "res.partner"


cnp = fields.Char(string="CNP", help="Cod Numeric Personal for verification")



here is my cnp_list_view.xml,
<?xml version="1.0" encoding="utf-8"?>

<odoo>

<data>


<!-- List View -->

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

<field name="name">res.partner.view.list.inherit.cnp</field>

<field name="model">res.partner</field>

<field name="inherit_id" ref="base.view_partner_tree"/>

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

<xpath expr="//field" position="before">

<field name="name"/>

<field name="phone"/>

<field name="email"/>

<field name="city"/>

<field name="cnp"/>

</xpath>

</field>

</record>


<!-- Form View -->

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

<field name="name">res.partner.view.form.inherit</field>

<field name="model">res.partner</field>

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

<form string="CNP Numbers">

<div class="s_website_form_rows row s_col_no_bgcolor">

<div class="form-group s_website_form_field col-12 s_website_form_done" data-name="Field">

<field id="name" name="name" placeholder="Name"/>

<field name="phone" placeholder="Phone"/>

<field name="email" placeholder="Email"/>

<field name="city" placeholder="City"/>

<field name="cnp" placeholder="CNP"/>

</div>

</div>

</form>

</field>

</record>


<!-- Action -->

<record id="action_cnp_validation" model="ir.actions.act_window">

<field name="name">CNP Numbers</field>

<field name="res_model">res.partner</field>

<field name="view_mode">list,form</field>

</record>


<!-- Menu -->

<menuitem

id="menu_cnp_validation_root"

name="CNP Validation App"

/>


<menuitem

id="menu_cnp_validation"

parent="menu_cnp_validation_root"

action="action_cnp_validation"

/>

</data>

</odoo>


Ảnh đại diện
Huỷ bỏ
Câu trả lời hay nhất
  1. Check if your views are in the manifest file
  2. Make sure you rerun the Odoo because XML updates are not instantly recognized
  3. Make sure you are upgrading the custom app on the command line
  4. I had to remove session directory in couple occasions 
  5. Monitor logs carefully for related error messages


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

Hi,
Code seems to be fine, if it is in a non production db, try uninstalling the app and install again, it may solve the problem, or open the corresponding action in actions menu and see the order of views in view_ids one2many

Thanks

Ảnh đại diện
Huỷ bỏ
Bài viết liên quan Trả lời Lượt xem Hoạt động
0
thg 11 19
3466
V17 Tree, Form view Đã xử lý
1
thg 3 25
999
1
thg 11 22
2584
0
thg 6 22
2460
3
thg 2 21
26468