[FIX] sale, account_payment: fix saleman payment transactions access error
Since odoo/odoo@2b1e2abda3 user need at least 'Account / Billing' access to read payment.transaction, that not the case for most salesman. So for user that don't have 'Account / Billing', this commit do: - compute the 'amount_paid' as superuser (fixing "Generate Payment Link" wizard access errors) - hide "Payment Transaction" smart-button on invoice closes odoo/odoo#127835 X-original-commit: ad2c3a873a926ac8c94d014af24ed400b493493e Signed-off-by: Victor Feyens (vfe) <vfe@odoo.com> Signed-off-by: Xavier Alt (xal) <xal@odoo.com>
This commit is contained in:
@@ -27,6 +27,7 @@
|
||||
<xpath expr="//div[@name='button_box']" position="inside">
|
||||
<field name="transaction_ids" invisible="1" />
|
||||
<button name="action_view_payment_transactions" type="object"
|
||||
groups="account.group_account_invoice"
|
||||
class="oe_stat_button" icon="fa-money"
|
||||
attrs="{'invisible': [('transaction_ids', '=', [])]}">
|
||||
<div class="o_stat_info">
|
||||
|
||||
@@ -238,7 +238,7 @@ class SaleOrder(models.Model):
|
||||
compute='_compute_authorized_transaction_ids',
|
||||
copy=False,
|
||||
compute_sudo=True)
|
||||
amount_paid = fields.Float(compute='_compute_amount_paid')
|
||||
amount_paid = fields.Float(compute='_compute_amount_paid', compute_sudo=True)
|
||||
|
||||
# UTMs - enforcing the fact that we want to 'set null' when relation is unlinked
|
||||
campaign_id = fields.Many2one(ondelete='set null')
|
||||
|
||||
Reference in New Issue
Block a user