← Back to team overview

openerp-community-reviewer team mailing list archive

lp:~camptocamp/account-invoice-report/7.0-add-invoice_report_assemble-yvr into lp:account-invoice-report

 

Yannick Vaucher @ Camptocamp has proposed merging lp:~camptocamp/account-invoice-report/7.0-add-invoice_report_assemble-yvr into lp:account-invoice-report.

Requested reviews:
  Account Core Editors (account-core-editors)

For more details, see:
https://code.launchpad.net/~camptocamp/account-invoice-report/7.0-add-invoice_report_assemble-yvr/+merge/194204
-- 
https://code.launchpad.net/~camptocamp/account-invoice-report/7.0-add-invoice_report_assemble-yvr/+merge/194204
Your team OpenERP Community Reviewer is subscribed to branch lp:account-invoice-report.
=== added directory 'invoice_report_assemble'
=== added file 'invoice_report_assemble/__init__.py'
--- invoice_report_assemble/__init__.py	1970-01-01 00:00:00 +0000
+++ invoice_report_assemble/__init__.py	2013-11-06 18:03:31 +0000
@@ -0,0 +1,24 @@
+# -*- coding: utf-8 -*-
+##############################################################################
+#
+#    Author: Yannick Vaucher
+#    Copyright 2013 Camptocamp SA
+#
+#    This program is free software: you can redistribute it and/or modify
+#    it under the terms of the GNU Affero General Public License as
+#    published by the Free Software Foundation, either version 3 of the
+#    License, or (at your option) any later version.
+#
+#    This program is distributed in the hope that it will be useful,
+#    but WITHOUT ANY WARRANTY; without even the implied warranty of
+#    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+#    GNU Affero General Public License for more details.
+#
+#    You should have received a copy of the GNU Affero General Public License
+#    along with this program.  If not, see <http://www.gnu.org/licenses/>.
+#
+##############################################################################
+from . import report_assembler
+from . import company
+from . import res_config
+

=== added file 'invoice_report_assemble/__openerp__.py'
--- invoice_report_assemble/__openerp__.py	1970-01-01 00:00:00 +0000
+++ invoice_report_assemble/__openerp__.py	2013-11-06 18:03:31 +0000
@@ -0,0 +1,41 @@
+# -*- coding: utf-8 -*-
+##############################################################################
+#
+#    Author: Yannick Vaucher
+#    Copyright 2013 Camptocamp SA
+#
+#    This program is free software: you can redistribute it and/or modify
+#    it under the terms of the GNU Affero General Public License as
+#    published by the Free Software Foundation, either version 3 of the
+#    License, or (at your option) any later version.
+#
+#    This program is distributed in the hope that it will be useful,
+#    but WITHOUT ANY WARRANTY; without even the implied warranty of
+#    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+#    GNU Affero General Public License for more details.
+#
+#    You should have received a copy of the GNU Affero General Public License
+#    along with this program.  If not, see <http://www.gnu.org/licenses/>.
+#
+##############################################################################
+{'name' : 'Assemble invoice report',
+ 'version' : '1.0',
+ 'category': '',
+ 'description': """Add a printing button to print an invoice report assembled
+ like assembling invoice webkit with bvr payment slip in a single report.
+ It can be either of the generated invoice report""",
+ 'author' : 'Camptocamp',
+ 'maintainer': 'Camptocamp',
+ 'website': 'http://www.camptocamp.com/',
+ 'depends' : [
+     'base_report_assembler',
+     'account'],
+ 'data': [
+     'invoice_report.xml',
+     'res_config_view.xml',
+     ],
+ 'test': [],
+ 'installable': True,
+ 'auto_install': False,
+ 'application': True,
+ }

