Browse Source

rf 2023

master
root 1 year ago
parent
commit
1b608883d7
6 changed files with 44 additions and 5 deletions
  1. +14
    -1
      models/donation.py
  2. +1
    -1
      models/partner.py
  3. +3
    -1
      models/template_rf.py
  4. +12
    -0
      report/report.xml
  5. +13
    -1
      report/report_donationtax.xml
  6. +1
    -1
      views/template_rf.xml

+ 14
- 1
models/donation.py View File

@ -98,7 +98,20 @@ class DonationDonation(models.Model):
('deposited_in_accounting', 'Deposited in accounting')
],
compute='_compute_payment_state', store=True)
tax_receipt_option = fields.Selection(
[
("none", "None"),
("each", "For Each Donation"),
("annual", "Annual Tax Receipt"),
],
string="Tax Receipt Option",
states={"done": [("readonly", True)]},
index=True,
tracking=True,
default='annual'
)
@api.onchange("recurring_template")
def recurring_template_change(self):
res = {"warning": {}}


+ 1
- 1
models/partner.py View File

@ -117,7 +117,7 @@ class partner(models.Model):
max_amount_donation=fields.Float(related='aggregate_id.max_amount_donation')
annual_average_number_donation=fields.Float(related='aggregate_id.annual_average_number_donation')
average_amount_donation=fields.Float(related='aggregate_id.average_amount_donation')
def _compute_donor_id(self):
for rec in self:


+ 3
- 1
models/template_rf.py View File

@ -20,4 +20,6 @@ class opendons_template_rf(models.Model):
css=fields.Text('css')
type_rf=fields.Selection(string='type',selection=[('generic','Generic'),('affectation','Affectation'),('high amount','High amount')])
def action_print(self):
self.ensure_one()
return self.env.ref("opendons.report_tax_receipt_template").report_action(self)

+ 12
- 0
report/report.xml View File

@ -56,4 +56,16 @@
<field name="binding_type">report</field>
</record>
<record id="report_tax_receipt_template" model="ir.actions.report">
<field name="name">Donation Tax Receipt template</field>
<field name="model">opendons.template_rf</field>
<field name="report_type">qweb-pdf</field>
<field name="report_name">opendons.report_donationtaxreceipt_template</field>
<field name="report_file">opendons.report_donationtax_template</field>
<field name="print_report_name">'RF_template'</field>
<field name="binding_model_id" ref="model_opendons_template_rf" />
<field name="attachment_use" eval="True" />
<field name="binding_type">report</field>
</record>
</odoo>

+ 13
- 1
report/report_donationtax.xml View File

@ -2,7 +2,19 @@
<odoo>
<template id="report_donationtaxreceipt_template">
<t t-call="web.html_container">
<t t-call="web.internal_layout">
<t t-foreach="docs" t-as="doc">
<style t-esc="doc.css"/>
<div t-field="doc.html_content"/>
<div style="page-break-after: always;" ></div>
</t>
</t>
</t>
</template>
<template id="report_donationtaxreceipt">
<t t-call="web.html_container">


+ 1
- 1
views/template_rf.xml View File

@ -8,7 +8,7 @@
<field name="arch" type="xml">
<form>
<header>
<!-- <button name="action_update_receipts" type="object" string="Update receipts" class="oe_highlight" confirm="Voulez-vous modifier les RF liés à ce template ?"/> -->
<button name="action_print" type="object" string="Print" />
</header>
<sheet>
<group name="main">


Loading…
Cancel
Save