Correct groups assigned to asset buttons

This commit is contained in:
younes 2025-05-04 10:00:03 +01:00
parent 4219141e1f
commit 9545e76b7e
3 changed files with 15 additions and 15 deletions

View File

@ -23,10 +23,10 @@
<form duplicate="0">
<header>
<button name="act_progress" states="draft" string="Start" type="object" class="oe_highlight"/>
<button name="act_confirm" groups='hr_expense_petty_cash.group_assets_manager' states="in_progress" string="Confirm" type="object"
<button name="act_confirm" groups='exp_asset_base.group_assets_manager' states="in_progress" string="Confirm" type="object"
class="oe_highlight"/>
<button name="act_reject" groups="hr_expense_petty_cash.group_assets_manager" states="in_progress" string="Reject" type="object"/>
<button name="act_draft" groups="hr_expense_petty_cash.group_assets_manager" states="cancel" string="Set to Draft" type="object" class="oe_highlight"/>
<button name="act_reject" groups="exp_asset_base.group_assets_manager" states="in_progress" string="Reject" type="object"/>
<button name="act_draft" groups="exp_asset_base.group_assets_manager" states="cancel" string="Set to Draft" type="object" class="oe_highlight"/>
<field name="state" widget="statusbar" statusbar_visible="draft,in_progress,done"/>
</header>
<sheet>
@ -102,10 +102,10 @@
<form duplicate="0">
<header>
<button name="act_progress" states="draft" string="Start" type="object" class="oe_highlight"/>
<button groups="hr_expense_petty_cash.group_assets_manager" name="act_confirm" states="in_progress" string="Confirm" type="object"
<button groups="exp_asset_base.group_assets_manager" name="act_confirm" states="in_progress" string="Confirm" type="object"
class="oe_highlight"/>
<button groups="hr_expense_petty_cash.group_assets_manager" name="act_reject" states="in_progress" string="Reject" type="object"/>
<button groups="hr_expense_petty_cash.group_assets_manager" name="act_draft" states="cancel" string="Set to Draft" type="object" class="oe_highlight"/>
<button groups="exp_asset_base.group_assets_manager" name="act_reject" states="in_progress" string="Reject" type="object"/>
<button groups="exp_asset_base.group_assets_manager" name="act_draft" states="cancel" string="Set to Draft" type="object" class="oe_highlight"/>
<field name="state" widget="statusbar" statusbar_visible="draft,in_progress,done"/>
</header>
<sheet>
@ -177,10 +177,10 @@
<form duplicate="0">
<header>
<button name="act_progress" states="draft" string="Start" type="object" class="oe_highlight"/>
<button groups="hr_expense_petty_cash.group_assets_manager" name="act_confirm" states="in_progress" string="Confirm" type="object"
<button groups="exp_asset_base.group_assets_manager" name="act_confirm" states="in_progress" string="Confirm" type="object"
class="oe_highlight"/>
<button groups="hr_expense_petty_cash.group_assets_manager" name="act_reject" states="in_progress" string="Reject" type="object"/>
<button groups="hr_expense_petty_cash.group_assets_manager" name="act_draft" states="cancel" string="Set to Draft" type="object" class="oe_highlight"/>
<button groups="exp_asset_base.group_assets_manager" name="act_reject" states="in_progress" string="Reject" type="object"/>
<button groups="exp_asset_base.group_assets_manager" name="act_draft" states="cancel" string="Set to Draft" type="object" class="oe_highlight"/>
<field name="state" widget="statusbar" statusbar_visible="draft,in_progress,done"/>
</header>
<sheet>

View File

@ -61,10 +61,10 @@
<header>
<button name="act_submit" string="Submit" type="object"
class="oe_highlight" states="draft"/>
<button name="act_confirm" groups='hr_expense_petty_cash.group_assets_manager' string="Confirm" states="submit"
<button name="act_confirm" groups='exp_asset_base.group_assets_manager' string="Confirm" states="submit"
type="object" class="oe_highlight"/>
<button name="act_reject" groups="hr_expense_petty_cash.group_assets_manager" string="Reject" type="object" states="draft"/>
<button name="act_draft" groups="hr_expense_petty_cash.group_assets_manager" states="cancel" string="Set to Draft"
<button name="act_reject" groups="exp_asset_base.group_assets_manager" string="Reject" type="object" states="draft"/>
<button name="act_draft" groups="exp_asset_base.group_assets_manager" states="cancel" string="Set to Draft"
type="object" class="oe_highlight"/>
<field name="state" widget="statusbar"/>
</header>

View File

@ -21,10 +21,10 @@ class AccountAssetOperation(models.Model):
for cus in custody:
operation = self.env['account.asset.operation'].search(
[('emp_asset_custody_id', '=', cus.id), ('type', '=', 'assignment')])
print("----------", operation)
print("----------", operation.state)
# print("----------", operation)
# print("----------", operation.state)
if all(ope.state in 'done' for ope in operation):
print("----------", operation.state)
# print("----------", operation.state)
cus.write({'state': 'assign'})
elif self.type == 'release':
self.asset_id.status = 'available'