I'm trying to follow the tutorial here:
\https://www.odoo.com/documentation/14.0/developer/howtos/rdtraining/04_basicmodel.html
And I'm having a difficult time changing models / updatnig models without having to go through several hours of playing around with settings.
Here is the context:
- Windows 10 and am using the all-in-one installation package.
- I used the included python in the package to create a virtual environment and install the required dependencies via pip install -r requirements.txt (I also updated numstd because it wasn't working with only 1.8, but it worked with 1.8.1).
I'm typing: python odoo-bin -u estate -d Test-DB, into git bash in a VS code terminal, where estate is from the tutorial (the module I installed) and Test-DB is the DB I made that in theory holds the model data.
However, it just hangs. My hunch is that the service is already running since I installed the all-in-one, so I am not allowed to use command line. But if I cannot use the command line, how do I update the models? I'm going into my localhost:8069 and navigating to the estate module and clicking upgrade, but even after restarting the server, it doesn't seem to work. Is there a certain order of operations? Should I restart the server first then upgrade? or should I upgrade and then restart the server? or should I be disabling the service and then running the commnad? I tried doing this, but it still hangs after I enter the command in.
I'm at a loss. This tutorial is absurdly hard for someone just entering the space.
Please check the log files, most probably your module is buggy. In order to start Odoo manually from command line, you have to stop the service first.
Here is a snippet of my log files
2021-10-05 08:59:27,001 18648 INFO Test-DB werkzeug: 127.0.0.1 - - [05/Oct/2021 08:59:27] "POST /web/dataset/call_kw/ir.module.module/search_panel_select_range HTTP/1.1" 200 - 37 0.030 0.010
2021-10-05 08:59:27,327 18648 INFO Test-DB werkzeug: 127.0.0.1 - - [05/Oct/2021 08:59:27] "POST /web/dataset/search_read HTTP/1.1" 200 - 3 0.001 0.004
2021-10-05 08:59:30,962 18648 WARNING Test-DB odoo.modules.module: module estate: module not found
2021-10-05 08:59:30,969 18648 INFO Test-DB werkzeug: 127.0.0.1 - - [05/Oct/2021 08:59:30] "POST /web/dataset/call_kw/ir.module.module/read HTTP/1.1" 200 - 14 0.016 0.017
2021-10-05 08:59:31,295 18648 INFO Test-DB werkzeug: 127.0.0.1 - - [05/Oct/2021 08:59:31] "POST /web/dataset/call_kw/ir.module.module.dependency/read HTTP/1.1" 200 - 4 0.001 0.004
2021-10-05 08:59:31,626 18648 INFO Test-DB werkzeug: 127.0.0.1 - - [05/Oct/2021 08:59:31] "POST /web/dataset/call_kw/ir.module.category/name_search HTTP/1.1" 200 - 3 0.003 0.006
2021-10-05 08:59:31,971 18648 INFO Test-DB werkzeug: 127.0.0.1 - - [05/Oct/2021 08:59:31] "GET /web/image?model=ir.module.module&id=441&field=icon_image&unique=10052021175915 HTTP/1.1" 200 - 3 0.002 0.008
2021-10-05 08:59:31,973 18648 INFO Test-DB odoo.http: <function odoo.addons.web_editor.controllers.main.public_render_template> called ignoring args <kwargs={'context': {'lang': 'en_US', 'tz': 'Europe/Brussels', 'uid': 2, 'allowed_company_ids': [1]}}>
2021-10-05 08:59:32,012 18648 INFO Test-DB werkzeug: 127.0.0.1 - - [05/Oct/2021 08:59:32] "POST /web_editor/public_render_template HTTP/1.1" 200 - 43 0.020 0.031
2021-10-05 08:59:45,563 18648 WARNING ? odoo.addons.base.models.ir_cron: Skipping database Test-DB because of modules to install/upgrade/remove.
2021-10-05 08:59:49,676 18648 WARNING ? odoo.addons.base.models.ir_cron: Skipping database Test-DB because of modules to install/upgrade/remove.
2021-10-05 08:59:52,125 18648 INFO Test-DB werkzeug: 127.0.0.1 - - [05/Oct/2021 08:59:52] "POST /longpolling/poll HTTP/1.1" 200 - 8 0.006 50.081
2021-10-05 09:00:08,317 18648 INFO Test-DB werkzeug: 127.0.0.1 - - [05/Oct/2021 09:00:08] "POST /longpolling/poll HTTP/1.1" 200 - 17 0.010 50.017
2021-10-05 09:00:09,168 18648 INFO Test-DB werkzeug: 127.0.0.1 - - [05/Oct/2021 09:00:09] "POST /longpolling/im_status HTTP/1.1" 200 - 4 0.004 0.007
2021-10-05 09:00:42,808 18648 INFO Test-DB odoo.service.server: Initiating shutdown
2021-10-05 09:00:42,808 18648 INFO Test-DB odoo.service.server: Hit CTRL-C again or send a second signal to force the shutdown.
2021-10-05 09:00:45,582 18648 WARNING ? odoo.addons.base.models.ir_cron: Skipping database Test-DB because of modules to install/upgrade/remove.
2021-10-05 09:00:50,685 18648 WARNING ? odoo.addons.base.models.ir_cron: Skipping database Test-DB because of modules to install/upgrade/remove.
2021-10-05 09:00:58,674 18648 INFO Test-DB werkzeug: 127.0.0.1 - - [05/Oct/2021 09:00:58] "POST /longpolling/poll HTTP/1.1" 200 - 8 0.006 50.020
2021-10-05 09:01:23,614 20452 INFO ? odoo: Odoo version 14.0-20211004
2021-10-05 09:01:23,614 20452 INFO ? odoo: Using configuration file at C:\Odoo\server\odoo.conf
2021-10-05 09:01:23,615 20452 INFO ? odoo: addons paths: ['C:\\Odoo\\server\\odoo\\addons', 'c:\\users\\lu\\appdata\\local\\openerp s.a\\odoo\\addons\\14.0', 'c:\\odoo\\server\\odoo\\addons', 'c:\\odoo\\server\\addons']
2021-10-05 09:01:23,615 20452 INFO ? odoo: database: odoo@localhost:5432
2021-10-05 09:01:23,777 20452 INFO ? odoo.addons.base.models.ir_actions_report: Will use the Wkhtmltopdf binary at C:\Odoo\thirdparty\wkhtmltopdf.exe
2021-10-05 09:01:23,856 20452 INFO ? odoo.service.server: HTTP service (werkzeug) running on DESKTOP-C8J2POC:8069
2021-10-05 09:01:23,878 20452 INFO Test-DB odoo.modules.loading: loading 1 modules...
2021-10-05 09:01:23,888 20452 INFO Test-DB odoo.modules.loading: 1 modules loaded in 0.01s, 0 queries (+0 extra)
2021-10-05 09:01:23,958 20452 INFO Test-DB odoo.modules.loading: updating modules list
2021-10-05 09:01:23,959 20452 INFO Test-DB odoo.addons.base.models.ir_module: ALLOW access to module.update_list on [] to user __system__ #1 via n/a
2021-10-05 09:01:24,109 20452 INFO ? odoo.http: HTTP Configuring static files
2021-10-05 09:01:24,444 20452 INFO Test-DB odoo.addons.base.models.ir_module: ALLOW access to module.button_upgrade on ['estate'] to user __system__ #1 via n/a
2021-10-05 09:01:24,445 20452 INFO Test-DB odoo.addons.base.models.ir_module: ALLOW access to module.update_list on ['estate'] to user __system__ #1 via n/a
2021-10-05 09:01:24,950 20452 INFO Test-DB odoo.addons.base.models.ir_module: ALLOW access to module.button_install on [] to user __system__ #1 via n/a
2021-10-05 09:01:24,972 20452 INFO Test-DB odoo.modules.loading: loading 36 modules...
2021-10-05 09:01:25,014 20452 INFO Test-DB odoo.modules.loading: Loading module estate (13/36)
2021-10-05 09:01:25,091 20452 INFO Test-DB odoo.modules.registry: module estate: creating or updating database tables
2021-10-05 09:01:25,144 20452 INFO Test-DB odoo.modules.loading: Module estate: loading demo
2021-10-05 09:01:25,157 20452 INFO Test-DB odoo.modules.loading: Module estate loaded in 0.14s, 48 queries
2021-10-05 09:01:25,165 20452 WARNING Test-DB py.warnings: C:\Odoo\python\lib\site-packages\jinja2\sandbox.py:82: DeprecationWarning: Using or importing the ABCs from 'collections' instead of from 'collections.abc' is deprecated since Python 3.3,and in 3.9 it will stop working
from collections import MutableSet, MutableMapping, MutableSequence
2021-10-05 09:01:25,274 20452 INFO Test-DB odoo.modules.loading: 36 modules loaded in 0.30s, 48 queries (+0 extra)
2021-10-05 09:01:25,408 20452 WARNING Test-DB odoo.modules.loading: The model estate.property has no access rules, consider adding one. E.g. access_estate_property,access_estate_property,model_estate_property,base.group_user,1,0,0,0
2021-10-05 09:01:25,468 20452 INFO Test-DB odoo.modules.registry: verifying fields for every extended model
2021-10-05 09:01:25,628 20452 INFO Test-DB odoo.modules.loading: Modules loaded.
2021-10-05 09:01:25,648 20452 INFO Test-DB odoo.addons.base.models.ir_http: Generating routing map for key None
2021-10-05 09:01:25,684 20452 INFO Test-DB odoo.addons.base.models.ir_http: Generating routing map for key None
2021-10-05 09:01:25,736 20452 INFO Test-DB werkzeug: 127.0.0.1 - - [05/Oct/2021 09:01:25] "POST /web/webclient/version_info HTTP/1.1" 200 - 2 0.001 1.614
2021-10-05 09:01:25,756 20452 INFO ? odoo.addons.bus.models.bus: Bus.loop listen imbus on db postgres
2021-10-05 09:02:15,769 20452 INFO Test-DB werkzeug: 127.0.0.1 - - [05/Oct/2021 09:02:15] "POST /longpolling/poll HTTP/1.1" 200 - 21 0.036 51.491
2021-10-05 09:02:36,127 20452 INFO Test-DB odoo.service.server: Initiating shutdown
2021-10-05 09:02:36,127 20452 INFO Test-DB odoo.service.server: Hit CTRL-C again or send a second signal to force the shutdown.
2021-10-05 09:03:05,801 20452 INFO Test-DB werkzeug: 127.0.0.1 - - [05/Oct/2021 09:03:05] "POST /longpolling/poll HTTP/1.1" 200 - 8 0.003 50.019
2021-10-05 12:03:58,317 11136 INFO ? odoo: Odoo version 14.0-20211004
2021-10-05 12:03:58,317 11136 INFO ? odoo: Using configuration file at C:\Odoo\server\odoo.conf
2021-10-05 12:03:58,317 11136 INFO ? odoo: addons paths: ['C:\\Odoo\\server\\odoo\\addons', 'c:\\users\\lu\\appdata\\local\\openerp s.a\\odoo\\addons\\14.0', 'c:\\odoo\\server\\odoo\\addons', 'c:\\odoo\\server\\addons']
2021-10-05 12:03:58,317 11136 INFO ? odoo: database: odoo@localhost:5432
2021-10-05 12:03:58,507 11136 INFO ? odoo.addons.base.models.ir_actions_report: Will use the Wkhtmltopdf binary at C:\Odoo\thirdparty\wkhtmltopdf.exe
2021-10-05 12:03:58,601 11136 INFO ? odoo.service.server: HTTP service (werkzeug) running on DESKTOP-C8J2POC:8069
2021-10-05 12:04:09,434 11136 INFO ? odoo.http: HTTP Configuring static files
2021-10-05 12:04:09,475 11136 INFO Test-DB odoo.modules.loading: loading 1 modules...
2021-10-05 12:04:09,483 11136 INFO Test-DB odoo.modules.loading: 1 modules loaded in 0.01s, 0 queries (+0 extra)
2021-10-05 12:04:09,503 11136 INFO Test-DB odoo.modules.loading: loading 36 modules...
2021-10-05 12:04:13,715 11136 INFO Test-DB odoo.modules.loading: 36 modules loaded in 4.21s, 0 queries (+0 extra)
2021-10-05 12:04:13,889 11136 INFO Test-DB odoo.modules.loading: Modules loaded.
2021-10-05 12:04:13,932 11136 INFO Test-DB odoo.addons.base.models.ir_http: Generating routing map for key None
2021-10-05 12:04:13,946 11136 INFO Test-DB odoo.addons.base.models.ir_http: Generating routing map for key None
2021-10-05 12:04:14,090 11136 INFO Test-DB odoo.addons.base.models.ir_http: Generating routing map for key None
2021-10-05 12:04:14,223 11136 INFO Test-DB werkzeug: 127.0.0.1 - - [05/Oct/2021 12:04:14] "GET / HTTP/1.1" 303 - 3 0.005 2.032
2021-10-05 12:04:14,267 11136 INFO ? odoo.addons.bus.models.bus: Bus.loop listen imbus on db postgres
2021-10-05 12:04:14,816 11136 INFO Test-DB werkzeug: 127.0.0.1 - - [05/Oct/2021 12:04:14] "GET /web HTTP/1.1" 200 - 349 0.216 5.161
2021-10-05 12:04:14,826 11136 INFO Test-DB werkzeug: 127.0.0.1 - - [05/Oct/2021 12:04:14] "GET /web HTTP/1.1" 200 - 44 0.047 0.237
2021-10-05 12:04:15,378 11136 INFO ? werkzeug: 127.0.0.1 - - [05/Oct/2021 12:04:15] "GET /web/static/src/img/favicon.ico HTTP/1.1" 200 - - - -
2021-10-05 12:04:15,456 11136 INFO Test-DB werkzeug: 127.0.0.1 - - [05/Oct/2021 12:04:15] "POST /web/dataset/call_kw/res.users/read HTTP/1.1" 200 - 2 0.001 0.003
2021-10-05 12:04:15,474 11136 INFO Test-DB werkzeug: 127.0.0.1 - - [05/Oct/2021 12:04:15] "POST /web/dataset/call_kw/res.users/systray_get_activities HTTP/1.1" 200 - 16 0.016 0.007
2021-10-05 12:04:15,482 11136 INFO Test-DB werkzeug: 127.0.0.1 - - [05/Oct/2021 12:04:15] "POST /mail/init_messaging HTTP/1.1" 200 - 80 0.050 0.026
2021-10-05 12:04:15,702 11136 INFO Test-DB werkzeug: 127.0.0.1 - - [05/Oct/2021 12:04:15] "POST /web/action/load HTTP/1.1" 200 - 9 0.010 0.008
2021-10-05 12:04:15,773 11136 INFO Test-DB werkzeug: 127.0.0.1 - - [05/Oct/2021 12:04:15] "POST /longpolling/im_status HTTP/1.1" 200 - 4 0.004 0.007
2021-10-05 12:04:15,840 11136 INFO Test-DB werkzeug: 127.0.0.1 - - [05/Oct/2021 12:04:15] "POST /web/dataset/call_kw/mail.message/load_views HTTP/1.1" 200 - 27 0.021 0.011
2021-10-05 12:04:16,040 11136 INFO Test-DB werkzeug: 127.0.0.1 - - [05/Oct/2021 12:04:16] "POST /web/dataset/call_kw/mail.message/message_fetch HTTP/1.1" 200 - 8 0.008 0.006
2021-10-05 12:04:16,208 11136 INFO Test-DB werkzeug: 127.0.0.1 - - [05/Oct/2021 12:04:16] "GET /web/image?model=res.users&field=image_128&id=2 HTTP/1.1" 200 - 5 0.003 0.009
2021-10-05 12:04:58,612 11136 INFO Test-DB odoo.addons.base.models.ir_cron: Starting job `Snailmail: process letters queue`.
2021-10-05 12:04:58,621 11136 INFO Test-DB odoo.addons.base.models.ir_cron: Job `Snailmail: process letters queue` done.
2021-10-05 12:04:58,621 11136 INFO Test-DB odoo.addons.base.models.ir_cron: Starting job `Mail: Email Queue Manager`.
2021-10-05 12:04:58,628 11136 INFO Test-DB odoo.addons.base.models.ir_cron: Job `Mail: Email Queue Manager` done.
2021-10-05 12:04:58,629 11136 INFO Test-DB odoo.addons.base.models.ir_cron: Starting job `Partner Autocomplete : Sync with remote DB`.
2021-10-05 12:04:58,665 11136 INFO Test-DB odoo.addons.base.models.ir_cron: Job `Partner Autocomplete : Sync with remote DB` done.
2021-10-05 12:04:58,665 11136 INFO Test-DB odoo.addons.base.models.ir_cron: Starting job `SMS: SMS Queue Manager`.
2021-10-05 12:04:58,672 11136 INFO Test-DB odoo.addons.base.models.ir_cron: Job `SMS: SMS Queue Manager` done.
2021-10-05 12:04:58,672 11136 INFO Test-DB odoo.addons.base.models.ir_cron: Starting job `Calendar: Event Reminder`.
2021-10-05 12:04:58,684 11136 INFO Test-DB odoo.addons.base.models.ir_cron: Job `Calendar: Event Reminder` done.
2021-10-05 12:05:04,282 11136 INFO Test-DB werkzeug: 127.0.0.1 - - [05/Oct/2021 12:05:04] "POST /longpolling/poll HTTP/1.1" 200 - 21 0.054 51.051
2021-10-05 12:05:05,450 11136 INFO Test-DB werkzeug: 127.0.0.1 - - [05/Oct/2021 12:05:05] "POST /longpolling/poll HTTP/1.1" 200 - 8 0.006 50.023
2021-10-05 12:05:06,164 11136 INFO Test-DB werkzeug: 127.0.0.1 - - [05/Oct/2021 12:05:06] "POST /longpolling/im_status HTTP/1.1" 200 - 4 0.004 0.008
2021-10-05 12:05:55,808 11136 INFO Test-DB werkzeug: 127.0.0.1 - - [05/Oct/2021 12:05:55] "POST /longpolling/poll HTTP/1.1" 200 - 8 0.003 50.015
2021-10-05 12:05:57,170 11136 INFO Test-DB werkzeug: 127.0.0.1 - - [05/Oct/2021 12:05:57] "POST /longpolling/im_status HTTP/1.1" 200 - 4 0.004 0.006
2021-10-05 12:06:21,463 11136 INFO ? odoo.service.server: Initiating shutdown
2021-10-05 12:06:21,463 11136 INFO ? odoo.service.server: Hit CTRL-C again or send a second signal to force the shutdown.
2021-10-05 12:06:46,156 11136 INFO Test-DB werkzeug: 127.0.0.1 - - [05/Oct/2021 12:06:46] "POST /longpolling/poll HTTP/1.1" 200 - 8 0.007 50.015
2021-10-05 12:14:37,940 21352 INFO ? odoo: Odoo version 14.0-20211004
2021-10-05 12:14:37,940 21352 INFO ? odoo: Using configuration file at C:\Odoo\server\odoo.conf
2021-10-05 12:14:37,940 21352 INFO ? odoo: addons paths: ['C:\\Odoo\\server\\odoo\\addons', 'c:\\users\\lu\\appdata\\local\\openerp s.a\\odoo\\addons\\14.0', 'c:\\odoo\\server\\odoo\\addons', 'c:\\odoo\\server\\addons']
2021-10-05 12:14:37,940 21352 INFO ? odoo: database: odoo@localhost:5432
2021-10-05 12:14:38,115 21352 INFO ? odoo.addons.base.models.ir_actions_report: Will use the Wkhtmltopdf binary at C:\Odoo\thirdparty\wkhtmltopdf.exe
2021-10-05 12:14:38,210 21352 INFO ? odoo.service.server: HTTP service (werkzeug) running on DESKTOP-C8J2POC:8069
2021-10-05 12:14:38,235 21352 INFO Test-DB odoo.modules.loading: loading 1 modules...
2021-10-05 12:14:38,243 21352 INFO Test-DB odoo.modules.loading: 1 modules loaded in 0.01s, 0 queries (+0 extra)
2021-10-05 12:14:38,261 21352 INFO Test-DB odoo.modules.loading: loading 36 modules...
2021-10-05 12:14:38,499 21352 INFO Test-DB odoo.modules.loading: 36 modules loaded in 0.24s, 0 queries (+0 extra)
2021-10-05 12:14:38,625 21352 INFO Test-DB odoo.modules.loading: Modules loaded.
2021-10-05 12:14:43,833 21352 INFO ? odoo.http: HTTP Configuring static files
My module seems okay. I'm copy pasting from the tutorial.
For example:
I have server/addons/estate/ as a directory
Inside estate I have a __init__.py and a __manifest__.py. Init has "import . from models". manifest has
# -*- coding: utf-8 -*-
# Part of Odoo. See LICENSE file for full copyright and licensing details.
{
'name': 'Real Estate',
'installable': True,
'application': True,
'depends': [
'base_setup',
],
'application': True,
}
inside server/addons/estate/models I have
__init__.py
from . import estate_property
and estate_property.py
from odoo import fields, models
class EstateProperty(models.Model):
_name = "estate.property"
_description = "This is the Estate Property model, test."
name = fields.Char(required=True)
description = fields.Text()
postcode = fields.Char()
date_availability = fields.Date()
expected_price = fields.Float(required=True)
selling_price = fields.Float()
bedrooms = fields.Integer()
living_area = fields.Integer()
facades = fields.Integer()
garage = fields.Boolean()
garden = fields.Boolean()
garden_area = fields.Integer()
garden_orientation = fields.Selection(
string="Direction",
selection=[('West', 'west'), ('North', 'north'), ('South', 'south'), ('East', 'east')]
)
I also stopped the service and tried python odoo-bin -u estate -d Test-DB
However, terminal just hangs so I cannot see any output. I have to manually check logs. I can confirm however that while its hanging, I can access localhost, so it's establishing the server, just not outputting things as it should.