Skip to content

Commit 915b6fd

Browse files
committed
[11][MIG] Migrating account vat statement to 11
1 parent 1971e49 commit 915b6fd

22 files changed

Lines changed: 43 additions & 95 deletions

account_vat_period_end_statement/README.rst

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -111,6 +111,7 @@ Contributors
111111
* Alex Comba <alex.comba@agilebg.com>
112112
* Alessandro Camilli <camillialex@gmail.com>
113113
* Simone Rubino <simone.rubino@agilebg.com>
114+
* Giacomo Grasso <giacomo.grasso.82@gmail.com>
114115

115116
Do not contact contributors directly about support or help with technical issues.
116117

account_vat_period_end_statement/__init__.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
# -*- coding: utf-8 -*-
21
#
32
#
43
# OpenERP, Open Source Management Solution

account_vat_period_end_statement/__manifest__.py

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
# -*- coding: utf-8 -*-
21
#
32
#
43
# OpenERP, Open Source Management Solution
@@ -26,16 +25,16 @@
2625

2726
{
2827
"name": "Period End VAT Statement",
29-
"version": "10.0.1.4.2",
28+
"version": "11.0.1.0.0",
3029
'category': 'Generic Modules/Accounting',
3130
'license': 'AGPL-3',
3231
"depends": [
32+
"account_invoicing",
33+
"account_tax_balance",
34+
"date_range",
3335
"l10n_it_account",
34-
"report",
3536
"l10n_it_fiscalcode",
36-
"date_range",
37-
"account_accountant",
38-
"account_tax_balance",
37+
"web",
3938
],
4039
"author": "Agile Business Group, Odoo Community Association (OCA)"
4140
", LinkIt Spa",

account_vat_period_end_statement/migrations/10.0.1.3.0/post-migrate.py

Lines changed: 0 additions & 56 deletions
This file was deleted.

account_vat_period_end_statement/models/__init__.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
# -*- coding: utf-8 -*-
21
##############################################################################
32
#
43
# Author: Apruzzese Francesco (f.apruzzese@apuliasoftware.it)

account_vat_period_end_statement/models/account.py

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
# -*- coding: utf-8 -*-
21
#
32
#
43
# OpenERP, Open Source Management Solution
@@ -23,11 +22,12 @@
2322
#
2423

2524
import math
25+
from datetime import datetime
2626
from odoo import models, fields, api
2727
from odoo.tools.translate import _
2828
from odoo.exceptions import UserError
2929
import odoo.addons.decimal_precision as dp
30-
from odoo.tools import float_is_zero
30+
from odoo.tools import float_is_zero, DEFAULT_SERVER_DATE_FORMAT
3131

3232

3333
class AccountVatPeriodEndStatement(models.Model):
@@ -265,6 +265,8 @@ def _get_default_interest_percent(self):
265265
'Interest - Percent', default=_get_default_interest_percent)
266266
fiscal_page_base = fields.Integer(
267267
'Last printed page', required=True, default=0)
268+
fiscal_year = fields.Char(
269+
'Fiscal year for report')
268270
company_id = fields.Many2one(
269271
'res.company', 'Company',
270272
default=lambda self: self.env['res.company']._company_default_get(
@@ -279,6 +281,14 @@ def unlink(self):
279281
res = super(AccountVatPeriodEndStatement, self).unlink()
280282
return res
281283

284+
@api.multi
285+
def set_fiscal_year(self):
286+
for statement in self:
287+
if statement.date_range_ids:
288+
date = min([x.date_start for x in statement.date_range_ids])
289+
statement.update({'fiscal_year': datetime.strptime(
290+
date, DEFAULT_SERVER_DATE_FORMAT).year})
291+
282292
@api.multi
283293
def _write(self, vals):
284294
pre_not_reconciled = self.filtered(

account_vat_period_end_statement/models/config.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
# -*- coding: utf-8 -*-
21
##############################################################################
32
#
43
# Author: Alessandro Camilli (a.camilli@openforce.it)

account_vat_period_end_statement/report/__init__.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
# -*- coding: utf-8 -*-
21
#
32
#
43
# OpenERP, Open Source Management Solution
Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
<?xml version="1.0"?>
2-
<openerp>
2+
<odoo>
33
<data>
44

55
<report
@@ -10,10 +10,10 @@
1010
name="account_vat_period_end_statement.vat_statement"
1111
file="account_vat_period_end_statement.vat_statement"
1212
/>
13-
<record id="account_vat_period_end_statement.report_vat_statement" model="ir.actions.report.xml">
13+
<record id="account_vat_period_end_statement.report_vat_statement" model="ir.actions.report">
1414
<field name="paperformat_id"
1515
ref="l10n_it_account.l10n_it_account_a4_portrait"/>
1616
</record>
1717
</data>
18-
</openerp>
18+
</odoo>
1919

account_vat_period_end_statement/report/vat_statement.py

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
# -*- coding: utf-8 -*-
21
#
32
#
43
# OpenERP, Open Source Management Solution
@@ -35,18 +34,17 @@ class VatPeriodEndStatementReport(models.AbstractModel):
3534
_name = 'report.account_vat_period_end_statement.vat_statement'
3635

3736
@api.model
38-
def render_html(self, docids, data=None):
37+
def get_report_values(self, docids, data=None):
3938
docs = self.env['account.vat.period.end.statement'].browse(docids)
40-
docargs = {
39+
vals = {
4140
'docs': docs,
4241
'time': time,
4342
'tax_amounts': self._get_taxes_amounts,
4443
'account_vat_amounts': self._get_account_vat_amounts,
4544
'formatLang': formatLang,
4645
'env': self.env,
4746
}
48-
return self.env['report'].render(
49-
'account_vat_period_end_statement.vat_statement', docargs)
47+
return vals
5048

5149
def _get_statement(self, statement_id):
5250
statement_obj = self.env['account.vat.period.end.statement']

0 commit comments

Comments
 (0)