[FIX] sale: restriction on partner credit warning

In Settings>Accounting set 'Sales Credit Limit' to 10,000
Create a user with sales access but no accounting rights
Login with the sale user, create a quotation, set a partner
already exceeding the limit

No warning shows up.
This occurs because the field is restricted to users having account
access

opw-3202384

closes odoo/odoo#114685

X-original-commit: 317977e97d93f572697585d006b5bca5c7365428
Signed-off-by: John Laterre (jol) <jol@odoo.com>
This commit is contained in:
Andrea Grazioso (agr-odoo)
2023-03-08 17:33:45 +01:00
parent 1e2ab5e85c
commit 5efbdb0652
2 changed files with 2 additions and 3 deletions
+1 -2
View File
@@ -272,8 +272,7 @@ class SaleOrder(models.Model):
help="Delivery date you can promise to the customer, computed from the minimum lead time of the order lines.")
is_expired = fields.Boolean(string="Is Expired", compute='_compute_is_expired')
partner_credit_warning = fields.Text(
compute='_compute_partner_credit_warning',
groups='account.group_account_invoice,account.group_account_readonly')
compute='_compute_partner_credit_warning')
tax_calculation_rounding_method = fields.Selection(
related='company_id.tax_calculation_rounding_method',
depends=['company_id'])
+1 -1
View File
@@ -219,7 +219,7 @@
<button name="action_draft" states="cancel" type="object" string="Set to Quotation" data-hotkey="w"/>
<field name="state" widget="statusbar" statusbar_visible="draft,sent,sale"/>
</header>
<div groups="account.group_account_invoice,account.group_account_readonly"
<div
class="alert alert-warning mb-0" role="alert"
attrs="{'invisible': [('partner_credit_warning', '=', '')]}">
<field name="partner_credit_warning"/>