fix error in gitignore
This commit is contained in:
@@ -0,0 +1,30 @@
|
||||
from django.contrib.auth.models import AbstractUser
|
||||
from django.db import models
|
||||
|
||||
from apps.core.models import TimeStampedModel, UUIDModel
|
||||
|
||||
|
||||
class User(AbstractUser, UUIDModel):
|
||||
"""Application user. Identity may be backed by Odoo via `odoo_partner_id`."""
|
||||
|
||||
phone = models.CharField(max_length=32, blank=True)
|
||||
odoo_partner_id = models.CharField(max_length=64, blank=True, db_index=True)
|
||||
|
||||
class Meta:
|
||||
ordering = ["username"]
|
||||
|
||||
def __str__(self) -> str:
|
||||
return self.username or self.email or str(self.id)
|
||||
|
||||
|
||||
class Customer(UUIDModel, TimeStampedModel):
|
||||
"""Customer profile keyed to an external (Odoo) identity where available."""
|
||||
|
||||
user = models.OneToOneField(User, on_delete=models.CASCADE, related_name="customer")
|
||||
customer_code = models.CharField(max_length=64, unique=True, blank=True, null=True)
|
||||
company_name = models.CharField(max_length=200, blank=True)
|
||||
category = models.CharField(max_length=64, blank=True, db_index=True)
|
||||
odoo_partner_id = models.CharField(max_length=64, blank=True, db_index=True)
|
||||
|
||||
def __str__(self) -> str:
|
||||
return self.company_name or str(self.user)
|
||||
Reference in New Issue
Block a user