Skip to content
Snippets Groups Projects

FIX: subscriptions use vat instead email

1 unresolved thread
2 files
+ 29
1
Compare changes
  • Side-by-side
  • Inline
Files
2
@@ -6,3 +6,14 @@ class ResPartner(models.Model):
gender = fields.Selection(selection_add=[("not_binary", "Not binary"),
("not_share", "I prefer to not share it")])
def get_cooperator_from_vat(self, vat):
if vat:
vat = vat.strip()
# email could be falsy or be only made of whitespace.
if not vat:
return self.browse()
partner = self.search(
[("vat", "ilike", vat)], limit=1
)
return partner
Loading