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

How do i archive a model in Odoo  marking records in a model as without permanently deleting them? 

頭像
捨棄
作者 最佳答案

Include the active field in the model definition if it's not already present.

active = fields.Boolean(string="Active", default=True)

Add a filter to show archived records in the search view if required.

<record id="view_my_model_search" model="ir.ui.view"> <field name="name">my.model.search</field> <field name="model">my.model</field> <field name="arch" type="xml"> <search> <filter string="Archived" domain="[('active', '=', False)]"/> </search> </field> </record>

Regards, NIkhil T Amzsys


Accurates

頭像
捨棄
相關帖文 回覆 瀏覽次數 活動
2
8月 25
2625
2
6月 25
2135
1
6月 25
905
0
1月 25
1573
3
9月 25
89