ImprovedHighlight of Weekly #004

POS hooks for the Belgian blackbox v2

Several POS store methods, such as openCashbox and resetCashier, are now overridable hooks so the v2 blackbox module can extend them. Custom POS patches of these flows should be checked.

Versions20.0
ModulesPoint of Sale point_of_sale
AppPoint of Sale

Pull requests and commits

BranchPull requestCommit
20.0odoo/odoo#289857 ↗ca08cc5350 ↗

Commit message

[IMP] point_of_sale: add support for Belgian blackbox v2

Refactor several POS core methods into overridable hooks so that
l10n_be_pos_blackbox (v2) can intercept and extend critical flows
to implement the new blackbox requirements.

point_of_sale:
- pos_store.js: extract posBackOnline(), openCashbox(),
  getSelfOrderToPrint(), and resetCashier() as dedicated methods;
  setCashier() now returns a boolean; preSyncAllOrders() now returns
  the orders array, and the sync loop skips an order when it returns
  falsy (allows blackbox to block premature syncing); add
  orderReceiptComponent class property so the receipt component can
  be substituted by submodules.
- order_payment_validation.js: extract canPrintReceipt getter (makes
  it overridable); fix absolute import path for error_handlers; fix
  typo "occured" → "occurred".
- pos_session.py: load product.template / product.product before
  account.tax in _load_pos_data_models to satisfy the blackbox data
  dependency order; include account_move id in the invoice list
  returned by the session sales-details report.

pos_hr:
- Split setCashier() into setCashier() + setCashierUpdateSession()
  so the session-update side-effect can be called independently by
  the blackbox during clock-in/out flows. Return true from
  setCashier() consistently with the base method.

pos_loyalty:
- Override displayPrice on order lines so gift-card trigger products
  always display a positive price, even when the order is a refund.

pos_restaurant:
- Refactor mergeOrders() into _mergeOrders() + _mergeLines() private
  helpers; add getLinesToMerge() hook so blackbox can filter which
  lines participate in a merge; mergeOrders() now returns the
  destination order; extract syncRestoredOrders() for overridability;
  replace the while-loop-with-guard-counter with a plain for-of loop.

pos_self_order:
- Add orderReceiptComponent property; extract
  handleKioskSessionStatusChange() so the kiosk status-change
  behaviour can be overridden by the blackbox self-order bridge.


Task-id: 5864870
Related: odoo/enterprise#132545

My stack

Pick the versions and apps you run. Weekly digests, this week's table and All changes then show only what concerns you. Saved in this browser.

Versions
Apps
Modules