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

Proposed by Yannick Vaucher @ Camptocamp
Status: Merged
Approved by: Guewen Baconnier @ Camptocamp
Approved revision: 46
Merged at revision: 50
Proposed branch: lp:~camptocamp/account-invoice-report/7.0-add-invoice_report_assemble-yvr
Merge into: lp:~account-core-editors/account-invoice-report/7.0
Diff against target: 380 lines (+332/-0)
9 files modified
invoice_report_assemble/__init__.py (+24/-0)
invoice_report_assemble/__openerp__.py (+41/-0)
invoice_report_assemble/company.py (+32/-0)
invoice_report_assemble/i18n/fr.po (+54/-0)
invoice_report_assemble/i18n/invoice_report_assemble.pot (+54/-0)
invoice_report_assemble/invoice_report.xml (+15/-0)
invoice_report_assemble/report_assembler.py (+44/-0)
invoice_report_assemble/res_config.py (+41/-0)
invoice_report_assemble/res_config_view.xml (+27/-0)
To merge this branch: bzr merge lp:~camptocamp/account-invoice-report/7.0-add-invoice_report_assemble-yvr
Reviewer Review Type Date Requested Status
Nicolas Bessi - Camptocamp (community) code review, no test Approve
Guewen Baconnier @ Camptocamp Approve
Review via email: mp+194204@code.launchpad.net
To post a comment you must log in.
Revision history for this message
Yannick Vaucher @ Camptocamp (yvaucher-c2c) wrote :
Revision history for this message
Yannick Vaucher @ Camptocamp (yvaucher-c2c) wrote :
Revision history for this message
Guewen Baconnier @ Camptocamp (gbaconnier-c2c) wrote :

Nice! LGTM
Thanks

review: Approve
Revision history for this message
Guewen Baconnier @ Camptocamp (gbaconnier-c2c) wrote :

(base_report_assembler is a prerequisite and still in needs fixing)

Revision history for this message
Nicolas Bessi - Camptocamp (nbessi-c2c-deactivatedaccount) wrote :

base_report_assembler is approved still need an other positive advice

46. By Nicolas Bessi - Camptocamp

[PEP8]

Revision history for this message
Nicolas Bessi - Camptocamp (nbessi-c2c-deactivatedaccount) wrote :

Thanks for the MP.

Fixed some neat pick and added module in category Accounting.

LGTM

review: Approve (code review, no test)
Revision history for this message
Yannick Vaucher @ Camptocamp (yvaucher-c2c) wrote :

