Browse Source

[IMP] name_get()

16.0
RemiFr82 7 months ago
parent
commit
94dcb3c19f
  1. 32
      ffck_commons/models/res_partner.py

32
ffck_commons/models/res_partner.py

@ -83,24 +83,22 @@ class ResPartner(models.Model):
def name_get(self):
result = []
# ffck_partners = self.filtered('ffck_network')
# others = self - ffck_partners
for record in self:
if record.ffck_network:
code = record.partner_code
ref = record.ref
result.append(
(
record.id,
"{}{}{}".format(
code and code + " - " or "",
ref and record.is_company and ref + " - " or "",
super(ResPartner, record).name_get()[0][1],
),
)
ffck_partners = self.filtered("ffck_network")
others = self - ffck_partners
for record in ffck_partners:
code = record.partner_code
ref = record.ref
result.append(
(
record.id,
"{}{}{}".format(
code and code + " - " or "",
ref and record.is_company and ref + " - " or "",
super(ResPartner, record).name_get()[0][1],
),
)
else:
result += super(ResPartner, record).name_get()
)
result += super(ResPartner, others).name_get()
return result
# COMPUTES

Loading…
Cancel
Save