0

I've been developing an odoo for my interest on my server with a Docker and when I try to add an extra-addons app to odoo for testing, it's not showing up.

Here's what I've done:

  1. I've add my extra-addons path into my docker-compose

I create folder on my host (custom-addons) and change owner to odoo(101). I've check the odoo id in my docker container using id whoami when exec odoo container and it's show id 101

version: '3.1'
services:  
  web:    
    image: odoo:17.0    
    depends_on:      
      - db    
    ports:      
      - "8069:8069"
    volumes:
      - /opt/odoo17/custom-addons:/usr/lib/python3/dist-packages/odoo/extra-addons  
      - /opt/odoo17/config/odoo.conf:/etc/odoo/odoo.conf
      - odoo-web-data:/var/lib/odoo
    command: -- --dev=reload 
  db:    
    image: postgres:15    
    environment:      
    - POSTGRES_DB=postgres      
    - POSTGRES_PASSWORD=odoo      
    - POSTGRES_USER=odoo
    volumes:
      - odoo-db-data:/var/lib/postgresql/data

volumes:
  odoo-web-data:
  odoo-db-data:

2.I've Create my demo models in extra-addons for the test

  • __init__.py
from . import models
  • __manifest__py
{
    'name': 'Custom Sales',
    'version': '1.0',
    'category': 'Sales',
    'summary': 'Customize sales module',
    'depends': ['sale'],
    'data': [
        'views/sale_order_views.xml',
    ],
    'installable': True,
    'application': False,
}
  • models(folder)

__init.py__

from . import sale_order

sale_order.py

from odoo import models, fields

class SaleOrder(models.Model):
    _inherit = 'sale.order'

    custom_reference = fields.Char(string='Custom Reference', help='A custom reference for this sale order')
  • views(folder)

sale_order_view.xml

<?xml version="1.0" encoding="utf-8"?>
<odoo>
    <record id="view_order_form_inherit_custom" model="ir.ui.view">
        <field name="name">sale.order.form.inherit.custom</field>
        <field name="model">sale.order</field>
        <field name="inherit_id" ref="sale.view_order_form"/>
        <field name="arch" type="xml">
            <field name="partner_id" position="after">
                <field name="custom_reference"/>
            </field>
        </field>
    </record>
</odoo>

odoo.conf file

[options]
addons_path = /usr/lib/python3/dist-packages/odoo/addons,/usr/lib/python3/dist-packages/odoo/extra-addons
#data_dir = /var/lib/odoo
#admin_passwd = your_admin_password
logfile = /var/log/odoo/odoo-server.log
log_level = info

Check on odoo container (extra-addons folder) in docker. They all have the same stuff in there with owner odoo, and I did restart the docker-compose many times, but when I click **update app list ** in the browser, and search with the name, it's not showing up for just wonder why I've discussed with the gen AI for the solution, and still can't fix can anyone help me out please?

2
  • Are you running the odoo server using that config file? I don't see de use of the config file in your docker-compose Commented Sep 29, 2024 at 6:02
  • Silly me, Every config are fine but the things i've missed is i forgot to create my folder wraps my custom module now i just wrap the models views init manifest with folder name my_custom_sale and now it's now up in app Commented Sep 30, 2024 at 3:09

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.