<commit_before>from odoo import models, fields, _

class UpdatePartnerRisk(models.TransientModel):
    _name = 'update.partner.risk'

    partner_ids = fields.Many2many('res.partner', string="Partners to update risk",
                                   required=True)
    new_risk = fields.Float(help="If this field is 0, the payment mode will be bank transfer and payment term will be prepaid")

    def action_update_risk(self):
        partners_without_team = []
        for partner in self.partner_ids:
            partner.credit_limit = self.new_risk
            partner.insurance_credit_limit = self.new_risk
            if self.new_risk == 0:
                if partner.team_id:
                    prepaid_id = partner.env['account.payment.term'].with_context(lang='en_US').search(
                        [('name', '=', 'Prepaid')])
                    partner.property_payment_term_id = prepaid_id.id
                    if partner.team_id.name == 'Portugal':<commit_msg>[FIX] custom_financial_risk: filtrado el dominio de los clientes y cambiado campos a actualizar<commit_after>from odoo import models, fields, _

class UpdatePartnerRisk(models.TransientModel):
    _name = 'update.partner.risk'

    partner_ids = fields.Many2many('res.partner', string="Partners to update risk",
                                   required=True,domain="[('customer','=',1), ('parent_id', '=', False)]" )
    new_risk = fields.Float(help="If this field is 0, the payment mode will be bank transfer and payment term will be prepaid")

    def action_update_risk(self):
        partners_without_team = []
        for partner in self.partner_ids:
            partner.insurance_credit_limit = self.new_risk
            if self.new_risk == 0:
                partner.company_credit_limit = self.new_risk
                if partner.team_id:
                    prepaid_id = partner.env['account.payment.term'].with_context(lang='en_US').search(
                        [('name', '=', 'Prepaid')])
                    partner.property_payment_term_id = prepaid_id.id
                    if partner.team_id.name == 'Portugal':
{'fraction_non_alphanumeric': 0.10312204351939451, 'fraction_numerical': 0.0033112582781456954, 'mean_word_length': 2.4057971014492754, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 2, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '254372', 'n_tokens_mistral': 629, 'n_tokens_neox': 595, 'n_words': 133}