Browse Source

[IMP] extract sexy invoice from easy my coop to put it in a dedicated

module.
pull/1/head
houssine 6 years ago
parent
commit
afebc53c21
  1. 9
      easy_my_coop/models/account_invoice.py
  2. 12
      easy_my_coop/report/cooperator_invoice_G002.xml
  3. 11
      easy_my_coop/report/easy_my_coop_report.xml

9
easy_my_coop/models/account_invoice.py

@ -75,12 +75,3 @@ class account_invoice(models.Model):
invoice.subscription_request.state = 'paid'
invoice.post_process_confirm_paid(effective_date)
return True
@api.multi
def invoice_print(self):
""" Print the invoice and mark it as sent, so that we can see more
easily the next step of the workflow
"""
self.ensure_one()
self.sent = True
return self.env['report'].get_action(self, 'easy_my_coop.report_sexy_invoice')

12
easy_my_coop/report/cooperator_invoice_G002.xml

@ -238,17 +238,5 @@
</t>
</t>
</template>
<template id="report_sexy_invoice">
<t t-call="theme_light.html_container">
<t t-set="data_report_margin_top" t-value="10"/>
<t t-set="data_report_header_spacing" t-value="5"/>
<t t-set="data_report_dpi" t-value="110"/>
<t t-foreach="docs" t-as="o">
<t t-call="easy_my_coop.theme_invoice_G002_document" t-lang="o.partner_id.lang"/>
</t>
</t>
</template>
</data>
</openerp>

11
easy_my_coop/report/easy_my_coop_report.xml

@ -12,17 +12,6 @@
file="easy_my_coop.cooperator_invoice_G002.xml"
attachment="(object.state in ('open','paid')) and ('SUBJ'+(object.number or '').replace('/','')+'.pdf')"
/>
<report
id="action_account_invoices"
model="account.invoice"
string="Invoices"
report_type="qweb-pdf"
name="easy_my_coop.report_sexy_invoice"
file="easy_my_coop.cooperator_invoice_G002.xml"
attachment_use="False"
attachment="(object.state in ('open','paid')) and ('INV'+(object.number or '').replace('/','')+'.pdf')"
/>
<report
id="action_cooperator_subscription_report"

Loading…
Cancel
Save