目录

评估

阅读(4) 最后更新: 2019年1月17日 08:35

上一页 Further reading | 其他你可能喜欢的书 下一页

翻译进度 7%

自助翻译

在设计Odoo应用程序时,需要考虑哪些相关层?
chapter-1What are the relevant layers to consider when designing an Odoo application?1.

首先关注数据层,构造数据模型、所需的模型以及它们之间的关系,实体-关系图(ERD)是实现这一目标的有用工具。
First focus on the Data layer, structuring the data model, the models needed and their relations.Entity-relationship diagrams (ERDs) can be a useful tool for this.

Then think about the Presentation layer—how the user interface will be organized to fit the use cases to be supported.

Finally, think about the Logic layer, supporting the required business rules.These can be validations, automation, or helper features.

How is Developer mode enabled?2.

Developer Mode, making available the Settings | Technical menu and the Debug contextual menu, can be enabled in the main Settings screen, using a link in the bottom-right.This has been so since Odoo 10.0; in Odoo 9.0 and before, it is enabled from the About dialog, accessed from the user menu in the top-right.It can also be enabled directly on the page URL, by changing the .../web?#... URL to .../web?debug#....

Where do you create a new Data model?3.

Data Models can be created and modified in the Settings app, in the Technical | Database Structure | Models menu option.To have the Technical menu available, you must have Developer Mode enabled.New models must have an x_ prefix, and new fields must also have this same x_ prefix.

How do you make a new data model available for the end users to create and4.

edit records?You should create a menu item for this, and in most cases, you will also want to design proper List and Form Views.You also need to add the ACLs to a group the user belongs to, or they won't be able to see the menu and views.

How do you add a field to an existing form?5.

You first edit the model to add the new field, then find the base View for the form (for example, using the Debug menu).Then create an extension view for that base view, adding the new field.

What is a Domain, and when can it be used?6.

It is a filter to apply when querying records from the database.

How can you set default values on the form you're navigating to?7.

You do this by setting a context key with the default_ prefix, for example, {'default_x_name': ' '}.This context key can be set on Window Actions, used in Menu items, and for relational fields can be set on the View's field definition.

How do you give a user access to a Model?8.

You first assign the ACL, for create, read, update, and delete, to a Group, and then make sure that the user belongs to that Group, directly or indirectly (indirectly belonging to another Group that inherits that one, such as Manager groups, which usually inherit from user groups).

How can you add a Category field to the To-do items, with possible values9.

selectable from an options list?(The options list is editable and can be expanded by users.)Create a new Model called x_todo_category.No additional fields needed.

Edit the x_todo_item Model and add a x_category_id field, of the many-to- one type, with a related x_todo_category Model.

Edit the To-do item form view to add the new field: name="x_category_id" />.

Add the ACL to the To-do User group.

How can you extend the To-do Category model so that the list of Categories is10.

specific for each user?It is enough to create a record rule on the To-do category for the To-do User Group.The domain to use is [('create_uid', '=', user.id)].

You could also reorganize the To-do menu to have two child menu items, Items and Categories.

The To-do top menu item should have no action defined, the Items menu item should reuse the existing Action to open the to-do list, and a new Action should be used on the Categories menu item, opening the To-do Category list.

评论