pos icon indicating copy to clipboard operation
pos copied to clipboard

[16.0] [ADD] pos_receipt_replace_user_by_trigram

Open trisdoan opened this issue 1 year ago • 1 comments

replace cashier's name by his trigram (first letter of firstname + first 2 letters of lastname) on POS receipt

trisdoan avatar Feb 07 '24 07:02 trisdoan

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

trisdoan avatar Feb 15 '24 09:02 trisdoan

Hi @ivantodorovich, I pushed a new commit to support feature multi-employee-per-session.

Screenshot from 2024-03-11 10-36-28

Context

  • When the feature is checked, get_cashier is overridden by set_cashier in pos_hr

    • As consequences, pos_trigram is null

This change

pos_receipt_replace_user_by_triagram

  • pos_trigram is defined in res.partner instead of res.users.

    • res.users inherits res.partner
    • can link res.partner and hr.employee via related field work_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_trigram into _loader_params_hr_employee, so it can be accessed on model Pos Order

trisdoan avatar Mar 11 '24 03:03 trisdoan

superseded by https://github.com/OCA/pos/pull/1167

trisdoan avatar Mar 13 '24 10:03 trisdoan