Skip to content
Extraits de code Groupes Projets
Valider d4c686d8 rédigé par Juliana's avatar Juliana
Parcourir les fichiers

[UPD]Add free text invoice + payment mode invoice

parent afe34a5d
Aucune branche associée trouvée
Aucune étiquette associée trouvée
Aucune requête de fusion associée trouvée
......@@ -137,12 +137,16 @@ class AccAccount(models.Model):
tracking=True,
default="draft",
)
invoice_terms = fields.Text("Termes and conditions de paiement",
invoice_terms = fields.Text("Termes et conditions de paiement",
default=_default_invoice_terms)
invoice_terms_tax = fields.Text("Termes and conditions des taxes",
invoice_terms_tax = fields.Text("Termes et conditions des taxes",
default=_default_invoice_terms_tax)
contact_invoice = fields.Many2one("res.partner", string="Une question?")
acc_account_payment_ids = fields.Many2many(
"acc.account.payment",
string="Méthodes de paiement")
free_text = fields.Text("Texte libre à afficher sur les factures")
@api.model_create_multi
def create(self, vals_list):
......@@ -245,10 +249,13 @@ class AccAccount(models.Model):
self.is_tva = self.producer_id.is_tva
self.tax_id = self.producer_id.tax_id
self.is_collectivite = self.producer_id.is_collectivite
self.acc_account_payment_ids = self.env["acc.account.payment"].search(
[("producer_id", "=", self.producer_id.id)])
else:
self.is_tva = False
self.tax_id = False
self.is_collectivite = False
self.acc_account_payment_ids = False
@api.onchange("is_tva")
def _onchange_is_tva(self):
......
......@@ -12,7 +12,7 @@ class ResCompany(models.Model):
# ------------------------------------------------------
invoice_terms = fields.Text(string="Termes & Conditions de paiement")
invoice_terms_tax = fields.Text(string="Terms & Conditions des taxes")
invoice_terms_tax = fields.Text(string="Termes & Conditions des taxes")
# ------------------------------------------------------
# SQL Constraints
......
......@@ -11,7 +11,7 @@ class ResConfigSettings(models.TransientModel):
string="Termes & Conditions de paiement",
readonly=False)
invoice_terms_tax = fields.Text(related='company_id.invoice_terms_tax',
string="Terms & Conditions des taxes", readonly=False)
string="Termes & Conditions des taxes", readonly=False)
# ------------------------------------------------------
# Fields declaration
# ------------------------------------------------------
......
......@@ -430,6 +430,13 @@
</tr>
</table>
<t t-if="o.free_text">
<div class="row mt-5">
<div class="col-12">
<h6 t-field="o.free_text"/>
</div>
</div>
</t>
<t t-if="o.producer_id.acc_account_payment_ids">
<div class="row mt-5">
<div class="col-12">
......@@ -438,14 +445,17 @@
>Modalités de paiement : </h5>
<h6>Référence facture : <t t-esc="o.name" /></h6>
<ul t-foreach="o.producer_id.acc_account_payment_ids" t-as="acc_account_payment_id">
<li><span t-field="acc_account_payment_id.description"/></li>
<li>
<span t-field="acc_account_payment_id.name_type"/><br/>
<span t-field="acc_account_payment_id.description"/>
</li>
</ul>
</div>
</div>
<div class="row mt-5">
<div class="row mt-2">
<div class="col-12">
<h5 t-if="not o.is_collectivite">Délai de règlement : à facturation</h5>
<h5 t-if="not o.is_collectivite" class="mb-5">Date limite de règlement : <span
<h5 >Délai de règlement : à facturation</h5>
<h5 class="mb-5">Date limite de règlement : <span
t-field="o.date_limit"
t-options="{'format': 'dd/MM/yyyy'}"
/></h5>
......@@ -462,7 +472,7 @@
<p class="mt-5">
(1) Le total à payer correspond à l’électricité autoconsommée et à l'ACCISE - (2) ACC : Auto-Consommation Collective
</p>
<span t-field="o.invoice_terms"/>
<span t-if="o.invoice_terms" t-field="o.invoice_terms"/>
</div>
</div>
<t t-set="prmi_ids" t-value="o.line_ids.mapped('acc_injection_id')"/>
......
......@@ -343,12 +343,18 @@
class="oe_subtotal_footer_separator"
/>
</group>
<group>
<group>
<field name="invoice_terms" placeholder="Termes and conditions de paiement..."/>
<field name="invoice_terms_tax" placeholder="Termes and conditions des taxes..."/>
</group>
</page>
<page name="other_infos" string="Autres informations">
<group>
<field name="invoice_terms_tax" placeholder="Termes and conditions des taxes..."/>
<field name="acc_account_payment_ids" />
</group>
<group>
<group>
<field name="free_text"/>
</group>
</group>
</page>
......
0% Chargement en cours ou .
You are about to add 0 people to the discussion. Proceed with caution.
Veuillez vous inscrire ou vous pour commenter