Skip to content

Commit 465c844

Browse files
committed
Create Odoo 18 configuration
1 parent 1c0609d commit 465c844

File tree

9 files changed

+120
-36
lines changed

9 files changed

+120
-36
lines changed

.devcontainer/Dockerfile

+2-3
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
FROM ubuntu:jammy
1+
FROM ubuntu:noble
22
MAINTAINER Odoo S.A. <[email protected]>
33

44
SHELL ["/bin/bash", "-xo", "pipefail", "-c"]
@@ -17,7 +17,6 @@ RUN apt-get update && \
1717
curl \
1818
dirmngr \
1919
fonts-noto-cjk \
20-
git \
2120
gnupg \
2221
libssl-dev \
2322
node-less \
@@ -53,7 +52,7 @@ RUN apt-get update && \
5352
&& rm -rf /var/lib/apt/lists/* wkhtmltox.deb
5453

5554
# Install latest postgresql-client
56-
RUN echo 'deb http://apt.postgresql.org/pub/repos/apt/ jammy-pgdg main' > /etc/apt/sources.list.d/pgdg.list \
55+
RUN echo 'deb http://apt.postgresql.org/pub/repos/apt/ noble-pgdg main' > /etc/apt/sources.list.d/pgdg.list \
5756
&& GNUPGHOME="$(mktemp -d)" \
5857
&& export GNUPGHOME \
5958
&& repokey='B97B0AFCAA1A47F044F244A07FCC7D46ACCC4CF8' \

.devcontainer/URL.conf

+1-1
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
https://nightly.odoo.com/17.0/nightly/deb/odoo_17.0.latest_all.deb
1+
https://nightly.odoo.com/18.0/nightly/deb/odoo_18.0.latest_all.deb

.devcontainer/devcontainer.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
"workspaceFolder": "/workspace/custom",
66
"remoteUser": "root",
77
"forwardPorts": [8069],
8-
"postCreateCommand": "ln -s /workspace/.vscode /workspace/custom/.vscode || true",
8+
"postCreateCommand": "[ \"$CODESPACES\" = \"true\" ] && ln -s /workspaces/${localWorkspaceFolderBasename}/.vscode /workspace/custom/.vscode || ([ -z \"$CODESPACES\" ] && ln -s /workspace/.vscode /workspace/custom/.vscode || true)",
99
"shutdownAction": "stopCompose",
1010
"customizations": {
1111
"vscode": {

.devcontainer/docker-compose.yml

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
services:
22
odoo:
3-
image: "ghcr.io/m3r3nix/odoo-v17-community:latest"
3+
image: "ghcr.io/m3r3nix/odoo-v18-community:latest"
44
depends_on:
55
- db
66
ports:
@@ -9,7 +9,7 @@ services:
99
- ../:/workspace
1010
- ../custom:/mnt/extra-addons
1111
db:
12-
image: postgres:15
12+
image: postgres:16
1313
environment:
1414
- POSTGRES_DB=postgres
1515
- POSTGRES_PASSWORD=odoo

.vscode/tasks.json

+6
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,12 @@
77
"label": "Odoo Server Log",
88
"type": "shell",
99
"command": "tail -f /var/log/odoo/odoo-server.log",
10+
"problemMatcher": [],
11+
"isBackground": true,
12+
"presentation": {
13+
"reveal": "always",
14+
"panel": "dedicated"
15+
}
1016
}
1117
]
1218
}

README.md

+15-15
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
1-
[![Build and Push Odoo Dev Container](https://github.com/m3r3nix/odoo-dev-container/actions/workflows/docker-publish.yml/badge.svg?branch=v17)](https://github.com/m3r3nix/odoo-dev-container/actions/workflows/docker-publish.yml)
1+
[![Build and Push Odoo Dev Container](https://github.com/m3r3nix/odoo-dev-container/actions/workflows/docker-publish.yml/badge.svg?branch=v18)](https://github.com/m3r3nix/odoo-dev-container/actions/workflows/docker-publish.yml)
22

3-
# Odoo Development Container for GitHub Codespaces
3+
# Odoo Development Container for GitHub Codespaces and Visual Studio Code on Desktop
44

5-
You can spin up a development-ready environment in just 4 simple steps:
5+
Spin up a development-ready environment in just 4 simple steps:
66
1. Fork this repository or use it as a template and make it private (particularly if you intend to work with the Enterprise Edition).
77
Ensure that during this process, all branches are copied, not just the default one, if you aim to work with older Odoo versions as well.
88
2. Go to GitHub Actions and wait for all build processes to complete successfully. (Should you encounter any issues, please refer to the `Troubleshooting` section.)
9-
3. Select the branch corresponding to the Odoo version you wish to develop for and initiate a Codespace. (First boot takes about 2 mins.)
9+
3. Select the branch corresponding to the Odoo version you wish to develop for and initiate a Codespace. (The first boot takes about 2 minutes, be patient)
1010
NOTE: If your work involves the Enterprise Edition, please adhere to the instructions in `Create/Update an Enterprise based image`.
1111
4. Within the new VS Code instance, select the `Ports` tab. Then, right-click on port `8069` and choose `Open in Browser`. It will launch your new Odoo instance in your web browser.
1212

@@ -15,39 +15,39 @@ You can spin up a development-ready environment in just 4 simple steps:
1515
- Your custom addons must be located in the `/custom` directory of the repository. However, within the Codespaces VS Code editor, this directory will serve as your root folder. See `estate-demo-addon`.
1616
- The build action is triggered by any change to the `.devcontainer/URL.conf` file. However, if you already have the latest Community URL in place and simply need a new build based on the most recent `latest_all.deb` package, you can go to GitHub Actions and trigger the action manually.
1717
- After forking this repository, update the GitHub Actions Badge URL at the top of the `README.md` file to reflect your own build processes. Otherwise, it will always display `no status`.
18-
- Images are tagged not only with `latest` but also with the version number of the downloaded Debian Odoo installer package. This approach allows you to spin up a Codespace with a previous build version in case the latest Odoo version has a serious bug. Simply select an image, for example, `odoo-v17-community`, and look for available tags like `17.0.20240202` in your Container Registry. Then, adjust the tag in `docker-compose.yml` accordingly.
18+
- Images are tagged not only with `latest` but also with the version number of the downloaded Debian Odoo installer package. This approach allows you to spin up a Codespace with a previous build version in case the latest Odoo version has a serious bug. Simply select an image, for example, `odoo-v18-community`, and look for available tags like `18.0.20240202` in your Container Registry. Then, adjust the tag in `docker-compose.yml` accordingly.
1919

2020
## How to create/update the development Docker image?
2121

2222
### Create/Update a Community based image
2323

2424
1. Update the current URL in `.devcontainer/URL.conf` to the latest Community version:
25-
<https://nightly.odoo.com/17.0/nightly/deb/odoo_17.0.latest_all.deb>
25+
<https://nightly.odoo.com/18.0/nightly/deb/odoo_18.0.latest_all.deb>
2626
Alternatively, select a specific build date from the following link and insert its corresponding URL into the file:
27-
<https://nightly.odoo.com/17.0/nightly/deb>
28-
2. If required, update the image name/tag in the `docker-compose.yml` file accordingly, for example `odoo-v17-community:latest`.
27+
<https://nightly.odoo.com/18.0/nightly/deb>
28+
2. If required, update the image name/tag in the `docker-compose.yml` file accordingly, for example `odoo-v18-community:latest`.
2929
3. Commit and push your changes. This will automatically trigger a new build for the Docker image in GitHub Actions.
3030
4. Look for any errors in the build process. If it's green, then we are fine, you can open a Codespace.
3131

3232
### Create/Update an Enterprise based image
3333

3434
1. Obtain the download link for the latest Odoo Enterprise Debian installation package:
3535
<https://www.odoo.com/page/download>
36-
After providing your Odoo Enterprise subscription code, a new page will appear.
36+
After filling the form, click on Download (Ubuntu/Debian) and a "Congratulations! The download is starting" page will appear.
3737
Right-click on `Click here` and select `Copy link` from your browser's dropdown menu.
3838
This will give you a temporary download link, valid for approximately 30 minutes.
3939
2. Replace the URL in `.devcontainer/URL.conf` with the new one you have copied to the clipboard.
40-
3. If required, update the image name/tag in the `docker-compose.yml` file accordingly, for example `odoo-v17-enterprise:latest`.
40+
3. If required, update the image name/tag in the `docker-compose.yml` file accordingly, for example `odoo-v18-enterprise:latest`.
4141
4. Commit and push your changes. This will automatically trigger a new build for the Docker image in GitHub Actions.
4242
5. Look for any errors in the build process. If it's green, then we are fine, you can open a Codespace.
4343

4444
## In case of a new Odoo main release
4545

46-
1. The default branch should always contain the latest version. Therefore, create a new branch named after the latest version (e.g., `v18`) before making any changes.
46+
1. The default branch should always contain the latest version. Therefore, create a new branch named after the latest version (e.g., `v19`) before making any changes.
4747
2. Update the `Dockerfile` to reflect the current version from the official repository: <https://github.com/odoo/docker>
4848
3. Attempt to build it and check for any errors.
4949
4. Change the image tag in `docker-compose.yml` if necessary.
50-
5. Update demo addon version number
50+
5. Update demo addon version number in manifest.py
5151
6. Update README.md
5252

5353
## Possible improvements
@@ -65,11 +65,11 @@ You can create a pre-built Codespace template to speed up the initial boot proce
6565
## Troubleshooting
6666

6767
- Forking the repository initiates a build process for all available Odoo versions simultaneously. Due to these parallel builds, the GitHub Container Registry might face permission limitations. If this occurs, wait until all builds are complete. Then, identify any failed build and select `Re-run failed job`.
68-
- If you're forking or using this repository as a template more than once, you may encounter a permission issue during the docker image push process. This typically happens because an image with the same name (e.g. `odoo-v17-community`) already exists in your Container Registry, created by a different repository, which means the new repository lacks rights to update the image.
69-
`Error: buildx failed with: ERROR: failed to solve: failed to push ghcr.io/YOURNAME/odoo-v17-community:17.0.20240202: unexpected status from POST request to https://ghcr.io/v2/YOURNAME/odoo-v17-community/blobs/uploads/: 403 Forbidden`
68+
- If you're forking or using this repository as a template more than once, you may encounter a permission issue during the docker image push process. This typically happens because an image with the same name (e.g. `odoo-v18-community`) already exists in your Container Registry, created by a different repository, which means the new repository lacks rights to update the image.
69+
`Error: buildx failed with: ERROR: failed to solve: failed to push ghcr.io/YOURNAME/odoo-v18-community:18.0.20240202: unexpected status from POST request to https://ghcr.io/v2/YOURNAME/odoo-v18-community/blobs/uploads/: 403 Forbidden`
7070
To resolve this issue:
7171
- Navigate to `Packages` and remove the search filter to display all available images in your Container Registry.
72-
- Select `odoo-v17-community`, proceed to `Package settings`, and under `Manage Actions access`, add your current repository with write access.
72+
- Select `odoo-v18-community`, proceed to `Package settings`, and under `Manage Actions access`, add your current repository with write access.
7373
- Afterwards, re-run the failed job.
7474

7575
## More info and credits

custom/estate-demo-addon/__manifest__.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
"depends": [
44
"base",
55
],
6-
"version": "17.0.0.1",
6+
"version": "18.0.0.1",
77
"application": "True",
88
"category": "Sales",
99
"description": "Manage real estate offerings",

custom/estate-demo-addon/models/estate_property.py

+13-12
Original file line numberDiff line numberDiff line change
@@ -6,22 +6,23 @@ class EstateProperty(models.Model):
66
_description = "Real Estate Property details"
77

88
name = fields.Char('Name', required=True)
9-
description = fields.Text()
10-
postcode = fields.Char()
11-
date_availability = fields.Date(default=fields.Date.today() + relativedelta(months=3), copy=False)
12-
expected_price = fields.Float(required=True)
13-
selling_price = fields.Float(readonly=True, copy=False)
14-
bedrooms = fields.Integer(default=2)
15-
living_area = fields.Integer()
16-
facades = fields.Integer()
17-
garage = fields.Boolean()
18-
garden = fields.Boolean()
19-
garden_area = fields.Integer()
9+
description = fields.Text('Description')
10+
postcode = fields.Char('Postcode')
11+
date_availability = fields.Date('Available From', default=fields.Date.today() + relativedelta(months=3), copy=False)
12+
expected_price = fields.Float('Expected Price', required=True)
13+
selling_price = fields.Float('Selling Price', readonly=True, copy=False)
14+
bedrooms = fields.Integer('Bedrooms', default=2)
15+
living_area = fields.Integer('Living Area (m²)')
16+
facades = fields.Integer('Facades')
17+
garage = fields.Boolean('Garage')
18+
garden = fields.Boolean('Garden')
19+
garden_area = fields.Integer('Garden Area (m²)')
2020
garden_orientation = fields.Selection(
21-
string='Orientation',
21+
string='Garden Orientation',
2222
selection=[('north', 'North'),('south', 'South'),('east', 'East'),('west', 'West')])
2323
state = fields.Selection(
2424
string='Status',
2525
selection=[('new', 'New'), ('offer_received', 'Offer Received'), ('offer_accepted', 'Offer Accepted'), ('sold', 'Sold'), ('canceled', 'Canceled')],
2626
default='new')
2727
active = fields.Boolean(default=True)
28+

custom/estate-demo-addon/views/estate_property_views.xml

+79-1
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,84 @@
33
<record id="properties_model_action" model="ir.actions.act_window">
44
<field name="name">Properties</field>
55
<field name="res_model">estate.property</field>
6-
<field name="view_mode">tree,form</field>
6+
<field name="view_mode">list,form</field>
77
</record>
8+
9+
<record id="property_view_list" model="ir.ui.view">
10+
<field name="name">estate.property.list</field>
11+
<field name="model">estate.property</field>
12+
<field name="arch" type="xml">
13+
<list string="Properties">
14+
<field name="name"/>
15+
<field name="postcode"/>
16+
<field name="bedrooms"/>
17+
<field name="living_area"/>
18+
<field name="expected_price"/>
19+
<field name="selling_price"/>
20+
<field name="date_availability"/>
21+
</list>
22+
</field>
23+
</record>
24+
25+
<record id="property_view_form" model="ir.ui.view">
26+
<field name="name">estate.property.form</field>
27+
<field name="model">estate.property</field>
28+
<field name="arch" type="xml">
29+
<form string="Property">
30+
<sheet>
31+
<div class="oe_title">
32+
<h1 class="mb32">
33+
<field name="name" placeholder="Expensive" class="mb16"/>
34+
</h1>
35+
</div>
36+
<group>
37+
<group>
38+
<field name="postcode"/>
39+
<field name="date_availability"/>
40+
</group>
41+
<group>
42+
<field name="expected_price"/>
43+
<field name="selling_price"/>
44+
</group>
45+
</group>
46+
<notebook>
47+
<page string="Description">
48+
<group>
49+
<group>
50+
<field name="description"/>
51+
<field name="bedrooms"/>
52+
<field name="living_area"/>
53+
<field name="facades"/>
54+
<field name="garage"/>
55+
<field name="garden"/>
56+
<field name="garden_area"/>
57+
<field name="garden_orientation"/>
58+
</group>
59+
</group>
60+
</page>
61+
</notebook>
62+
</sheet>
63+
</form>
64+
</field>
65+
</record>
66+
67+
<record id="property_view_search" model="ir.ui.view">
68+
<field name="name">estate.property.search</field>
69+
<field name="model">estate.property</field>
70+
<field name="arch" type="xml">
71+
<search string="Properties">
72+
<field name="name"/>
73+
<field name="postcode"/>
74+
<field name="expected_price"/>
75+
<field name="bedrooms"/>
76+
<field name="living_area"/>
77+
<field name="facades"/>
78+
<filter string="Available" name="available" domain="['|',('state','=','new'), ('state', '=', 'offer_received')]" help="Properties available for sale"/>
79+
<group expand="1" string="Group By">
80+
<filter string="Postcode" name="postcode" context="{'group_by':'postcode'}"/>
81+
</group>
82+
</search>
83+
</field>
84+
</record>
85+
886
</odoo>

0 commit comments

Comments
 (0)