Skip to content

Commit

Permalink
temp rebasing PR 776 (dd0f1c7)
Browse files Browse the repository at this point in the history
  • Loading branch information
roboadhoc committed Jan 31, 2024
2 parents c205d80 + dd0f1c7 commit eeb3662
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions sale_exception_credit_limit/models/res_partner.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,9 +22,11 @@ def _compute_user_credit_config(self):

@api.constrains('credit_limit', 'use_partner_credit_limit')
def check_credit_limit_group(self):
"""Si esta constraint trae dolores de cabeza la podemos sacar ya que este "bache" de seguridad esta en muchos lugares
aún mas criticos. es un problema del ORM donde mucho se protege a nivel vista"""
if not self.env.user.has_group('sale_exception_credit_limit.credit_config'):
"""Si esta constraint trae dolores de cabeza la podemos sacar ya que este "bache" de seguridad esta en muchos
lugares aún mas criticos. es un problema del ORM donde mucho se protege a nivel vista"""
if not self.env.user.has_group('sale_exception_credit_limit.credit_config') and any(
not x.parent_id or x.credit_limit != x.parent_id.credit_limit for x in self
):
raise ValidationError('People without Credit limit Configuration Rights cannot modify credit limit parameters')

@api.depends_context('company')
Expand Down Expand Up @@ -86,4 +88,3 @@ def _compute_credit_with_confirmed_orders(self):


self.credit_with_confirmed_orders = to_invoice_amount + draft_invoice_lines_amount + self.credit

0 comments on commit eeb3662

Please sign in to comment.