=== added file 'invoice_report_assemble/company.py'
--- invoice_report_assemble/company.py	1970-01-01 00:00:00 +0000
+++ invoice_report_assemble/company.py	2013-11-06 18:03:31 +0000
@@ -0,0 +1,32 @@
+# -*- coding: utf-8 -*-
+##############################################################################
+#
+#    Author: Yannick Vaucher
+#    Copyright 2013 Camptocamp SA
+#
+#    This program is free software: you can redistribute it and/or modify
+#    it under the terms of the GNU Affero General Public License as
+#    published by the Free Software Foundation, either version 3 of the
+#    License, or (at your option) any later version.
+#
+#    This program is distributed in the hope that it will be useful,
+#    but WITHOUT ANY WARRANTY; without even the implied warranty of
+#    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+#    GNU Affero General Public License for more details.
+#
+#    You should have received a copy of the GNU Affero General Public License
+#    along with this program.  If not, see <http://www.gnu.org/licenses/>.
+#
+##############################################################################
+from openerp.osv import orm, fields
+
+
+class ResCompany(orm.Model):
+    _inherit = 'res.company'
+
+    _columns = {
+        'assemble_invoice_report_ids': fields.one2many(
+            'assembled.report', 'company_id',
+            'Account Invoice Assemblage Report',
+            domain=[('model', '=', 'account.invoice')]),
+        }

=== added directory 'invoice_report_assemble/i18n'
=== added file 'invoice_report_assemble/i18n/fr.po'
--- invoice_report_assemble/i18n/fr.po	1970-01-01 00:00:00 +0000
+++ invoice_report_assemble/i18n/fr.po	2013-11-06 18:03:31 +0000
@@ -0,0 +1,54 @@
+# Translation of OpenERP Server.
+# This file contains the translation of the following modules:
+#	* invoice_report_assemble
+#
+msgid ""
+msgstr ""
+"Project-Id-Version: OpenERP Server 7.0\n"
+"Report-Msgid-Bugs-To: \n"
+"POT-Creation-Date: 2013-11-05 15:01+0000\n"
+"PO-Revision-Date: 2013-11-05 15:01+0000\n"
+"Last-Translator: <>\n"
+"Language-Team: \n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: \n"
+"Plural-Forms: \n"
+
+#. module: invoice_report_assemble
+#: field:account.config.settings,assemble_invoice_report_ids:0
+msgid "Account Invoice Report Assemblage"
+msgstr "Assemblage de rapport de facture"
+
+#. module: invoice_report_assemble
+#: model:ir.model,name:invoice_report_assemble.model_res_company
+msgid "Companies"
+msgstr "Sociétés"
+
+#. module: invoice_report_assemble
+#: model:ir.actions.report.xml,name:invoice_report_assemble.invoice_report_assemblage
+msgid "Invoice Assemblage"
+msgstr "Assemblage de facture"
+
+#. module: invoice_report_assemble
+#: view:account.config.settings:0
+msgid "Invoice report assemblage"
+msgstr "Assemblage de rapport de facture"
+
+#. module: invoice_report_assemble
+#: code:addons/invoice_report_assemble/report_assembler.py:37
+#, python-format
+msgid "No report defined in Configuration -> Accounting for model invoice."
+msgstr "Pas de rapport défini dans Configuration -> Finance pour les factures."
+
+#. module: invoice_report_assemble
+#: code:addons/invoice_report_assemble/report_assembler.py:38
+#, python-format
+msgid "Error"
+msgstr "Erreur"
+
+#. module: invoice_report_assemble
+#: field:res.company,assemble_invoice_report_ids:0
+msgid "Account Invoice Assemblage Report"
+msgstr "Assemblage de rapport de facture"
+

