Skip to content

[18.0][MIG] pos_access_right: Migration to 18.0#4

Open
P-H-Phuc wants to merge 16 commits into18.0from
18.0-mig-pos_access_right
Open

[18.0][MIG] pos_access_right: Migration to 18.0#4
P-H-Phuc wants to merge 16 commits into18.0from
18.0-mig-pos_access_right

Conversation

@P-H-Phuc
Copy link
Owner

This module extends Odoo Point Of Sale features, restricting possibility to cashier to make some actions in the Point of Sale. This module will add the following groups to Odoo:

  • PoS - Negative Quantity: The cashier can sell negative quantity in
    Point Of Sale (ie, can return products);
  • PoS - Discount: The cashier can set Discount in Point Of Sale;
  • PoS - Change Unit Price: The cashier can change the unit price of
    a product in Point Of Sale;
  • PoS - Many Orders: The cashier can many orders at the same time;
  • PoS - Delete Order: The cashier can not delete a full order;

@P-H-Phuc P-H-Phuc force-pushed the 18.0-mig-pos_access_right branch from 19b349b to 1a24d6e Compare July 14, 2025 03:28
@anothingguy
Copy link

1, can you squash Translation commits in history
2, let activate github CI tests on your forked report
3. You're changing behavior from old version to new version like:

  • compute readonly access group -> default editable group
  • disable button -> raising warning instead of disable.
    I'm not sure what's the reasons for theses changes.

