Skip to main content

Documentation Index

Fetch the complete documentation index at: https://docs.laportenard.com/llms.txt

Use this file to discover all available pages before exploring further.

Module structure

The backend is a single consolidated Odoo 12 addon:
ModuleDepends onPurpose
nu_restaurant_pospoint_of_sale, pos_restaurant, dgii_pos, dgii_encfCore POS API, models, voids, side dishes, discounts, printing, presentations, special requests

API gateway

All endpoints live under /pos-api/v1/* in controllers/api_v1.py. The gateway handles:
  • JWT Bearer token validation
  • CORS headers
  • Request routing to legacy controller methods
The legacy controller methods in api.py, api_orders.py, etc. have no routes of their own — they are called by api_v1.py.

Extending bootstrap data

To add data to the bootstrap payload, extend the pos.config model:
class PosConfig(models.Model):
    _inherit = 'pos.config'

    def _get_bootstrap_extra(self, user):
        result = super()._get_bootstrap_extra(user)
        result['my_new_data'] = self._get_my_data()
        return result
Do not try to use controller inheritance — it does not work reliably in Odoo 12 for internal methods. Use model inheritance (_inherit) instead.

Upgrading modules

./odoo-bin -d <db> -u nu_restaurant_pos \
  --addons-path=addons,extra_addons --stop-after-init

Migrations

Version-specific migration scripts go in migrations/<version>/pre-migrate.py or post-migrate.py. The <version> must match the new version in __manifest__.py.

Permissions

The permission system has three layers resolved in order:
  1. Factory defaultspermission_registry.py PERMISSION_DEFAULTS
  2. Per-config role overridesnu.pos.permission.config model
  3. Per-user grant/denynu.pos.permission.user.override model
Permission models should be writable only by base.group_system (admin). Managers should not be able to self-grant privileges.

Adding a new permission

  1. Add the key and default to PERMISSION_DEFAULTS in permission_registry.py
  2. Mirror the same key and default in permissions.ts on the frontend
  3. Both files must stay in sync