Skip to content

Commit

Permalink
Merge PR #50 into 15.0
Browse files Browse the repository at this point in the history
Signed-off-by LoisRForgeFlow
  • Loading branch information
OCA-git-bot committed Aug 26, 2024
2 parents 991ede9 + be0e77d commit 3fc264e
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 2 deletions.
5 changes: 5 additions & 0 deletions repair_stock_move/models/repair_order.py
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,11 @@ class RepairOrder(models.Model):

@api.depends("state")
def _compute_show_check_availability(self):
group_stock_user = self.env.ref("stock.group_stock_user")
if group_stock_user not in self.env.user.groups_id:
for rec in self:
rec.show_check_availability = False
return
for rec in self:
rec.show_check_availability = (
any(
Expand Down
5 changes: 3 additions & 2 deletions repair_stock_move/views/repair_order_views.xml
Original file line number Diff line number Diff line change
Expand Up @@ -13,14 +13,14 @@
string="Check Availability"
type="object"
class="oe_highlight"
groups="base.group_user"
groups="stock.group_stock_user"
/>
<button
name="action_force_availability"
attrs="{'invisible': [('show_check_availability', '=', False)]}"
string="Force Availability"
type="object"
groups="base.group_user"
groups="stock.group_stock_user"
/>
<field name="show_check_availability" invisible="1" />
</header>
Expand All @@ -34,6 +34,7 @@
class="oe_stat_button"
icon="fa-exchange"
attrs="{'invisible': [('move_id', '=', False)]}"
groups="stock.group_stock_user"
>
<div class="o_field_widget o_stat_info">
<span class="o_stat_text">Stock Moves</span>
Expand Down

0 comments on commit 3fc264e

Please sign in to comment.