高级用例:筛选器和状态栏

  • Case scenario 1: on Sales, set a filter on Belgian customers and define it as the default one (the user should still be able to unset the filter).

在客户页面上,使用*Filters* > Add Custom Filter*按国家/地区对客户进行分组。现在,*Favorites*下, *Save Current Search*使 *Use by defaultSave.

View of a custom filter being set to be used by default in Odoo

在 在 Studio 模式下的 Filter Rules*上,选择相应的筛选器并启用 *Default Filter

View of a filter’s rule form emphasizing the field default filter in Odoo Studio
  • Case scenario 2: add a status bar on the product form to manage its life cycle. Set the values: ‘Prototype’, ‘In use’ and ‘Deprecated’. By default, the Kanban view must be grouped by status.

在产品窗体上,Add a pipeline status bar*并命名其值。状态栏是 *selection 字段,使您可以跟踪特定流。它们有助于向您展示已取得的进展。
Views 菜单上,访问 Kanban,并在其 View 选项下将 Default Group by 设置为 Pipeline status bar
Form view emphasizing the button add a pipeline bar in Odoo Studio

现在,打开您的产品表单,并设置该产品正确的状态。当您在整个阶段(也通过产品的形式)移动产品时,看板视图中将显示阶段。

小技巧

例如,若要修改管道状态栏,请记住返回*Form View*。

View of Studio emphasizing the form view button in Odoo Studio
  • Case scenario 2.a: when a product goes from ‘In use’ to ‘Deprecate’, set its cost to 0€.

创建 automated action 与所选值:

  • Model: 产品模板

  • Trigger: 更新时

  • First Domain:管道状态栏 = 正在使用中

  • Second Domain: 管道状态栏 = 已弃用

  • Action To Do: 更新记录

  • Data to Write: 成本(产品模板) >价值 > 0

View of the automated action created to set the price of a product to zero in Odoo Studio