@P-H-Phuc P-H-Phuc closed this Jul 16, 2025
@P-H-Phuc P-H-Phuc reopened this Jul 16, 2025
Comment on lines 23 to 34
getNumpadButtons() {
const buttons = super.getNumpadButtons();
buttons.forEach((button) => {
if (button.value === 'discount') {
button.disabled = !this.hasManualDiscount;
} else if (button.value === 'price') {
button.disabled = !this.hasPriceControlRights;
} else if (button.value === '-') {
button.disabled = !this.hasMinusControlRights;
}
});
return buttons;
Copy link
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In this, I disabled numpad buttons instead of doing it in the XML file. Reference PR#132245

@P-H-Phuc P-H-Phuc force-pushed the 18.0-mig-pos_access_right branch from 1a24d6e to 27c1e7a Compare July 16, 2025 04:20
@P-H-Phuc
Copy link
Owner Author

'compute readonly access group -> default editable group'
I think an editable group is more flexible, but I kept it the same as before.

legalsylvain and others added 15 commits July 16, 2025 11:25
[REF] improve description;

[ADD] fr translation;

[ADD] new blockage;

[ADD] fr translation;
[IMP] description;

[FIX]

[FIX] display;

[FIX] remove useless feature;[FIX] bug on multi order check

[REF] rename fields

[FIX] add missing author

[REF] improve fr translation

OCA Transbot updated translations from Transifex

[UPD] Update pos_access_right.pot
[DOC] update README

[FIX] fix variable name

[REF] the pos.config model load all fields

[DOC] update website link

[LINT] fix lint errors

[LINT] fix lint errors

[UPD] README.rst

[UPD] Update pos_access_right.pot
Updated by Update PO files to match POT (msgmerge) hook in Weblate.

Added translation using Weblate (Russian)
Currently translated at 50.0% (10 of 20 strings)

Translation: pos-12.0/pos-12.0-pos_access_right
Translate-URL: https://translation.odoo-community.org/projects/pos-12-0/pos-12-0-pos_access_right/ru/
[UPD] Update pos_access_right.pot

[FIX] eslint

[UPD] Update pos_access_right.pot
Updated by "Update PO files to match POT (msgmerge)" hook in Weblate.

Translation: pos-12.0/pos-12.0-pos_access_right
Translate-URL: https://translation.odoo-community.org/projects/pos-12-0/pos-12-0-pos_access_right/

[UPD] README.rst
[IMP] : black, isort, prettier
[UPD] Update pos_access_right.pot

[UPD] README.rst

pos_access_right 14.0.1.0.1

Translated using Weblate (French)

Currently translated at 100.0% (23 of 23 strings)

Translation: pos-14.0/pos-14.0-pos_access_right
Translate-URL: https://translation.odoo-community.org/projects/pos-14-0/pos-14-0-pos_access_right/fr/

Translated using Weblate (Catalan)

Currently translated at 100.0% (23 of 23 strings)

Translation: pos-14.0/pos-14.0-pos_access_right
Translate-URL: https://translation.odoo-community.org/projects/pos-14-0/pos-14-0-pos_access_right/ca/

[FIX] pos_access_right : remove bad css that impact all PoS
Translated using Weblate (Italian)

Currently translated at 100.0% (25 of 25 strings)

Translation: pos-14.0/pos-14.0-pos_access_right
Translate-URL: https://translation.odoo-community.org/projects/pos-14-0/pos-14-0-pos_access_right/it/
[UPD] Update pos_access_right.pot

[BOT] post-merge updates
Updated by "Update PO files to match POT (msgmerge)" hook in Weblate.

Translation: pos-16.0/pos-16.0-pos_access_right
Translate-URL: https://translation.odoo-community.org/projects/pos-16-0/pos-16-0-pos_access_right/

Translated using Weblate (Spanish)

Currently translated at 100.0% (17 of 17 strings)

Translation: pos-16.0/pos-16.0-pos_access_right
Translate-URL: https://translation.odoo-community.org/projects/pos-16-0/pos-16-0-pos_access_right/es/

Translated using Weblate (Italian)

Currently translated at 100.0% (17 of 17 strings)

Translation: pos-16.0/pos-16.0-pos_access_right
Translate-URL: https://translation.odoo-community.org/projects/pos-16-0/pos-16-0-pos_access_right/it/

[FIX] eslint error 'no-shadow' in all modules

[BOT] post-merge updates

[FIX]pos_access_right: change deleteOrder to _onDeleteOrder

[BOT] post-merge updates
@P-H-Phuc P-H-Phuc force-pushed the 18.0-mig-pos_access_right branch 3 times, most recently from 6c00045 to d63fc8f Compare July 16, 2025 04:38
@P-H-Phuc P-H-Phuc marked this pull request as draft July 16, 2025 10:55
@P-H-Phuc P-H-Phuc marked this pull request as ready for review January 27, 2026 08:55
config.group_delete_order_id = self.env.ref(
"pos_access_right.group_delete_order"
).id
config.group_payment_id = self.env.ref("pos_access_right.group_payment").id

This comment was marked as resolved.

res = super()._load_pos_data(data)
config = data["pos.config"]["data"][0]

user = self.search([("id", "=", self.env.uid)], limit=1)

This comment was marked as resolved.

Copy link
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In Odoo Native, user is get by domain self._load_pos_data_domain(), I updated to use this method

t-name="ActionpadWidget"
t-inherit="point_of_sale.ActionpadWidget"
t-inherit-mode="extension"
owl="1"

This comment was marked as resolved.

} else if (button.value === "price") {
button.disabled = !this.hasPriceControlRights;
} else if (button.value === "-") {
button.disabled = !this.hasMinusControlRights;

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You disabled the numpad, i could still set negative qty by pressing the minus key from my keyboard. Please check if version 12.0 faced the same problem or not. if yes, you could keep as it's.

Image

Copy link
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In v12.0, it also dont use the minus key when pressed, I updated to disable this key. But what about the return/refund case?

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't know that we have short keys for return and refund! what key are they?

Copy link
Owner Author

@P-H-Phuc P-H-Phuc Jan 28, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I mean, in refund progress but user not allow minus control, so they cannot input quantity to refund

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No problem, when inputting negative qty, the cashier want to refund.
So, it's the same matter.
keep your adjustment as now.

},
async pay() {
if (!this.user.raw.hasGroupPayment) {
this.dialog.add(AlertDialog, {

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I cannot test this popup. when i has no payment right, the pay button is disabled. So, i cannot make the payment.

Copy link
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

For trick cases, you can open Inspect (F12) and go to button element, remove disable atrribute

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

no, it's not what i mean. if there's no way i can test it, you could clean it.

},
async onDoRefund() {
if (!this.hasPaymentControlRights) {
this.dialog.add(AlertDialog, {

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I cannot test this popup. when i has no payment right, the refund button is disabled. So, i cannot refund the order.

Copy link
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

For trick cases, you can open Inspect (F12) and go to button element, remove disable atrribute

patch(PosStore.prototype, {
async onDeleteOrder(order) {
if (!this.user.raw.hasGroupDeleteOrder) {
this.dialog.add(AlertDialog, {

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I cannot test this popup. when i has no Delete right, the button is invisibled. So, i cannot delete the order.

Copy link
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

For trick cases, you can open Inspect (F12) and go to button element, remove disable atrribute

hasGroupDiscount=config["group_discount_id"] in user_groups,
hasGroupNegativeQty=config["group_negative_qty_id"] in user_groups,
hasGroupPriceControl=config["group_change_unit_price_id"] in user_groups,
hasGroupMultiOrder=config["group_multi_order_id"] in user_groups,

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No usage of the hasGroupMultiOrder

Copy link
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Removed this group. Cashier can open multi order screen

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Keep it please. Disable this button instead
image

Copy link
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hide button add new order

@P-H-Phuc P-H-Phuc force-pushed the 18.0-mig-pos_access_right branch from d63fc8f to b738347 Compare January 28, 2026 07:52
Copy link

@nguyenminhchien nguyenminhchien left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

  • Clean the useless code checks.
  • Disable the "Plus" button if has no Multi Order group.

) {
this.dialog.add(AlertDialog, {
title: _t("Not Allowed"),
body: _t("You do not have permission to set negative quantity."),

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Add French translation for them please

@P-H-Phuc P-H-Phuc force-pushed the 18.0-mig-pos_access_right branch 3 times, most recently from de1c4da to b04cb0c Compare January 28, 2026 10:49
@P-H-Phuc P-H-Phuc force-pushed the 18.0-mig-pos_access_right branch 2 times, most recently from 4fe709d to e37948c Compare January 29, 2026 03:59
@P-H-Phuc P-H-Phuc force-pushed the 18.0-mig-pos_access_right branch from e37948c to ddc6f9b Compare January 29, 2026 04:13
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.