官术网_书友最值得收藏!

The model layer

Now that Odoo knows about our new module, let's start by adding a simple model to it.

Models describe business objects, such as an Opportunity, Sales Order, or Partner (customer, supplier, and so on). A model has a list of attributes and can also define its specific business.

Models are implemented using a Python class derived from an Odoo template class. They translate directly to database objects, and Odoo automatically takes care of that when installing or upgrading the module. The component responsible for this is the Object Relational Mapping (ORM).

Our module will be a very simple application to maintain To-Do tasks. These tasks will have a single text field for the description and a checkbox to mark them as complete. We should later add a button to remove the old, completed tasks from the To-Do list.

主站蜘蛛池模板: 阆中市| 滦南县| 杭锦后旗| 江孜县| 察哈| 陆丰市| 屏南县| 敦煌市| 盐城市| 清涧县| 岳西县| 保靖县| 浑源县| 屏南县| 隆昌县| 宁远县| 宣化县| 化州市| 新田县| 喀什市| 肇源县| 小金县| 宽甸| 循化| 牙克石市| 广饶县| 昆山市| 邓州市| 化州市| 青川县| 绥阳县| 都江堰市| 富宁县| 富平县| 晋宁县| 灵山县| 纳雍县| 江安县| 焦作市| 温州市| 南通市|