The process of adding a new data model to an application

After the application development is completed, if you want to add a new data model, the steps are as follows

1. odoo part

1. Modify the models.py file

Add a new class and define each field

2. Modify the ir.model.access.csv file

Add model access permissions

3. Update module

Notice:

  • Since the existing database contains a large amount of data, in order to avoid accidental loss of data, you should first re-create an odoo database and try to install this module to ensure that it can be installed correctly.
  • Try to use the upgrade method when installing. If it doesn't work, consider uninstalling and reinstalling, but be sure to back up the database first.
  • Note that you need to restart the odoo service before installation! !

2. uniapp part

1. Modify the app.vue file

Define global variables and read database data into global variables

2. Modify pages.json file

Define the new page to be used

3. Design a new page file

  • index,.vue: Home page
  • list,.vue: list page
  • edit.vue: edit page
  • read.vue: read page

4. Set rich text related files

For HTML type fields, associate the rich text editor (wangeditor), including two parts

  • In the pages/editor directory
  • In hybird/html directory

Guess you like

Origin blog.csdn.net/boophan/article/details/118963873
Recommended