跳至內容
選單
此問題已被標幟
1 回覆
5558 瀏覽次數

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 ???
 
頭像
捨棄
最佳答案

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

頭像
捨棄
作者

Thank you so much !!!

相關帖文 回覆 瀏覽次數 活動
1
1月 25
1775
0
8月 22
2643
0
3月 22
2622
2
5月 18
6462
1
4月 17
7694