Browse Source

[FIX] emc_taxshelter_report: Line ending

pull/68/head
Rémy Taymans 5 years ago
parent
commit
b05064d312
  1. 2
      easy_my_coop_taxshelter_report/__manifest__.py
  2. 1
      easy_my_coop_taxshelter_report/data/mail_template_data.xml
  3. 4
      easy_my_coop_taxshelter_report/data/scheduler_data.xml
  4. 5
      easy_my_coop_taxshelter_report/models/mail_template.py
  5. 12
      easy_my_coop_taxshelter_report/models/tax_shelter_declaration.py
  6. 41
      easy_my_coop_taxshelter_report/reports/tax_shelter_report.xml
  7. 378
      easy_my_coop_taxshelter_report/views/tax_shelter_declaration_view.xml

2
easy_my_coop_taxshelter_report/__manifest__.py

@ -21,7 +21,7 @@
{
# todo check ir model access
"name": "Easy My Coop tax shelter report",
"version": "12.0.1.0.0",
"version": "12.0.1.0.1",
"depends": ["easy_my_coop"],
"author": "Houssine BAKKALI <houssine@coopiteasy.be>",
"category": "Cooperative management",

1
easy_my_coop_taxshelter_report/data/mail_template_data.xml

@ -1,3 +1,4 @@
<?xml version="1.0" encoding="utf-8"?>
<odoo>
<!-- Mail template are declared in a NOUPDATE block
so users can freely customize/delete them -->

4
easy_my_coop_taxshelter_report/data/scheduler_data.xml

@ -1,6 +1,6 @@
<?xml version="1.0" encoding="utf-8"?>
<odoo>
<data noupdate="1">
<data noupdate="1">
<record forcecreate="True" id="ir_cron_mail_tax_shelter_action" model="ir.cron">
<field name="name">Tax shelter mail batch mail</field>
<field name="model_id" ref="model_tax_shelter_certificate"/>
@ -11,5 +11,5 @@
<field name="numbercall">-1</field>
<field name="doall" eval="False"/>
</record>
</data>
</data>
</odoo>

5
easy_my_coop_taxshelter_report/models/mail_template.py

@ -4,11 +4,6 @@ from odoo import api, models
class MailTemplate(models.Model):
_inherit = "mail.template"
# def init(self):
# for template_id in EMAIL_TEMPLATE_IDS:
# mail_template = self.env.ref(template_id)
# mail_template.easy_my_coop = True
@api.multi
def send_mail_with_multiple_attachments(self, res_id,
additional_attachments,

12
easy_my_coop_taxshelter_report/models/tax_shelter_declaration.py

@ -354,13 +354,19 @@ class TaxShelterCertificateLine(models.Model):
if line.type == 'subscribed' and line.tax_shelter:
if (line.capital_before_sub < line.capital_limit
and line.capital_after_sub >= line.capital_limit):
line.amount_subscribed_eligible = line.capital_limit - line.capital_before_sub #noqa
line.amount_subscribed_eligible = (
line.capital_limit - line.capital_before_sub
)
elif (line.capital_before_sub < line.capital_limit
and line.capital_after_sub <= line.capital_limit):
line.amount_subscribed_eligible = line.share_unit_price * line.quantity #noqa
line.amount_subscribed_eligible = (
line.share_unit_price * line.quantity
)
elif line.capital_before_sub >= line.capital_limit:
line.amount_subscribed_eligible = 0
if line.type == 'resold':
line.amount_resold = line.share_unit_price * -(line.quantity)
if line.type == 'transfered':
line.amount_transfered = line.share_unit_price * -(line.quantity) #noqa
line.amount_transfered = (
line.share_unit_price * -(line.quantity)
)

41
easy_my_coop_taxshelter_report/reports/tax_shelter_report.xml

@ -1,24 +1,23 @@
<?xml version="1.0" encoding="utf-8"?>
<odoo>
<data noupdate="0">
<report
id="action_tax_shelter_subscription_report"
model="tax.shelter.certificate"
string="Tax shelter subscription report"
report_type="qweb-pdf"
name="easy_my_coop_taxshelter_report.tax_shelter_subscription_report"
file="easy_my_coop_taxshelter_report.tax_shelter_subscription_report.xml"
multi="True"
menu="True"/>
<report
id="action_tax_shelter_shares_report"
model="tax.shelter.certificate"
string="Tax shelter shares report"
report_type="qweb-pdf"
name="easy_my_coop_taxshelter_report.tax_shelter_shares_report"
file="easy_my_coop_taxshelter_report.tax_shelter_shares_report.xml"
multi="True"
menu="True"/>
</data>
<data noupdate="0">
<report
id="action_tax_shelter_subscription_report"
model="tax.shelter.certificate"
string="Tax shelter subscription report"
report_type="qweb-pdf"
name="easy_my_coop_taxshelter_report.tax_shelter_subscription_report"
file="easy_my_coop_taxshelter_report.tax_shelter_subscription_report.xml"
multi="True"
menu="True"/>
<report
id="action_tax_shelter_shares_report"
model="tax.shelter.certificate"
string="Tax shelter shares report"
report_type="qweb-pdf"
name="easy_my_coop_taxshelter_report.tax_shelter_shares_report"
file="easy_my_coop_taxshelter_report.tax_shelter_shares_report.xml"
multi="True"
menu="True"/>
</data>
</odoo>

378
easy_my_coop_taxshelter_report/views/tax_shelter_declaration_view.xml

@ -1,201 +1,199 @@
<?xml version="1.0" encoding="utf-8"?>
<odoo>
<data>
<menuitem name="Declaration" id="menu_easy_my_coop_main_declaration" parent="easy_my_coop.menu_main_easy_my_coop" sequence="10"/>
<menuitem name="Declaration" id="menu_easy_my_coop_main_declaration" parent="easy_my_coop.menu_main_easy_my_coop" sequence="10"/>
<record id="tax_shelter_declaration_form" model="ir.ui.view">
<field name="name">tax.shelter.declaration.form</field>
<field name="model">tax.shelter.declaration</field>
<field name="arch" type="xml">
<form string="Tax shelter declaration">
<header>
<button name="compute_declaration" string="Process Declaration" type="object" states="draft" class="oe_highlight" groups="easy_my_coop.group_easy_my_coop_user"/>
<button name="validate_declaration" string="Validate Declaration" type="object" states="computed" groups="easy_my_coop.group_easy_my_coop_user"/>
<button name="reset_declaration" string="Reset Declaration" type="object" states="computed" groups="easy_my_coop.group_easy_my_coop_user"/>
<field name="state" widget="statusbar"/>
</header>
<sheet>
<group>
<group>
<field name="name"/>
<field name="fiscal_year"/>
<field name="tax_shelter_percentage"/>
<field name="tax_shelter_capital_limit"/>
<field name="previously_subscribed_capital"/>
</group>
<group>
<field name="date_from"/>
<field name="date_to"/>
<field name="month_from"/>
<field name="month_to"/>
</group>
</group>
<notebook>
<page string="Tax shelter certificates">
<field name="tax_shelter_certificates">
<tree>
<field name="partner_id"/>
<field name="cooperator_number"/>
<field name="total_amount" sum="Total amount"/>
<field name="state"/>
<button type="object" name="send_certificates" icon="STOCK_MEDIA_PLAY" string="Send Certificates"/>
</tree>
</field>
</page>
<page string="Excluded from Tax shelter">
<field name="excluded_cooperator"/>
</page>
</notebook>
</sheet>
</form>
</field>
</record>
<record id="tax_shelter_declaration_form" model="ir.ui.view">
<field name="name">tax.shelter.declaration.form</field>
<field name="model">tax.shelter.declaration</field>
<field name="arch" type="xml">
<form string="Tax shelter declaration">
<header>
<button name="compute_declaration" string="Process Declaration" type="object" states="draft" class="oe_highlight" groups="easy_my_coop.group_easy_my_coop_user"/>
<button name="validate_declaration" string="Validate Declaration" type="object" states="computed" groups="easy_my_coop.group_easy_my_coop_user"/>
<button name="reset_declaration" string="Reset Declaration" type="object" states="computed" groups="easy_my_coop.group_easy_my_coop_user"/>
<field name="state" widget="statusbar"/>
</header>
<sheet>
<group>
<group>
<field name="name"/>
<field name="fiscal_year"/>
<field name="tax_shelter_percentage"/>
<field name="tax_shelter_capital_limit"/>
<field name="previously_subscribed_capital"/>
</group>
<group>
<field name="date_from"/>
<field name="date_to"/>
<field name="month_from"/>
<field name="month_to"/>
</group>
</group>
<notebook>
<page string="Tax shelter certificates">
<field name="tax_shelter_certificates">
<tree>
<field name="partner_id"/>
<field name="cooperator_number"/>
<field name="total_amount" sum="Total amount"/>
<field name="state"/>
<button type="object" name="send_certificates" icon="STOCK_MEDIA_PLAY" string="Send Certificates"/>
</tree>
</field>
</page>
<page string="Excluded from Tax shelter">
<field name="excluded_cooperator"/>
</page>
</notebook>
</sheet>
</form>
</field>
</record>
<record id="tax_shelter_declaration_tree" model="ir.ui.view">
<field name="name">tax.shelter.declaration.tree</field>
<field name="model">tax.shelter.declaration</field>
<field name="arch" type="xml">
<tree string="Tax shelter declaration">
<field name="name"/>
<field name="date_from"/>
<field name="date_to"/>
<field name="tax_shelter_percentage"/>
<field name="state"/>
</tree>
</field>
</record>
<record id="tax_shelter_declaration_tree" model="ir.ui.view">
<field name="name">tax.shelter.declaration.tree</field>
<field name="model">tax.shelter.declaration</field>
<field name="arch" type="xml">
<tree string="Tax shelter declaration">
<field name="name"/>
<field name="date_from"/>
<field name="date_to"/>
<field name="tax_shelter_percentage"/>
<field name="state"/>
</tree>
</field>
</record>
<record id="tax_shelter_declaration_action" model="ir.actions.act_window">
<field name="name">Tax Shelter Declarations</field>
<field name="res_model">tax.shelter.declaration</field>
<field name="view_type">form</field>
<field name="view_mode">tree,form</field>
<field name="view_id" ref="tax_shelter_declaration_tree"/>
</record>
<record id="tax_shelter_declaration_action" model="ir.actions.act_window">
<field name="name">Tax Shelter Declarations</field>
<field name="res_model">tax.shelter.declaration</field>
<field name="view_type">form</field>
<field name="view_mode">tree,form</field>
<field name="view_id" ref="tax_shelter_declaration_tree"/>
</record>
<menuitem action="tax_shelter_declaration_action" name="Tax Shelter Declaration" id="menu_tax_shelter_declaration" parent="menu_easy_my_coop_main_declaration" sequence="10" groups="easy_my_coop.group_easy_my_coop_user"/>
<menuitem action="tax_shelter_declaration_action" name="Tax Shelter Declaration" id="menu_tax_shelter_declaration" parent="menu_easy_my_coop_main_declaration" sequence="10" groups="easy_my_coop.group_easy_my_coop_user"/>
<record id="tax_shelter_certificate_form" model="ir.ui.view">
<field name="name">tax.shelter.certificate.form</field>
<field name="model">tax.shelter.certificate</field>
<field name="arch" type="xml">
<form string="Tax shelter certificate">
<header>
<button type="object" name="print_subscription_certificate" string="Print Subscription Certificate" />
<button type="object" name="print_shares_certificate" string="Print Shares Certificate" />
<button type="object" name="send_certificates" string="Send Certificates"/>
<field name="state" widget="statusbar"/>
</header>
<sheet>
<group>
<group>
<field name="cooperator_number"/>
<field name="partner_id"/>
<field name="declaration_id"/>
</group>
<group>
<field name="total_amount_previously_subscribed"/>
<field name="total_amount_eligible_previously_subscribed"/>
<field name="total_amount_subscribed"/>
<field name="total_amount_eligible"/>
<field name="total_amount_resold"/>
<field name="total_amount_transfered"/>
<field name="total_amount"/>
</group>
</group>
<notebook>
<page string="Subscription">
<field name="subscribed_lines">
<tree>
<field name="capital_before_sub"/>
<field name="capital_after_sub"/>
<field name="tax_shelter"/>
<field name="transaction_date"/>
<field name="share_type"/>
<field name="share_short_name"/>
<field name="quantity"/>
<field name="share_unit_price"/>
<field name="type"/>
<field name="amount_subscribed"/>
<field name="amount_subscribed_eligible"/>
</tree>
</field>
</page>
<page string="Sell back">
<field name="resold_lines">
<tree>
<field name="transaction_date"/>
<field name="share_type"/>
<field name="share_short_name"/>
<field name="quantity"/>
<field name="share_unit_price"/>
<field name="type"/>
<field name="amount_resold"/>
</tree>
</field>
</page>
<page string="Transfered">
<field name="transfered_lines">
<tree>
<field name="transaction_date"/>
<field name="share_type"/>
<field name="share_short_name"/>
<field name="quantity"/>
<field name="share_unit_price"/>
<field name="type"/>
<field name="amount_transfered"/>
</tree>
</field>
</page>
<page string="Previously subscribed">
<field name="previously_subscribed_lines">
<tree>
<field name="capital_before_sub"/>
<field name="capital_after_sub"/>
<field name="tax_shelter"/>
<field name="transaction_date"/>
<field name="share_type"/>
<field name="share_short_name"/>
<field name="quantity"/>
<field name="share_unit_price"/>
<field name="type"/>
<field name="amount_subscribed"/>
<field name="amount_subscribed_eligible"/>
</tree>
</field>
</page>
</notebook>
</sheet>
</form>
</field>
</record>
<record id="tax_shelter_certificate_form" model="ir.ui.view">
<field name="name">tax.shelter.certificate.form</field>
<field name="model">tax.shelter.certificate</field>
<field name="arch" type="xml">
<form string="Tax shelter certificate">
<header>
<button type="object" name="print_subscription_certificate" string="Print Subscription Certificate" />
<button type="object" name="print_shares_certificate" string="Print Shares Certificate" />
<button type="object" name="send_certificates" string="Send Certificates"/>
<field name="state" widget="statusbar"/>
</header>
<sheet>
<group>
<group>
<field name="cooperator_number"/>
<field name="partner_id"/>
<field name="declaration_id"/>
</group>
<group>
<field name="total_amount_previously_subscribed"/>
<field name="total_amount_eligible_previously_subscribed"/>
<field name="total_amount_subscribed"/>
<field name="total_amount_eligible"/>
<field name="total_amount_resold"/>
<field name="total_amount_transfered"/>
<field name="total_amount"/>
</group>
</group>
<notebook>
<page string="Subscription">
<field name="subscribed_lines">
<tree>
<field name="capital_before_sub"/>
<field name="capital_after_sub"/>
<field name="tax_shelter"/>
<field name="transaction_date"/>
<field name="share_type"/>
<field name="share_short_name"/>
<field name="quantity"/>
<field name="share_unit_price"/>
<field name="type"/>
<field name="amount_subscribed"/>
<field name="amount_subscribed_eligible"/>
</tree>
</field>
</page>
<page string="Sell back">
<field name="resold_lines">
<tree>
<field name="transaction_date"/>
<field name="share_type"/>
<field name="share_short_name"/>
<field name="quantity"/>
<field name="share_unit_price"/>
<field name="type"/>
<field name="amount_resold"/>
</tree>
</field>
</page>
<page string="Transfered">
<field name="transfered_lines">
<tree>
<field name="transaction_date"/>
<field name="share_type"/>
<field name="share_short_name"/>
<field name="quantity"/>
<field name="share_unit_price"/>
<field name="type"/>
<field name="amount_transfered"/>
</tree>
</field>
</page>
<page string="Previously subscribed">
<field name="previously_subscribed_lines">
<tree>
<field name="capital_before_sub"/>
<field name="capital_after_sub"/>
<field name="tax_shelter"/>
<field name="transaction_date"/>
<field name="share_type"/>
<field name="share_short_name"/>
<field name="quantity"/>
<field name="share_unit_price"/>
<field name="type"/>
<field name="amount_subscribed"/>
<field name="amount_subscribed_eligible"/>
</tree>
</field>
</page>
</notebook>
</sheet>
</form>
</field>
</record>
<record id="tax_shelter_certificate_tree" model="ir.ui.view">
<field name="name">tax.shelter.certificate.tree</field>
<field name="model">tax.shelter.certificate</field>
<field name="arch" type="xml">
<tree string="Tax shelter certificates">
<field name="declaration_id"/>
<field name="partner_id"/>
<field name="cooperator_number"/>
<field name="total_amount_subscribed"/>
<field name="total_amount_eligible"/>
<field name="total_amount_resold"/>
<field name="total_amount_transfered"/>
<field name="total_amount"/>
<field name="state"/>
</tree>
</field>
</record>
<record id="tax_shelter_certificate_tree" model="ir.ui.view">
<field name="name">tax.shelter.certificate.tree</field>
<field name="model">tax.shelter.certificate</field>
<field name="arch" type="xml">
<tree string="Tax shelter certificates">
<field name="declaration_id"/>
<field name="partner_id"/>
<field name="cooperator_number"/>
<field name="total_amount_subscribed"/>
<field name="total_amount_eligible"/>
<field name="total_amount_resold"/>
<field name="total_amount_transfered"/>
<field name="total_amount"/>
<field name="state"/>
</tree>
</field>
</record>
<record id="tax_shelter_certificate_action" model="ir.actions.act_window">
<field name="name">Tax Shelter Certificates</field>
<field name="res_model">tax.shelter.certificate</field>
<field name="view_type">form</field>
<field name="view_mode">tree,form</field>
<field name="view_id" ref="tax_shelter_certificate_tree"/>
</record>
<record id="tax_shelter_certificate_action" model="ir.actions.act_window">
<field name="name">Tax Shelter Certificates</field>
<field name="res_model">tax.shelter.certificate</field>
<field name="view_type">form</field>
<field name="view_mode">tree,form</field>
<field name="view_id" ref="tax_shelter_certificate_tree"/>
</record>
<menuitem action="tax_shelter_certificate_action" name="Tax Shelter Certificates" id="menu_tax_shelter_certificate" parent="menu_easy_my_coop_main_declaration" sequence="20" groups="easy_my_coop.group_easy_my_coop_user"/>
</data>
<menuitem action="tax_shelter_certificate_action" name="Tax Shelter Certificates" id="menu_tax_shelter_certificate" parent="menu_easy_my_coop_main_declaration" sequence="20" groups="easy_my_coop.group_easy_my_coop_user"/>
</odoo>
Loading…
Cancel
Save