odoo中的filtered_domain
生活随笔
收集整理的這篇文章主要介紹了
odoo中的filtered_domain
小編覺得挺不錯的,現在分享給大家,幫大家做個參考.
在使用第一次篩選后的數據集后
后續再用第一次的結果再次進行篩選
從第二次開始篩選時,就用filtered_domain
search_data = self.env['assets.header.common.info'].search([['company_id', '=', self.company_id.id],['asset_type', '!=', 'low_value']]) # 符合公司的、不等于低值的if len(search_data) != 0:if self.asset_type and len(search_data) != 0:search_data = search_data.filtered_domain([['asset_type', '=', self.asset_type]])if self.asset_class and len(search_data) != 0:search_data = search_data.filtered_domain([['asset_category_id', 'in', self.asset_class.ids]])if self.admin_dept_id and len(search_data) != 0:search_data = search_data.filtered_domain([['admin_dept_id', 'in', self.admin_dept_id.ids]])search_data_result = search_data.filtered_domain([['usage_status', '=', 'running'],['depreciation_method', '!=', 'no_depreciation'],['depreciation_times', '>', 0],['depreciation_convention', '=', 'next_month']])print(search_data_result)if len(search_data_result) != 0:# 排除掉入賬日期屬于參數所選折舊期間search_data_result = search_data_result.filtered_domain(['|',['record_date', '<', self.period_id.start_date],['record_date', '>', self.period_id.end_date]])總結
以上是生活随笔為你收集整理的odoo中的filtered_domain的全部內容,希望文章能夠幫你解決所遇到的問題。
- 上一篇: odoo中的序列(自动增长的序列以及有条
- 下一篇: 1.Docker的安装以及配置国内源