=== added file 'invoice_report_assemble/i18n/invoice_report_assemble.pot'
--- invoice_report_assemble/i18n/invoice_report_assemble.pot	1970-01-01 00:00:00 +0000
+++ invoice_report_assemble/i18n/invoice_report_assemble.pot	2013-11-06 18:03:31 +0000
@@ -0,0 +1,54 @@
+# Translation of OpenERP Server.
+# This file contains the translation of the following modules:
+#	* invoice_report_assemble
+#
+msgid ""
+msgstr ""
+"Project-Id-Version: OpenERP Server 7.0\n"
+"Report-Msgid-Bugs-To: \n"
+"POT-Creation-Date: 2013-11-05 15:01+0000\n"
+"PO-Revision-Date: 2013-11-05 15:01+0000\n"
+"Last-Translator: <>\n"
+"Language-Team: \n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: \n"
+"Plural-Forms: \n"
+
+#. module: invoice_report_assemble
+#: field:account.config.settings,assemble_invoice_report_ids:0
+msgid "Account Invoice Report Assemblage"
+msgstr ""
+
+#. module: invoice_report_assemble
+#: model:ir.model,name:invoice_report_assemble.model_res_company
+msgid "Companies"
+msgstr ""
+
+#. module: invoice_report_assemble
+#: model:ir.actions.report.xml,name:invoice_report_assemble.invoice_report_assemblage
+msgid "Invoice Assemblage"
+msgstr ""
+
+#. module: invoice_report_assemble
+#: view:account.config.settings:0
+msgid "Invoice report assemblage"
+msgstr ""
+
+#. module: invoice_report_assemble
+#: code:addons/invoice_report_assemble/report_assembler.py:37
+#, python-format
+msgid "No report defined in Configuration -> Accounting for model invoice."
+msgstr ""
+
+#. module: invoice_report_assemble
+#: code:addons/invoice_report_assemble/report_assembler.py:38
+#, python-format
+msgid "Error"
+msgstr ""
+
+#. module: invoice_report_assemble
+#: field:res.company,assemble_invoice_report_ids:0
+msgid "Account Invoice Assemblage Report"
+msgstr ""
+

=== added file 'invoice_report_assemble/invoice_report.xml'
--- invoice_report_assemble/invoice_report.xml	1970-01-01 00:00:00 +0000
+++ invoice_report_assemble/invoice_report.xml	2013-11-06 18:03:31 +0000
@@ -0,0 +1,15 @@
+<?xml version="1.0" encoding="utf-8"?>
+<openerp>
+    <data>
+        <report
+            auto="False"
+            id="invoice_report_assemblage"
+            model="account.invoice"
+            name="invoice_report_assemblage"
+            string="Invoice Assemblage"
+            attachment="(object.state in ('open','paid')) and ('INV_BVR'+(object.number or '').replace('/',''))"
+            attachment_use="0"
+            multi="True"
+            report_type="assemblage"/>
+    </data>
+</openerp>

=== added file 'invoice_report_assemble/report_assembler.py'
--- invoice_report_assemble/report_assembler.py	1970-01-01 00:00:00 +0000
+++ invoice_report_assemble/report_assembler.py	2013-11-06 18:03:31 +0000
@@ -0,0 +1,43 @@
+# -*- coding: utf-8 -*-
+##############################################################################
+#
+#    Author: Yannick Vaucher
+#    Copyright 2013 Camptocamp SA
+#
+#    This program is free software: you can redistribute it and/or modify
+#    it under the terms of the GNU Affero General Public License as
+#    published by the Free Software Foundation, either version 3 of the
+#    License, or (at your option) any later version.
+#
+#    This program is distributed in the hope that it will be useful,
+#    but WITHOUT ANY WARRANTY; without even the implied warranty of
+#    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+#    GNU Affero General Public License for more details.
+#
+#    You should have received a copy of the GNU Affero General Public License
+#    along with this program.  If not, see <http://www.gnu.org/licenses/>.
+#
+##############################################################################
+
+from openerp import pooler
+from openerp.osv import orm
+from openerp.tools.translate import _
+from openerp.addons.base_report_assembler import report_assembler
+
+
+class InvoicePDFReportAssembler(report_assembler.PDFReportAssembler):
+    """InvoicePDFReportAssembler allows to put multiple invoice reports in one single pdf"""
+
+    def _get_report_ids(self, cr, uid, ids, context=None):
+        pool = pooler.get_pool(cr.dbname)
+        user_obj = pool.get('res.users')
+        company = user_obj.browse(cr, uid, uid, context=context).company_id
+        report_ids = [r.report_id.id for r in company.assemble_invoice_report_ids]
+        if not report_ids:
+            msg = _("No report defined in Configuration -> Accounting for model invoice.")
+            raise orm.except_orm(_('Error'), msg)
+        return report_ids
+
+InvoicePDFReportAssembler('report.invoice_report_assemblage',
+                          'account.invoice',
+                          None)

