[16.0] [ADD] pos_receipt_replace_user_by_trigram
replace cashier's name by his trigram (first letter of firstname + first 2 letters of lastname) on POS receipt
Thank you so much @legalsylvain @simahawk @ivantodorovich for your in-depth reviews
I updated the PR to take into account your inputs, including utils.py and some test cases for the function
Hi @ivantodorovich, I pushed a new commit to support feature multi-employee-per-session.
Context
-
When the feature is checked,
get_cashieris overridden byset_cashierinpos_hr- As consequences,
pos_trigramis null
- As consequences,
This change
pos_receipt_replace_user_by_triagram
-
pos_trigramis defined inres.partnerinstead of res.users.res.usersinheritsres.partner- can link
res.partnerandhr.employeevia related fieldwork_contact_id
pos_receipt_replace_user_by_triagram_hr
- It is a glue module between
pos_receipt_replace_user_by_triagram&pos_hr - I take advantage of the module to pass the field
pos_trigraminto_loader_params_hr_employee, so it can be accessed on model Pos Order
superseded by https://github.com/OCA/pos/pull/1167