Skip to content
Snippets Groups Projects
Commit 38e3ec31 authored by Benjamin - Le Filament's avatar Benjamin - Le Filament
Browse files

[UPD] remove invoice for adhesion

parent 7aebd013
No related branches found
No related tags found
No related merge requests found
......@@ -7,13 +7,11 @@
"application": False,
"installable": True,
"depends": [
"cgscop_account",
"cgscop_adhesion",
"cgscop_partner_alfodoo",
"cmis_field",
],
"data": [
"report/report_invoice_adhesion.xml",
"views/res_partner.xml",
"views/scop_adhesion_file.xml",
],
......
......@@ -15,7 +15,6 @@ class ScopAlfrescoAdhesionPartner(models.Model):
# ------------------------------------------------------
# Actions
# ------------------------------------------------------
# Email
def get_recipients_adhesion(self):
"""
Get recipients for email adhesion
......@@ -164,28 +163,6 @@ class ScopAlfrescoAdhesionPartner(models.Model):
else:
folder_coop = self.partner_cmis_folder
# Create & store Facture d'adhésion
invoice_file = self.env.ref("account.account_invoices")._render_qweb_pdf(
self.invoice_adhesion_id.id
)[0]
invoice_name = "Facture d'Adhésion"
self.push_alfresco_file(
file=invoice_file,
name=invoice_name + ".pdf",
folder=folder_coop,
metadata={
"cm:title": invoice_name,
"cmis:objectTypeId": "D:crm:document",
"cmis:secondaryObjectTypeIds": [
"P:crm:organisme",
"P:cm:titled",
],
"crm:type": "FAD",
"crm:contexte": "STD",
"crm:annee": str(fields.Datetime.now().year),
},
)
# Create & store Courrier adhésion
report_adhesion = self.env.ref(
"cgscop_adhesion.cgscop_adhesion_report"
......
<?xml version="1.0" encoding="utf-8" ?>
<odoo>
<data>
<!-- Template invoice -->
<template
id="scop_report_invoice_adhesion"
inherit_id="account.report_invoice_document"
>
<xpath expr="//t[@t-set='o']" position="after">
<t t-if="o.journal_id == o.company_id.journal_adhesion_id">
<t t-set="is_adh" t-value="True" />
</t>
<t t-else="">
<t t-set="is_adh" t-value="False" />
</t>
</xpath>
<xpath expr="//div[hasclass('page')]/h2" position="attributes">
<attribute name="t-if">not is_adh</attribute>
</xpath>
<xpath expr="//div[hasclass('page')]/h2" position="after">
<h2 t-if="is_adh">
<span
t-if="o.move_type == 'out_invoice' and o.state in ('open', 'in_payment', 'paid')"
>Droits d'adhésion</span>
<span
t-if="o.move_type == 'out_invoice' and o.state == 'draft'"
>Brouillon adhésion</span>
<span
t-if="o.move_type == 'out_invoice' and o.state == 'cancel'"
>Annulation adhésion</span>
<span t-field="o.name" />
</h2>
</xpath>
</template>
</data>
</odoo>
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment