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

I'm a new for Odoo and keep learning odoo by cookbook .  This my py file 

from datetime import date, datetime, timedelta 
from odoo import api, fields, models, SUPERUSER_ID, _
from odoo.exceptions import UserError
from odoo.tools import DEFAULT_SERVER_DATE_FORMAT, DEFAULT_SERVER_DATETIME_FORMAT


class CenterEquipment(models.Model):    
_name = 'center.equipment'    
_description = 'Center Branch'
name = fields.Char('Center Name', required=True, translate=True)   
sequence_number = fields.Char('sequence', default=0)    
electronic_devices = fields.Integer('Electronic Devices', default=0)    
office_equipment = fields.Integer('Office Equipment', default=0)    
total_equipment = fields.Integer('Total Equipment', default=0)
and this's my xml :
<!-- Kanban -->    
<record id="center_equipment_kanban_view" model="ir.ui.view">
<field name="name">center.equipment.kanban</field>            
<field name="model">center.equipment</field>            
<field name="arch" type="xml">                
<kanban>                    
<field name="name"/>                    
<field name="electronic_devices"/>                    
<field name="office_equipment"/>                    
<field name="total_equipment"/>                    
<templates>                        
<t t-name="kanban-box">                            
<div t-attf-class="oe_kanban_global_click">                                
<div>                                    
<strong><field name="name"/></strong>                                    
<button><t t-esc="#"/> Request  </button>                                    
<field name="electronic_devices"/> 
<field name="office_equipment"/> 
<field name="total_equipment"/>                               
</div>                            
</div>                       
</t>                   
</templates>                
</kanban>            
</field>    
</record>  
This's my action for kanban view :
<record id="center_equipment_action_view" model="ir.actions.act_window">        
<field name="name">center.equipment.action</field>        
<field name="res_model">center.equipment</field>        
<field name="view_model">kanban,form</field>        
<field name="view_id" ref="center_equipment_kanban_view"/>        
<field name="help" type="html">           
 <p class="o_view_nocontent_smiling_face">                
Add a new Center            
</p>        
</field>    
</record> 
 I can't understand when i add a <menuitem> with action ref="center_equipment_action_view"  The kanban not display, Its just only Tree view show up ???
 
Ảnh đại diện
Huỷ bỏ
Câu trả lời hay nhất

You must have to add kanban view into action window as well.

Ảnh đại diện
Huỷ bỏ
Tác giả

Thank you so much !!!

Bài viết liên quan Trả lời Lượt xem Hoạt động
1
thg 1 25
1786
0
thg 8 22
2658
0
thg 3 22
2629
2
thg 5 18
6469
1
thg 4 17
7704