Billing Entity Management #66

Open
rixx wants to merge 20 commits from 54-billing-entity-management into main
2 changed files with 30 additions and 0 deletions
Showing only changes of commit edafff897e - Show all commits

View file

@ -0,0 +1,23 @@
# Generated by Django 5.2 on 2025-05-26 05:08
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
("core", "0003_alter_organization_namespace"),
]
operations = [
migrations.AddField(
model_name="billingentity",
name="odoo_company_id",
field=models.IntegerField(null=True),
),
migrations.AddField(
model_name="billingentity",
name="odoo_invoice_id",
field=models.IntegerField(null=True),
),
]

View file

@ -110,6 +110,13 @@ class BillingEntity(ServalaModelMixin, models.Model):
max_length=100, blank=True, verbose_name=_("ERP reference")
)
# Odoo IDs are nullable for creation, should never be null in practice
# The company ID points at a record of type res.partner with company_type=company
# The invoice ID points at a record of type res.partner with company_type=person,
# type=invoic, parent_id=company_id (the invoice address).
odoo_company_id = models.IntegerField(null=True)
odoo_invoice_id = models.IntegerField(null=True)
class Meta:
verbose_name = _("Billing entity")
verbose_name_plural = _("Billing entities")