=== added file 'invoice_report_assemble/res_config.py'
--- invoice_report_assemble/res_config.py	1970-01-01 00:00:00 +0000
+++ invoice_report_assemble/res_config.py	2013-11-06 18:03:31 +0000
@@ -0,0 +1,38 @@
+# -*- coding: utf-8 -*-
+##############################################################################
+#
+#    Author: Yannick Vaucher
+#    Copyright 2013 Camptocamp SA
+#
+#    This program is free software: you can redistribute it and/or modify
+#    it under the terms of the GNU Affero General Public License as
+#    published by the Free Software Foundation, either version 3 of the
+#    License, or (at your option) any later version.
+#
+#    This program is distributed in the hope that it will be useful,
+#    but WITHOUT ANY WARRANTY; without even the implied warranty of
+#    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+#    GNU Affero General Public License for more details.
+#
+#    You should have received a copy of the GNU Affero General Public License
+#    along with this program.  If not, see <http://www.gnu.org/licenses/>.
+#
+##############################################################################
+from openerp.osv import orm, fields
+
+
+class AccountConfigSettings(orm.TransientModel):
+    _inherit = 'account.config.settings'
+
+    _columns = {
+        'assemble_invoice_report_ids': fields.related(
+            'company_id', 'assemble_invoice_report_ids',
+            string='Account Invoice Report Assemblage',
+            type='one2many', relation='assembled.report'),
+        }
+
+    def onchange_company_id(self, cr, uid, ids, company_id, context=None):
+        res = super(AccountConfigSettings, self).onchange_company_id(cr, uid, ids, company_id, context=context)
+        company = self.pool.get('res.company').browse(cr, uid, company_id, context=context)
+        res['value']['assemble_invoice_report_ids'] = [r.id for r in company.assemble_invoice_report_ids]
+        return res

=== added file 'invoice_report_assemble/res_config_view.xml'
--- invoice_report_assemble/res_config_view.xml	1970-01-01 00:00:00 +0000
+++ invoice_report_assemble/res_config_view.xml	2013-11-06 18:03:31 +0000
@@ -0,0 +1,27 @@
+<?xml version="1.0" encoding="utf-8"?>
+<openerp>
+  <data>
+
+    <record id="view_account_config_settings" model="ir.ui.view">
+      <field name="name">account settings.add.invoice.assemble</field>
+      <field name="model">account.config.settings</field>
+      <field name="inherit_id" ref="account.view_account_config_settings"/>
+      <field name="arch" type="xml">
+        <xpath expr="//field[@name='module_account_followup']/ancestor::div[1]" position="after">
+          <div>
+            <label for="assemble_invoice_report_ids" string="Invoice report assemblage"/>
+            <field name="assemble_invoice_report_ids" context="{'default_model': 'account.invoice'}">
+              <tree editable="bottom">
+                <field name="report_id"/>
+                <field name="model" invisible="True"/>
+                <field name="sequence" invisible="True"/>
+                <field name="company_id" invisible="True"/>
+              </tree>
+            </field>
+          </div>
+        </xpath>
+      </field>
+    </record>
+
+  </data>
+</openerp>

=== added directory 'invoice_report_assemble/security'

References