Pour le Conseil d'administration de .
diff --git a/easy_my_coop_taxshelter_report/__init__.py b/easy_my_coop_taxshelter_report/__init__.py
index e69de29..9a7e03e 100644
--- a/easy_my_coop_taxshelter_report/__init__.py
+++ b/easy_my_coop_taxshelter_report/__init__.py
@@ -0,0 +1 @@
+from . import models
\ No newline at end of file
diff --git a/easy_my_coop_taxshelter_report/__openerp__.py b/easy_my_coop_taxshelter_report/__openerp__.py
index daa96f4..3e8d174 100644
--- a/easy_my_coop_taxshelter_report/__openerp__.py
+++ b/easy_my_coop_taxshelter_report/__openerp__.py
@@ -29,7 +29,7 @@
""",
'data': [
'report/tax_shelter_report.xml',
- #'wizard/tax_shelter_report_wizard.xml'
+ 'views/tax_shelter_declaration_view.xml'
],
'installable': True,
}
\ No newline at end of file
diff --git a/easy_my_coop_taxshelter_report/models/__init__.py b/easy_my_coop_taxshelter_report/models/__init__.py
new file mode 100644
index 0000000..cf88ee6
--- /dev/null
+++ b/easy_my_coop_taxshelter_report/models/__init__.py
@@ -0,0 +1 @@
+from . import tax_shelter_declaration
\ No newline at end of file
diff --git a/easy_my_coop_taxshelter_report/models/tax_shelter_declaration.py b/easy_my_coop_taxshelter_report/models/tax_shelter_declaration.py
new file mode 100644
index 0000000..8af620e
--- /dev/null
+++ b/easy_my_coop_taxshelter_report/models/tax_shelter_declaration.py
@@ -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
\ No newline at end of file
diff --git a/easy_my_coop_taxshelter_report/report/tax_shelter_report.xml b/easy_my_coop_taxshelter_report/report/tax_shelter_report.xml
index 10c3334..1bb4b4c 100644
--- a/easy_my_coop_taxshelter_report/report/tax_shelter_report.xml
+++ b/easy_my_coop_taxshelter_report/report/tax_shelter_report.xml
@@ -1,5 +1,5 @@
-
+
-
+
diff --git a/easy_my_coop_taxshelter_report/security/ir.model.access.csv b/easy_my_coop_taxshelter_report/security/ir.model.access.csv
new file mode 100644
index 0000000..f9c793c
--- /dev/null
+++ b/easy_my_coop_taxshelter_report/security/ir.model.access.csv
@@ -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
diff --git a/easy_my_coop_taxshelter_report/views/tax_shelter_declaration_view.xml b/easy_my_coop_taxshelter_report/views/tax_shelter_declaration_view.xml
new file mode 100644
index 0000000..5070ea6
--- /dev/null
+++ b/easy_my_coop_taxshelter_report/views/tax_shelter_declaration_view.xml
@@ -0,0 +1,110 @@
+
+
+
+
+
+
+ tax.shelter.declaration.form
+ tax.shelter.declaration
+
+
+
+
+
+
+ tax.shelter.declaration.tree
+ tax.shelter.declaration
+
+
+
+
+
+
+
+
+
+
+
+ Tax Shelter Declaration
+ tax.shelter.declaration
+ form
+ tree,form
+
+
+
+
+
+
+ tax.shelter.certificate.form
+ tax.shelter.certificate
+
+
+
+
+
+
\ No newline at end of file
diff --git a/easy_my_coop_taxshelter_report/wizard/__init__.py b/easy_my_coop_taxshelter_report/wizard/__init__.py
index 5843b37..e607ec8 100644
--- a/easy_my_coop_taxshelter_report/wizard/__init__.py
+++ b/easy_my_coop_taxshelter_report/wizard/__init__.py
@@ -1 +1 @@
-from . import tax_shelter_report_wizard
+from . import tax_shelter_certificate_wizard
diff --git a/easy_my_coop_taxshelter_report/wizard/tax_shelter_report_wizard.py b/easy_my_coop_taxshelter_report/wizard/tax_shelter_certificate_wizard.py
similarity index 51%
rename from easy_my_coop_taxshelter_report/wizard/tax_shelter_report_wizard.py
rename to easy_my_coop_taxshelter_report/wizard/tax_shelter_certificate_wizard.py
index 1509c53..4a54ac1 100644
--- a/easy_my_coop_taxshelter_report/wizard/tax_shelter_report_wizard.py
+++ b/easy_my_coop_taxshelter_report/wizard/tax_shelter_certificate_wizard.py
@@ -21,29 +21,8 @@
from openerp import api, fields, models, _
-class TaxShelterReport(models.TransientModel):
- _name = 'tax.shelter.report'
+class TaxShelterCertificateWizard(models.TransientModel):
+ _name = 'tax.shelter.certificate.wizard'
- name = fields.Char(string='Name')
- year = fields.Integer(string='Year', help='Introduce the year for which you want to get the report')
-
- def _print_report(self, data):
- return {'type': 'ir.actions.report.xml',
- 'report_name': data['report'],
- 'datas': data}
-
- @api.one
- def print_report(self):
- data = {}
-
- domain = [('cooperator','=','True'),('member','=','True')]
- coop = self.env['res.partner'].search(domain, order='cooperator_register_number')
-
- data['model'] = 'res.partner'
- data['report'] = 'easy_my_coop_taxshelter_report.taxshelter_report'
- data['ids'] = coop.ids
-
- #return self._print_report(data)
- return self.env['report'].get_action(coop, 'easy_my_coop_taxshelter_report.tax_shelter_report')
-
-
+ def process_certificates(self):
+ True
diff --git a/easy_my_coop_taxshelter_report/wizard/tax_shelter_report_wizard.xml b/easy_my_coop_taxshelter_report/wizard/tax_shelter_report_wizard.xml
index 7822375..8f43402 100644
--- a/easy_my_coop_taxshelter_report/wizard/tax_shelter_report_wizard.xml
+++ b/easy_my_coop_taxshelter_report/wizard/tax_shelter_report_wizard.xml
@@ -1,19 +1,17 @@
-
+
-
- tax.shelter.report.wizard.form
- tax.shelter.report
+ tax.shelter.certificate.wizard.form
+ tax.shelter.certificate.wizard
-
-
+