Browse Source
[IMP] adding name attribute on div to allow xpath overriding on
[IMP] adding name attribute on div to allow xpath overriding on
certifacte templatepull/1/head
houssine
8 years ago
11 changed files with 186 additions and 43 deletions
-
6easy_my_coop/report/cooperator_certificat_G001.xml
-
1easy_my_coop_taxshelter_report/__init__.py
-
2easy_my_coop_taxshelter_report/__openerp__.py
-
1easy_my_coop_taxshelter_report/models/__init__.py
-
47easy_my_coop_taxshelter_report/models/tax_shelter_declaration.py
-
4easy_my_coop_taxshelter_report/report/tax_shelter_report.xml
-
7easy_my_coop_taxshelter_report/security/ir.model.access.csv
-
110easy_my_coop_taxshelter_report/views/tax_shelter_declaration_view.xml
-
2easy_my_coop_taxshelter_report/wizard/__init__.py
-
29easy_my_coop_taxshelter_report/wizard/tax_shelter_certificate_wizard.py
-
20easy_my_coop_taxshelter_report/wizard/tax_shelter_report_wizard.xml
@ -0,0 +1 @@ |
|||
from . import models |
@ -0,0 +1 @@ |
|||
from . import tax_shelter_declaration |
@ -0,0 +1,47 @@ |
|||
# -*- coding: utf-8 -*- |
|||
from datetime import datetime |
|||
|
|||
from openerp import api, fields, models, _ |
|||
|
|||
class TaxShelterCertificate(models.Model): |
|||
_name="tax.shelter.declaration" |
|||
|
|||
declaration_year = fields.Integer(string='Declaration year', required=True) |
|||
tax_shelter_certificates = fields.One2many('tax.shelter.certificate','declaration_id', string='Tax shelter certificates', readonly=True) |
|||
date_from = fields.Date(string='Date from', required=True) |
|||
date_to = fields.Date(string='Date to', required=True) |
|||
tax_shelter_percentage = fields.Selection([('30','30%'), |
|||
('45','45%')], |
|||
string='Tax Shelter percentage', required=True) |
|||
|
|||
@api.one |
|||
def process_declaration(self): |
|||
True |
|||
|
|||
class TaxShelterCertificate(models.Model): |
|||
_name="tax.shelter.certificate" |
|||
|
|||
partner_id = fields.Many2one('res.partner', string='Cooperator', required=True, readonly=True) |
|||
declaration_id = fields.Many2one('tax.shelter.declaration', string='Declaration', required=True, readonly=True) |
|||
subscribed_lines = fields.One2many('certificate.line','tax_shelter_certificate', string='Certificate lines', readonly=True) |
|||
sell_back_lines = fields.One2many('certificate.line','tax_shelter_certificate', string='Shares resold', readonly=True) |
|||
total = fields.Float(string='Total') |
|||
|
|||
|
|||
class TaxShelterCertificateLine(models.Model): |
|||
_name="certificate.line" |
|||
|
|||
tax_shelter_certificate = fields.Many2one('tax.shelter.certificate', string="Tax shelter certificate",required=True) |
|||
share_type = fields.Many2one('product.produt', string='Share type', required=True, readonly=True) |
|||
share_price = fields.Float(string='Share price', required=True, readonly=True) |
|||
quantity = fields.Integer(string='Number of shares', required=True, readonly=True) |
|||
transaction_date = fields.Date(string="Transaction date") |
|||
certificat_type = fields.Selection([('subscribed','Subscribed'), |
|||
('resold','Resold'), |
|||
('kept','Kept')], required=True, readonly=True) |
|||
total = fields.Float(compute='_compute_total', string='Sub total') |
|||
|
|||
@api.multi |
|||
def _compute_total(self): |
|||
for line in self: |
|||
total = line.share_price * line.quantity |
@ -0,0 +1,7 @@ |
|||
id,name,model_id:id,group_id:id,perm_read,perm_write,perm_create,perm_unlink |
|||
access_tax_shelter_declaration,tax.shelter.declaration,model_tax_shelter_declaration,easy_my_coop.group_energiris_user,1,0,0,0 |
|||
access_tax_shelter_declaration,tax.shelter.declaration,model_tax_shelter_declaration,easy_my_coop.group_energiris_manager,1,1,1,0 |
|||
access_tax_shelter_certificate,tax.shelter.certificate,model_tax_shelter_certificate,easy_my_coop.group_energiris_user,1,0,0,0 |
|||
access_tax_shelter_certificate,tax.shelter.certificate,model_tax_shelter_certificate,easy_my_coop.group_energiris_manager,1,1,1,0 |
|||
access_certificate_line,certificate.line,model_certificate_line,easy_my_coop.group_energiris_user,1,0,0,0 |
|||
access_certificate_line,certificate.line,model_certificate_line,easy_my_coop.group_energiris_manager,1,1,1,0 |
@ -0,0 +1,110 @@ |
|||
<?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"/> |
|||
|
|||
<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" class="oe_highlight" groups="easy_my_coop.group_energiris_manager"/> |
|||
</header> |
|||
<sheet> |
|||
<group> |
|||
<group> |
|||
<field name="declaration_year"/> |
|||
<field name="tax_shelter_percentage"/> |
|||
</group> |
|||
<group> |
|||
<field name="date_from"/> |
|||
<field name="date_to"/> |
|||
</group> |
|||
</group> |
|||
<notebook> |
|||
<page string="Tax shelter certificates"> |
|||
<field name="tax_shelter_certificates"> |
|||
<tree> |
|||
<field name="partner_id"/> |
|||
<field name="total"/> |
|||
</tree> |
|||
</field> |
|||
</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="declaration_year"/> |
|||
<field name="date_from"/> |
|||
<field name="date_to"/> |
|||
<field name="tax_shelter_percentage"/> |
|||
</tree> |
|||
</field> |
|||
</record> |
|||
|
|||
<record id="tax_shelter_declaration_action" model="ir.actions.act_window"> |
|||
<field name="name">Tax Shelter Declaration</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_energiris_manager"/> |
|||
|
|||
<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"> |
|||
<sheet> |
|||
<group> |
|||
<group> |
|||
<field name="partner_id"/> |
|||
<field name="declaration_id"/> |
|||
</group> |
|||
<group> |
|||
<field name="total"/> |
|||
</group> |
|||
</group> |
|||
<notebook> |
|||
<page string="Subscription"> |
|||
<field name="subscribed_lines"> |
|||
<tree> |
|||
|
|||
<field name="transaction_date"/> |
|||
<field name="share_type"/> |
|||
<field name="quantity"/> |
|||
<field name="share_price"/> |
|||
<field name="certificat_type"/> |
|||
<field name="total"/> |
|||
</tree> |
|||
</field> |
|||
</page> |
|||
<page string="Sell back"> |
|||
<field name="sell_back_lines"> |
|||
<tree> |
|||
<field name="transaction_date"/> |
|||
<field name="share_type"/> |
|||
<field name="quantity"/> |
|||
<field name="share_price"/> |
|||
<field name="certificat_type"/> |
|||
<field name="total"/> |
|||
</tree> |
|||
</field> |
|||
</page> |
|||
</notebook> |
|||
</sheet> |
|||
</form> |
|||
</field> |
|||
</record> |
|||
</data> |
|||
</odoo> |
@ -1 +1 @@ |
|||
from . import tax_shelter_report_wizard |
|||
from . import tax_shelter_certificate_wizard |
Write
Preview
Loading…
Cancel
Save
Reference in new issue