Compare commits
No commits in common. "3e6c598c962512fe854f96ad8fd63965a1ee3385" and "4b3ddec4bb29a0e3eaf9349debb1f1c8d8b1f79a" have entirely different histories.
3e6c598c96
...
4b3ddec4bb
9 changed files with 15 additions and 33 deletions
|
@ -154,6 +154,8 @@ class BillingEntity(ServalaModelMixin, models.Model):
|
|||
"name": odoo_data.get("company_name", name),
|
||||
"company_type": "company",
|
||||
}
|
||||
if vat := odoo_data.get("invoice_vat"):
|
||||
company_payload["vat"] = vat
|
||||
company_id = CLIENT.execute("res.partner", "create", [company_payload])
|
||||
instance.odoo_company_id = company_id
|
||||
|
||||
|
@ -197,7 +199,7 @@ class BillingEntity(ServalaModelMixin, models.Model):
|
|||
"invoice_address": None,
|
||||
}
|
||||
|
||||
company_fields = ["name", "company_type"]
|
||||
company_fields = ["name", "company_type", "vat"]
|
||||
invoice_address_fields = [
|
||||
"name",
|
||||
"company_type",
|
||||
|
|
|
@ -40,6 +40,7 @@ class OrganizationCreateForm(OrganizationForm):
|
|||
)
|
||||
invoice_email = forms.EmailField(label=_("Billing Email"), required=False)
|
||||
invoice_phone = forms.CharField(label=_("Phone"), required=False, max_length=30)
|
||||
invoice_vat = forms.CharField(label=_("VAT ID"), required=False, max_length=50)
|
||||
|
||||
class Meta(OrganizationForm.Meta):
|
||||
pass
|
||||
|
|
|
@ -20,8 +20,6 @@ class VerticalFormRenderer(TemplatesSetting):
|
|||
def get_class_names(self, field):
|
||||
input_type = self.get_field_input_type(field)
|
||||
errors = "is-invalid " if field.errors else ""
|
||||
if input_type == "radio":
|
||||
return f"{errors}form-check-input"
|
||||
if input_type == "checkbox":
|
||||
return f"{errors}form-check-input"
|
||||
return f"{errors}form-control"
|
||||
|
|
|
@ -1,6 +0,0 @@
|
|||
{% include "django/forms/widgets/input.html" %}
|
||||
{% if widget.wrap_label %}
|
||||
<label {% if widget.attrs.id %}for="{{ widget.attrs.id }}"{% endif %}>
|
||||
{% if not widget.attrs.hide_label %}{{ widget.label }}{% endif %}
|
||||
</label>
|
||||
{% endif %}
|
|
@ -1,15 +0,0 @@
|
|||
{# Change compared to Django: only render widget.attrs.class in actual option widget, not in wrapper #}
|
||||
{% with id=widget.attrs.id %}
|
||||
<div {% if id %}id="{{ id }}"{% endif %}>
|
||||
{% for group, options, index in widget.optgroups %}
|
||||
{% if group %}
|
||||
<div>
|
||||
<label>{{ group }}</label>
|
||||
{% endif %}
|
||||
{% for option in options %}
|
||||
<div>{% include option.template_name with widget=option %}</div>
|
||||
{% endfor %}
|
||||
{% if group %}</div>{% endif %}
|
||||
{% endfor %}
|
||||
</div>
|
||||
{% endwith %}
|
|
@ -19,7 +19,7 @@
|
|||
</div>
|
||||
</div>
|
||||
</div>
|
||||
{% if form.billing_processing_choice %}
|
||||
{% if form.existing_odoo_address_id and form.existing_odoo_address_id.choices %}
|
||||
<div class="card">
|
||||
<div class="card-content">
|
||||
<div class="card-header">
|
||||
|
@ -42,6 +42,8 @@
|
|||
</div>
|
||||
<div class="form-body card-body">
|
||||
<div class="row">
|
||||
{{ form.invoice_vat.as_field_group }}
|
||||
<hr>
|
||||
{{ form.invoice_street.as_field_group }}
|
||||
{{ form.invoice_street2.as_field_group }}
|
||||
<div class="col-md-2">{{ form.invoice_zip.as_field_group }}</div>
|
||||
|
|
|
@ -116,6 +116,12 @@
|
|||
</th>
|
||||
<td>{{ odoo_data.invoice_address.country_id.1|default:"" }}</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th class="w-25">
|
||||
<span class="d-flex mt-2">{% translate "VAT ID" %}</span>
|
||||
</th>
|
||||
<td>{{ odoo_data.company.vat|default:"" }}</td>
|
||||
</tr>
|
||||
<th class="w-25">
|
||||
<span class="d-flex mt-2">{% translate "Invoice Email" %}</span>
|
||||
</th>
|
||||
|
|
|
@ -142,11 +142,11 @@ INSTALLED_APPS = [
|
|||
"django.contrib.sessions",
|
||||
"django.contrib.messages",
|
||||
"django.contrib.staticfiles",
|
||||
# The frontend app is loaded early in order to supersede some allauth views/behaviour
|
||||
"servala.frontend",
|
||||
"django.forms",
|
||||
"template_partials",
|
||||
"rules.apps.AutodiscoverRulesConfig",
|
||||
# The frontend app is loaded early in order to supersede some allauth views/behaviour
|
||||
"servala.frontend",
|
||||
"allauth",
|
||||
"allauth.account",
|
||||
"allauth.socialaccount",
|
||||
|
|
|
@ -54,12 +54,6 @@ html[data-bs-theme="dark"] .btn-outline-primary, .btn-outline-primary {
|
|||
margin-bottom: 0;
|
||||
}
|
||||
|
||||
fieldset .form-check-input + label {
|
||||
font-weight: normal;
|
||||
min-height: 1.5rem;
|
||||
margin: .125rem;
|
||||
}
|
||||
|
||||
.search-form .form-body>.row {
|
||||
display: flex;
|
||||
&>.col-12 {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue