From eaaa326fdc783ae0be6f32d20f9265d481cb87e8 Mon Sep 17 00:00:00 2001 From: Ahmed Aly Date: Thu, 12 Oct 2017 11:50:58 +0200 Subject: [PATCH] Fixed dp_reports + removed untested module dp_sequence_date_range_monthly --- ext/custom-addons/dp_custom/__init__.py | 2 +- .../dp_custom/models/__init__.py | 2 +- .../dp_custom/models/ir_ui_menu.py | 10 +-- ext/custom-addons/dp_reports/__manifest__.py | 5 +- .../dp_reports/models/__init__.py | 3 +- .../dp_reports/models/report_helper.py | 16 +---- .../dp_reports/models/res_company.py | 9 +++ .../{layouts.xml => report_templates.xml} | 34 +++++----- .../dp_reports_account/__manifest__.py | 3 +- .../dp_reports_account/models/__init__.py | 2 +- .../models/report_helper.py | 13 ++++ .../dp_reports_account/reports/invoice.xml | 17 +++-- .../dp_reports_purchase/models/__init__.py | 2 +- .../models/report_helper.py | 27 ++++++++ .../dp_reports_purchase/reports/purchase.xml | 6 +- .../reports/purchasequotation.xml | 7 +- .../dp_reports_sale/models/__init__.py | 2 +- .../dp_reports_sale/models/report_helper.py | 12 ++++ .../dp_reports_sale/reports/sale.xml | 6 +- .../dp_reports_stock/models/__init__.py | 2 +- .../dp_reports_stock/models/report_helper.py | 12 ++++ .../dp_reports_stock/reports/stock.xml | 22 +++---- .../__init__.py | 24 ------- .../__manifest__.py | 41 ------------ .../models/__init__.py | 26 -------- .../models/ir_sequence.py | 60 ------------------ .../static/description/icon.png | Bin 2225 -> 0 bytes .../views/ir_sequence_view.xml | 18 ------ 28 files changed, 139 insertions(+), 244 deletions(-) create mode 100644 ext/custom-addons/dp_reports/models/res_company.py rename ext/custom-addons/dp_reports/reports/{layouts.xml => report_templates.xml} (85%) delete mode 100644 ext/custom-addons/dp_sequence_date_range_monthly/__init__.py delete mode 100644 ext/custom-addons/dp_sequence_date_range_monthly/__manifest__.py delete mode 100644 ext/custom-addons/dp_sequence_date_range_monthly/models/__init__.py delete mode 100644 ext/custom-addons/dp_sequence_date_range_monthly/models/ir_sequence.py delete mode 100644 ext/custom-addons/dp_sequence_date_range_monthly/static/description/icon.png delete mode 100644 ext/custom-addons/dp_sequence_date_range_monthly/views/ir_sequence_view.xml diff --git a/ext/custom-addons/dp_custom/__init__.py b/ext/custom-addons/dp_custom/__init__.py index f6229e8e..150d68eb 100644 --- a/ext/custom-addons/dp_custom/__init__.py +++ b/ext/custom-addons/dp_custom/__init__.py @@ -19,6 +19,6 @@ # ############################################################################## -import models +from . import models # vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4: diff --git a/ext/custom-addons/dp_custom/models/__init__.py b/ext/custom-addons/dp_custom/models/__init__.py index 5453b95c..206b51a6 100644 --- a/ext/custom-addons/dp_custom/models/__init__.py +++ b/ext/custom-addons/dp_custom/models/__init__.py @@ -19,7 +19,7 @@ # ############################################################################## -import ir_ui_menu +from . import ir_ui_menu # vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4: diff --git a/ext/custom-addons/dp_custom/models/ir_ui_menu.py b/ext/custom-addons/dp_custom/models/ir_ui_menu.py index c8629de8..546793a8 100644 --- a/ext/custom-addons/dp_custom/models/ir_ui_menu.py +++ b/ext/custom-addons/dp_custom/models/ir_ui_menu.py @@ -19,11 +19,11 @@ # ############################################################################## -from openerp import fields, models -from openerp import api -from openerp.tools.translate import _ -from openerp import SUPERUSER_ID -from openerp import tools +from odoo import fields, models +from odoo import api +from odoo.tools.translate import _ +from odoo import SUPERUSER_ID +from odoo import tools DISABLED_MENUS = [ ] diff --git a/ext/custom-addons/dp_reports/__manifest__.py b/ext/custom-addons/dp_reports/__manifest__.py index 8a7565b3..8ffc6a3a 100644 --- a/ext/custom-addons/dp_reports/__manifest__.py +++ b/ext/custom-addons/dp_reports/__manifest__.py @@ -10,12 +10,11 @@ 'author': 'datenpol gmbh', 'website': 'http://www.datenpol.at/', 'depends': [ - 'base', - 'report' + 'base' ], 'data': [ 'data/paperformat.xml', - 'reports/layouts.xml', + 'reports/report_templates.xml', ], # only loaded in demonstration mode 'demo': [], diff --git a/ext/custom-addons/dp_reports/models/__init__.py b/ext/custom-addons/dp_reports/models/__init__.py index 8daea8e4..abb1bf24 100644 --- a/ext/custom-addons/dp_reports/models/__init__.py +++ b/ext/custom-addons/dp_reports/models/__init__.py @@ -1,3 +1,4 @@ # -*- coding: utf-8 -*- -import report_helper +from . import report_helper +from . import res_company diff --git a/ext/custom-addons/dp_reports/models/report_helper.py b/ext/custom-addons/dp_reports/models/report_helper.py index 2a1d04d5..462cac2c 100644 --- a/ext/custom-addons/dp_reports/models/report_helper.py +++ b/ext/custom-addons/dp_reports/models/report_helper.py @@ -1,15 +1,8 @@ from odoo import api, models -from odoo.report import report_sxw -class ReportHelper(report_sxw.rml_parse): - - def __init__(self, cr, uid, name, context): - super(ReportHelper, self).__init__(cr, uid, name, context=context) - self.localcontext.update({ - 'field_set_in_lines': self._field_set_in_lines, - 'formatLang': self._formatLang, - }) +class ReportHelper(models.AbstractModel): + _name = "report.abstract_report" @api.model def _field_set_in_lines(self, lines, field): @@ -44,8 +37,3 @@ class ReportHelper(report_sxw.rml_parse): elif currency_obj and currency_obj.position == 'before': res = '%s %s' % (currency_obj.symbol, res) return res - - -class AbstractReport(models.AbstractModel): - _inherit = 'report.abstract_report' - _wrapped_report_class = ReportHelper diff --git a/ext/custom-addons/dp_reports/models/res_company.py b/ext/custom-addons/dp_reports/models/res_company.py new file mode 100644 index 00000000..ef716a98 --- /dev/null +++ b/ext/custom-addons/dp_reports/models/res_company.py @@ -0,0 +1,9 @@ + + +from odoo import models, fields, api + + +class Company(models.Model): + _inherit = 'res.company' + + external_report_layout = fields.Selection(selection_add=[("custom", "Custom")]) diff --git a/ext/custom-addons/dp_reports/reports/layouts.xml b/ext/custom-addons/dp_reports/reports/report_templates.xml similarity index 85% rename from ext/custom-addons/dp_reports/reports/layouts.xml rename to ext/custom-addons/dp_reports/reports/report_templates.xml index 3b63e420..5ed9b315 100644 --- a/ext/custom-addons/dp_reports/reports/layouts.xml +++ b/ext/custom-addons/dp_reports/reports/report_templates.xml @@ -2,34 +2,36 @@ -