diff --git a/src/servala/core/admin.py b/src/servala/core/admin.py index 39fbab9..fb64a2b 100644 --- a/src/servala/core/admin.py +++ b/src/servala/core/admin.py @@ -86,13 +86,7 @@ class BillingEntityAdmin(admin.ModelAdmin): @admin.register(OrganizationOrigin) class OrganizationOriginAdmin(admin.ModelAdmin): - list_display = ( - "name", - "billing_entity", - "default_odoo_sale_order_id", - "hide_billing_address", - ) - list_filter = ("hide_billing_address",) + list_display = ("name", "billing_entity", "default_odoo_sale_order_id") search_fields = ("name",) autocomplete_fields = ("billing_entity",) filter_horizontal = ("limit_cloudproviders",) diff --git a/src/servala/core/migrations/0014_hide_billing_address.py b/src/servala/core/migrations/0014_hide_billing_address.py deleted file mode 100644 index 7295f3a..0000000 --- a/src/servala/core/migrations/0014_hide_billing_address.py +++ /dev/null @@ -1,41 +0,0 @@ -# Generated by Django 5.2.8 on 2025-11-12 09:31 - -from django.db import migrations, models - - -class Migration(migrations.Migration): - - dependencies = [ - ("core", "0013_add_form_config"), - ] - - operations = [ - migrations.AddField( - model_name="organizationorigin", - name="billing_message", - field=models.TextField( - blank=True, - help_text="Optional message to display instead of billing address (e.g., 'You will be invoiced by Exoscale').", - verbose_name="Billing Message", - ), - ), - migrations.AddField( - model_name="organizationorigin", - name="hide_billing_address", - field=models.BooleanField( - default=False, - help_text="If enabled, the billing address will not be shown in the organization details view.", - verbose_name="Hide Billing Address", - ), - ), - migrations.AlterField( - model_name="controlplane", - name="user_info", - field=models.JSONField( - blank=True, - help_text='Array of info objects: [{"title": "…", "content": "…", "help_text": "…"}]. The help_text field is optional and will be shown as a hover popover on an info icon.', - null=True, - verbose_name="User Information", - ), - ), - ] diff --git a/src/servala/core/models/organization.py b/src/servala/core/models/organization.py index be4f587..09205dc 100644 --- a/src/servala/core/models/organization.py +++ b/src/servala/core/models/organization.py @@ -419,20 +419,6 @@ class OrganizationOrigin(ServalaModelMixin, models.Model): "If set, this sale order will be used for new organizations with this origin." ), ) - hide_billing_address = models.BooleanField( - default=False, - verbose_name=_("Hide Billing Address"), - help_text=_( - "If enabled, the billing address will not be shown in the organization details view." - ), - ) - billing_message = models.TextField( - blank=True, - verbose_name=_("Billing Message"), - help_text=_( - "Optional message to display instead of billing address (e.g., 'You will be invoiced by Exoscale')." - ), - ) class Meta: verbose_name = _("Organization origin") diff --git a/src/servala/frontend/templates/frontend/organizations/update.html b/src/servala/frontend/templates/frontend/organizations/update.html index bc4edf8..73c2c69 100644 --- a/src/servala/frontend/templates/frontend/organizations/update.html +++ b/src/servala/frontend/templates/frontend/organizations/update.html @@ -156,85 +156,72 @@ - {% if not form.instance.origin.hide_billing_address %} - {% if form.instance.billing_entity and form.instance.billing_entity.odoo_data.invoice_address %} -
- {% translate "This billing address cannot be modified." %} -
- {% endif %} -| - {% translate "Invoice Contact Name" %} - | -{{ odoo_data.invoice_address.name|default:"" }} | -
|---|---|
| - {% translate "Street" %} - | -{{ odoo_data.invoice_address.street|default:"" }} | -
| - {% translate "Street 2" %} - | -{{ odoo_data.invoice_address.street2 }} | -
| - {% translate "City" %} - | -{{ odoo_data.invoice_address.city|default:"" }} | -
| - {% translate "ZIP Code" %} - | -{{ odoo_data.invoice_address.zip|default:"" }} | -
| - {% translate "Country" %} - | -{{ odoo_data.invoice_address.country_id.1|default:"" }} | -- {% translate "Invoice Email" %} - | -{{ odoo_data.invoice_address.email|default:"" }} | - - {% endif %} - -
+ {% translate "This billing address cannot be modified." %} +
+ {% endif %}{{ form.instance.origin.billing_message }}
+ {% with odoo_data=form.instance.billing_entity.odoo_data %} +| + {% translate "Invoice Contact Name" %} + | +{{ odoo_data.invoice_address.name|default:"" }} | +
|---|---|
| + {% translate "Street" %} + | +{{ odoo_data.invoice_address.street|default:"" }} | +
| + {% translate "Street 2" %} + | +{{ odoo_data.invoice_address.street2 }} | +
| + {% translate "City" %} + | +{{ odoo_data.invoice_address.city|default:"" }} | +
| + {% translate "ZIP Code" %} + | +{{ odoo_data.invoice_address.zip|default:"" }} | +
| + {% translate "Country" %} + | +{{ odoo_data.invoice_address.country_id.1|default:"" }} | ++ {% translate "Invoice Email" %} + | +{{ odoo_data.invoice_address.email|default:"" }} | + + {% endif %} + +