Thanks for the fixes

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
=== 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 2014-01-31 11:20:46 +0000
@@ -0,0 +1,24 @@
1# -*- coding: utf-8 -*-
2##############################################################################
3#
4# Author: Yannick Vaucher
5# Copyright 2013 Camptocamp SA
6#
7# This program is free software: you can redistribute it and/or modify
8# it under the terms of the GNU Affero General Public License as
9# published by the Free Software Foundation, either version 3 of the
10# License, or (at your option) any later version.
11#
12# This program is distributed in the hope that it will be useful,
13# but WITHOUT ANY WARRANTY; without even the implied warranty of
14# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15# GNU Affero General Public License for more details.
16#
17# You should have received a copy of the GNU Affero General Public License
18# along with this program. If not, see <http://www.gnu.org/licenses/>.
19#
20##############################################################################
21from . import report_assembler
22from . import company
23from . import res_config
24
025
=== added file 'invoice_report_assemble/__openerp__.py'
--- invoice_report_assemble/__openerp__.py 1970-01-01 00:00:00 +0000
+++ invoice_report_assemble/__openerp__.py 2014-01-31 11:20:46 +0000
@@ -0,0 +1,41 @@
1# -*- coding: utf-8 -*-
2##############################################################################
3#
4# Author: Yannick Vaucher
5# Copyright 2013 Camptocamp SA
6#
7# This program is free software: you can redistribute it and/or modify
8# it under the terms of the GNU Affero General Public License as
9# published by the Free Software Foundation, either version 3 of the
10# License, or (at your option) any later version.
11#
12# This program is distributed in the hope that it will be useful,
13# but WITHOUT ANY WARRANTY; without even the implied warranty of
14# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15# GNU Affero General Public License for more details.
16#
17# You should have received a copy of the GNU Affero General Public License
18# along with this program. If not, see <http://www.gnu.org/licenses/>.
19#
20##############################################################################
21{'name': 'Assemble invoice report',
22 'version': '1.0',
23 'category': 'Accounting',
24 'description': """Add a printing button to print an invoice report assembled
25 like assembling invoice webkit with bvr payment slip in a single report.
26 It can be either of the generated invoice report""",
27 'author': 'Camptocamp',
28 'maintainer': 'Camptocamp',
29 'website': 'http://www.camptocamp.com/',
30 'depends': [
31 'base_report_assembler',
32 'account'],
33 'data': [
34 'invoice_report.xml',
35 'res_config_view.xml',
36 ],
37 'test': [],
38 'installable': True,
39 'auto_install': False,
40 'application': True,
41 }
042
=== added file 'invoice_report_assemble/company.py'
--- invoice_report_assemble/company.py 1970-01-01 00:00:00 +0000
+++ invoice_report_assemble/company.py 2014-01-31 11:20:46 +0000
@@ -0,0 +1,32 @@
1# -*- coding: utf-8 -*-
2##############################################################################
3#
4# Author: Yannick Vaucher
5# Copyright 2013 Camptocamp SA
6#
7# This program is free software: you can redistribute it and/or modify
8# it under the terms of the GNU Affero General Public License as
9# published by the Free Software Foundation, either version 3 of the
10# License, or (at your option) any later version.
11#
12# This program is distributed in the hope that it will be useful,
13# but WITHOUT ANY WARRANTY; without even the implied warranty of
14# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15# GNU Affero General Public License for more details.
16#
17# You should have received a copy of the GNU Affero General Public License
18# along with this program. If not, see <http://www.gnu.org/licenses/>.
19#
20##############################################################################
21from openerp.osv import orm, fields
22
23
24class ResCompany(orm.Model):
25 _inherit = 'res.company'
26
27 _columns = {
28 'assemble_invoice_report_ids': fields.one2many(
29 'assembled.report', 'company_id',
30 'Account Invoice Assemblage Report',
31 domain=[('model', '=', 'account.invoice')]),
32 }
033
=== 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 2014-01-31 11:20:46 +0000
@@ -0,0 +1,54 @@
1# Translation of OpenERP Server.
2# This file contains the translation of the following modules:
3# * invoice_report_assemble
4#
5msgid ""
6msgstr ""
7"Project-Id-Version: OpenERP Server 7.0\n"
8"Report-Msgid-Bugs-To: \n"
9"POT-Creation-Date: 2013-11-05 15:01+0000\n"
10"PO-Revision-Date: 2013-11-05 15:01+0000\n"
11"Last-Translator: <>\n"
12"Language-Team: \n"
13"MIME-Version: 1.0\n"
14"Content-Type: text/plain; charset=UTF-8\n"
15"Content-Transfer-Encoding: \n"
16"Plural-Forms: \n"
17
18#. module: invoice_report_assemble
19#: field:account.config.settings,assemble_invoice_report_ids:0
20msgid "Account Invoice Report Assemblage"
21msgstr "Assemblage de rapport de facture"
22
23#. module: invoice_report_assemble
24#: model:ir.model,name:invoice_report_assemble.model_res_company
25msgid "Companies"
26msgstr "Sociétés"
27
28#. module: invoice_report_assemble
29#: model:ir.actions.report.xml,name:invoice_report_assemble.invoice_report_assemblage
30msgid "Invoice Assemblage"
31msgstr "Assemblage de facture"
32
33#. module: invoice_report_assemble
34#: view:account.config.settings:0
35msgid "Invoice report assemblage"
36msgstr "Assemblage de rapport de facture"
37
38#. module: invoice_report_assemble
39#: code:addons/invoice_report_assemble/report_assembler.py:37
40#, python-format
41msgid "No report defined in Configuration -> Accounting for model invoice."
42msgstr "Pas de rapport défini dans Configuration -> Finance pour les factures."
43
44#. module: invoice_report_assemble
45#: code:addons/invoice_report_assemble/report_assembler.py:38
46#, python-format
47msgid "Error"
48msgstr "Erreur"
49
50#. module: invoice_report_assemble
51#: field:res.company,assemble_invoice_report_ids:0
52msgid "Account Invoice Assemblage Report"
53msgstr "Assemblage de rapport de facture"
54
055
=== 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 2014-01-31 11:20:46 +0000
@@ -0,0 +1,54 @@
1# Translation of OpenERP Server.
2# This file contains the translation of the following modules:
3# * invoice_report_assemble
4#
5msgid ""
6msgstr ""
7"Project-Id-Version: OpenERP Server 7.0\n"
8"Report-Msgid-Bugs-To: \n"
9"POT-Creation-Date: 2013-11-05 15:01+0000\n"
10"PO-Revision-Date: 2013-11-05 15:01+0000\n"
11"Last-Translator: <>\n"
12"Language-Team: \n"
13"MIME-Version: 1.0\n"
14"Content-Type: text/plain; charset=UTF-8\n"
15"Content-Transfer-Encoding: \n"
16"Plural-Forms: \n"
17
18#. module: invoice_report_assemble
19#: field:account.config.settings,assemble_invoice_report_ids:0
20msgid "Account Invoice Report Assemblage"
21msgstr ""
22
23#. module: invoice_report_assemble
24#: model:ir.model,name:invoice_report_assemble.model_res_company
25msgid "Companies"
26msgstr ""
27
28#. module: invoice_report_assemble
29#: model:ir.actions.report.xml,name:invoice_report_assemble.invoice_report_assemblage
30msgid "Invoice Assemblage"
31msgstr ""
32
33#. module: invoice_report_assemble
34#: view:account.config.settings:0
35msgid "Invoice report assemblage"
36msgstr ""
37
38#. module: invoice_report_assemble
39#: code:addons/invoice_report_assemble/report_assembler.py:37
40#, python-format
41msgid "No report defined in Configuration -> Accounting for model invoice."
42msgstr ""
43
44#. module: invoice_report_assemble
45#: code:addons/invoice_report_assemble/report_assembler.py:38
46#, python-format
47msgid "Error"
48msgstr ""
49
50#. module: invoice_report_assemble
51#: field:res.company,assemble_invoice_report_ids:0
52msgid "Account Invoice Assemblage Report"
53msgstr ""
54
055
=== 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 2014-01-31 11:20:46 +0000
@@ -0,0 +1,15 @@
1<?xml version="1.0" encoding="utf-8"?>
2<openerp>
3 <data>
4 <report
5 auto="False"
6 id="invoice_report_assemblage"
7 model="account.invoice"
8 name="invoice_report_assemblage"
9 string="Invoice Assemblage"
10 attachment="(object.state in ('open','paid')) and ('INV_BVR'+(object.number or '').replace('/',''))"
11 attachment_use="0"
12 multi="True"
13 report_type="assemblage"/>
14 </data>
15</openerp>
016
=== 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 2014-01-31 11:20:46 +0000
@@ -0,0 +1,44 @@
1# -*- coding: utf-8 -*-
2##############################################################################
3#
4# Author: Yannick Vaucher
5# Copyright 2013 Camptocamp SA
6#
7# This program is free software: you can redistribute it and/or modify
8# it under the terms of the GNU Affero General Public License as
9# published by the Free Software Foundation, either version 3 of the
10# License, or (at your option) any later version.
11#
12# This program is distributed in the hope that it will be useful,
13# but WITHOUT ANY WARRANTY; without even the implied warranty of
14# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15# GNU Affero General Public License for more details.
16#
17# You should have received a copy of the GNU Affero General Public License
18# along with this program. If not, see <http://www.gnu.org/licenses/>.
19#
20##############################################################################
21
22from openerp import pooler
23from openerp.osv import orm
24from openerp.tools.translate import _
25from openerp.addons.base_report_assembler import report_assembler
26
27
28class InvoicePDFReportAssembler(report_assembler.PDFReportAssembler):
29 """InvoicePDFReportAssembler allows to merge multiple
30 invoice reports into one pdf"""
31
32 def _get_report_ids(self, cr, uid, ids, context=None):
33 pool = pooler.get_pool(cr.dbname)
34 user_obj = pool.get('res.users')
35 company = user_obj.browse(cr, uid, uid, context=context).company_id
36 report_ids = [r.report_id.id for r in company.assemble_invoice_report_ids]
37 if not report_ids:
38 msg = _("No report defined in Configuration -> Accounting for model invoice.")
39 raise orm.except_orm(_('Error'), msg)
40 return report_ids
41
42InvoicePDFReportAssembler('report.invoice_report_assemblage',
43 'account.invoice',
44 None)
045
=== 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 2014-01-31 11:20:46 +0000
@@ -0,0 +1,41 @@
1# -*- coding: utf-8 -*-
2##############################################################################
3#
4# Author: Yannick Vaucher
5# Copyright 2013 Camptocamp SA
6#
7# This program is free software: you can redistribute it and/or modify
8# it under the terms of the GNU Affero General Public License as
9# published by the Free Software Foundation, either version 3 of the
10# License, or (at your option) any later version.
11#
12# This program is distributed in the hope that it will be useful,
13# but WITHOUT ANY WARRANTY; without even the implied warranty of
14# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15# GNU Affero General Public License for more details.
16#
17# You should have received a copy of the GNU Affero General Public License
18# along with this program. If not, see <http://www.gnu.org/licenses/>.
19#
20##############################################################################
21from openerp.osv import orm, fields
22
23
24class AccountConfigSettings(orm.TransientModel):
25 _inherit = 'account.config.settings'
26
27 _columns = {
28 'assemble_invoice_report_ids': fields.related(
29 'company_id', 'assemble_invoice_report_ids',
30 string='Account Invoice Report Assemblage',
31 type='one2many', relation='assembled.report'),
32 }
33
34 def onchange_company_id(self, cr, uid, ids, company_id, context=None):
35 res = super(AccountConfigSettings, self).onchange_company_id(
36 cr, uid, ids, company_id, context=context)
37 company = self.pool.get('res.company').browse(cr, uid, company_id,
38 context=context)
39 r_ids = [r.id for r in company.assemble_invoice_report_ids]
40 res['value']['assemble_invoice_report_ids'] = r_ids
41 return res
042
=== 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 2014-01-31 11:20:46 +0000
@@ -0,0 +1,27 @@
1<?xml version="1.0" encoding="utf-8"?>
2<openerp>
3 <data>
4
5 <record id="view_account_config_settings" model="ir.ui.view">
6 <field name="name">account settings.add.invoice.assemble</field>
7 <field name="model">account.config.settings</field>
8 <field name="inherit_id" ref="account.view_account_config_settings"/>
9 <field name="arch" type="xml">
10 <xpath expr="//field[@name='module_account_followup']/ancestor::div[1]" position="after">
11 <div>
12 <label for="assemble_invoice_report_ids" string="Invoice report assemblage"/>
13 <field name="assemble_invoice_report_ids" context="{'default_model': 'account.invoice'}">
14 <tree editable="bottom">
15 <field name="report_id"/>
16 <field name="model" invisible="True"/>
17 <field name="sequence" invisible="True"/>
18 <field name="company_id" invisible="True"/>
19 </tree>
20 </field>
21 </div>
22 </xpath>
23 </field>
24 </record>
25
26 </data>
27</openerp>
028
=== added directory 'invoice_report_assemble/security'

Subscribers

People subscribed via source and target branches