Skip to content

Commit

Permalink
[ADD] #271 more restrictions
Browse files Browse the repository at this point in the history
  • Loading branch information
hbrunn committed Jul 12, 2023
1 parent dae7b1d commit 171ac04
Show file tree
Hide file tree
Showing 2 changed files with 24 additions and 0 deletions.
7 changes: 7 additions & 0 deletions bankayma_account/models/account_move.py
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,13 @@ def _search_default_journal(self):
return self.env.company.intercompany_sale_journal_id
return super()._search_default_journal()

@api.depends("payment_state")
def _compute_show_reset_to_draft_button(self):
result = super()._compute_show_reset_to_draft_button()
for this in self:
this.show_reset_to_draft_button &= this.payment_state != "paid"
return result

@api.depends(
"line_ids.full_reconcile_id.reconciled_line_ids.move_id.payment_id."
"payment_method_line_id.payment_method_id"
Expand Down
17 changes: 17 additions & 0 deletions bankayma_account/views/menu.xml
Original file line number Diff line number Diff line change
Expand Up @@ -248,4 +248,21 @@
<field name="action" ref="action_bankayma_group_income_move_out_invoice" />
</record>

<record id="account.action_account_invoice_from_list" model="ir.actions.server">
<field
name="groups_id"
eval="[Command.link(ref('account.group_account_manager')), Command.unlink(ref('account.group_account_invoice'))]"
/>
</record>

<record
id="account.action_view_account_move_reversal"
model="ir.actions.act_window"
>
<field
name="groups_id"
eval="[Command.link(ref('account.group_account_manager')), Command.unlink(ref('account.group_account_invoice'))]"
/>
</record>

</odoo>

0 comments on commit 171ac04

Please sign in to comment.