Skip to content

Commit

Permalink
[MIG] pos_access_right: Migration to 16.0 - Add group access right in…
Browse files Browse the repository at this point in the history
… Cash In/Out Button only for Accounting/Manager.
  • Loading branch information
jumeldi74 committed Jun 16, 2023
1 parent 54f407d commit 9d8dddc
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 3 deletions.
2 changes: 1 addition & 1 deletion pos_access_right/models/pos_config.py
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ class PosConfig(models.Model):
compute="_compute_groups",
string="Point of Sale - Cash In/Out",
help="This field is to enable Cash In/Out Button only for Accounting/Pos Manager"
" Group to the Point of Sale Frontend.",
" Group to the Point of Sale Frontend.",
)

def _compute_groups(self):
Expand Down
2 changes: 1 addition & 1 deletion pos_access_right/static/src/js/CashMoveButton.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ odoo.define("pos_access_right.CashMoveButton", function (require) {

const PosCashMoveButton = (CashMoveButton) =>
class extends CashMoveButton {
async onClick() {
async onClick() {
if (this.env.pos.config.module_pos_hr) {
if (this.env.pos.get_cashier().hasGroupCashinoutAction) {
return super.onClick();
Expand Down
4 changes: 3 additions & 1 deletion pos_access_right/tests/test_pos_access_right.py
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,9 @@ def test_access_pos(self):
self.group_refund_action, self.pos_config_main.group_refund_action
)

self.group_cashinout_action = self.env.ref("pos_access_right.group_cashinout_action")
self.group_cashinout_action = self.env.ref(
"pos_access_right.group_cashinout_action"
)
self.assertEqual(
self.group_cashinout_action, self.pos_config_main.group_cashinout_action
)

0 comments on commit 9d8dddc

Please sign in to comment.