← Back to team overview

openerp-community-reviewer team mailing list archive

lp:~agilebg/account-invoicing/adding_invoice_line_description_7 into lp:account-invoicing

 

Alex Comba - Agile BG has proposed merging lp:~agilebg/account-invoicing/adding_invoice_line_description_7 into lp:account-invoicing.

Commit message:
[ADD] module invoice_line_description

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

For more details, see:
https://code.launchpad.net/~agilebg/account-invoicing/adding_invoice_line_description_7/+merge/202407

Added the module 'invoice_line_description'. It allows to use only the product description on the invoice order lines.
To do so, the user has to belong to group_use_product_description_per_inv_line.
This is possible by selecting the related option in the following menu:

Settings --> Configuration --> Invoicing --> Features
-- 
https://code.launchpad.net/~agilebg/account-invoicing/adding_invoice_line_description_7/+merge/202407
Your team Account Core Editors is requested to review the proposed merge of lp:~agilebg/account-invoicing/adding_invoice_line_description_7 into lp:account-invoicing.
=== added directory 'invoice_line_description'
=== added file 'invoice_line_description/__init__.py'
--- invoice_line_description/__init__.py	1970-01-01 00:00:00 +0000
+++ invoice_line_description/__init__.py	2014-01-21 08:18:04 +0000
@@ -0,0 +1,22 @@
+# -*- coding: utf-8 -*-
+##############################################################################
+#
+#    Copyright (C) 2013 Agile Business Group sagl
+#	 (<http://www.agilebg.com>)
+#
+#    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/>.
+#
+##############################################################################
+import res_config
+import invoice

=== added file 'invoice_line_description/__openerp__.py'
--- invoice_line_description/__openerp__.py	1970-01-01 00:00:00 +0000
+++ invoice_line_description/__openerp__.py	2014-01-21 08:18:04 +0000
@@ -0,0 +1,46 @@
+# -*- coding: utf-8 -*-
+##############################################################################
+#
+#    Copyright (C) 2013 Agile Business Group sagl
+#    (<http://www.agilebg.com>)
+#    @author Alex Comba <alex.comba@xxxxxxxxxxx>
+#
+#    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': "Invoice line description",
+    'version': '0.1',
+    'category': 'Generic Modules/Accounting',
+    'description': """
+This module allows to use only the product description on the invoice
+order lines. To do so, the user has to belong to
+group_use_product_description_per_inv_line.
+This is possible by selecting the related option in the following menu:
+
+Settings --> Configuration --> Invoicing --> Features
+    """,
+    'author': 'Agile Business Group',
+    'website': 'http://www.agilebg.com',
+    'license': 'AGPL-3',
+    "depends": [
+        'account',
+    ],
+    "data": [
+        'security/invoice_security.xml',
+        'res_config_view.xml',
+    ],
+    "active": False,
+    "installable": True
+}

=== added directory 'invoice_line_description/i18n'
=== added file 'invoice_line_description/i18n/invoice_line_description.pot'
--- invoice_line_description/i18n/invoice_line_description.pot	1970-01-01 00:00:00 +0000
+++ invoice_line_description/i18n/invoice_line_description.pot	2014-01-21 08:18:04 +0000
@@ -0,0 +1,44 @@
+# Translation of OpenERP Server.
+# This file contains the translation of the following modules:
+#	* invoice_line_description
+#
+msgid ""
+msgstr ""
+"Project-Id-Version: OpenERP Server 7.0\n"
+"Report-Msgid-Bugs-To: \n"
+"POT-Creation-Date: 2014-01-20 13:17+0000\n"
+"PO-Revision-Date: 2014-01-20 13:17+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_line_description
+#: help:account.config.settings,group_use_product_description_per_inv_line:0
+msgid "Allows you to use only product sale description on the\n"
+"            invoice order lines."
+msgstr ""
+
+#. module: invoice_line_description
+#: field:account.config.settings,group_use_product_description_per_inv_line:0
+msgid "Allow using only the product sale description\n"
+"            on the invoice order lines"
+msgstr ""
+
+#. module: invoice_line_description
+#: model:res.groups,name:invoice_line_description.group_use_product_description_per_inv_line
+msgid "Use only product sale description on invoice lines"
+msgstr ""
+
+#. module: invoice_line_description
+#: model:ir.model,name:invoice_line_description.model_account_invoice_line
+msgid "Invoice Line"
+msgstr ""
+
+#. module: invoice_line_description
+#: model:ir.model,name:invoice_line_description.model_account_config_settings
+msgid "account.config.settings"
+msgstr ""
+

=== added file 'invoice_line_description/i18n/it.po'
--- invoice_line_description/i18n/it.po	1970-01-01 00:00:00 +0000
+++ invoice_line_description/i18n/it.po	2014-01-21 08:18:04 +0000
@@ -0,0 +1,50 @@
+# Translation of OpenERP Server.
+# This file contains the translation of the following modules:
+# 	* invoice_line_description
+#
+msgid ""
+msgstr ""
+"Project-Id-Version: OpenERP Server 7.0\n"
+"Report-Msgid-Bugs-To: \n"
+"POT-Creation-Date: 2014-01-20 14:08+0000\n"
+"PO-Revision-Date: 2014-01-20 15:09+0100\n"
+"Last-Translator: Alex Comba <alex.comba@xxxxxxxxxxx>\n"
+"Language-Team: \n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+"Plural-Forms: \n"
+"X-Generator: Poedit 1.5.4\n"
+
+#. module: invoice_line_description
+#: model:res.groups,name:invoice_line_description.group_use_product_description_per_inv_line
+msgid "Use only product description on invoice lines"
+msgstr "Usa solo la descrizione del prodotto sulle righe della fattura"
+
+#. module: invoice_line_description
+#: help:account.config.settings,group_use_product_description_per_inv_line:0
+msgid ""
+"Allows you to use only product description on the\n"
+"            invoice order lines."
+msgstr ""
+"Permette di usare solamente la descrizione del prodotto sulle\n"
+"            righe della fattura."
+
+#. module: invoice_line_description
+#: field:account.config.settings,group_use_product_description_per_inv_line:0
+msgid ""
+"Allow using only the product description on the\n"
+"            invoice order lines"
+msgstr ""
+"Permette di usare solamente la descrizione del prodotto sulle\n"
+"            righe della fattura"
+
+#. module: invoice_line_description
+#: model:ir.model,name:invoice_line_description.model_account_invoice_line
+msgid "Invoice Line"
+msgstr "Righe Fattura"
+
+#. module: invoice_line_description
+#: model:ir.model,name:invoice_line_description.model_account_config_settings
+msgid "account.config.settings"
+msgstr "account.config.settings"

=== added file 'invoice_line_description/invoice.py'
--- invoice_line_description/invoice.py	1970-01-01 00:00:00 +0000
+++ invoice_line_description/invoice.py	2014-01-21 08:18:04 +0000
@@ -0,0 +1,59 @@
+# -*- coding: utf-8 -*-
+##############################################################################
+#
+#    Copyright (C) 2013 Agile Business Group sagl
+#    (<http://www.agilebg.com>)
+#
+#    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
+
+
+class account_invoice_line(orm.Model):
+    _inherit = "account.invoice.line"
+
+    def product_id_change(
+        self, cr, uid, ids, product_id, uom_id, qty=0,
+        name='', type='out_invoice', partner_id=False, fposition_id=False,
+        price_unit=False, currency_id=False, context=None, company_id=None
+    ):
+        res = super(account_invoice_line, self).product_id_change(
+            cr, uid, ids, product_id, uom_id, qty=qty,
+            name=name, type=type, partner_id=partner_id,
+            fposition_id=fposition_id, price_unit=price_unit,
+            currency_id=currency_id, context=context, company_id=company_id
+        )
+        if product_id:
+            user = self.pool.get('res.users').browse(
+                cr, uid, uid, context=context)
+            user_groups = [g.id for g in user.groups_id]
+            ref = self.pool.get('ir.model.data').get_object_reference(
+                cr, uid, 'invoice_line_description',
+                'group_use_product_description_per_inv_line'
+            )
+            if ref and len(ref) > 1 and ref[1]:
+                group_id = ref[1]
+                if group_id in user_groups:
+                    product_obj = self.pool.get('product.product')
+                    product = product_obj.browse(
+                        cr, uid, product_id, context=context)
+                    if (
+                        product
+                        and product.description
+                        and 'value' in res
+                    ):
+                        res['value']['name'] = product.description
+        return res

=== added file 'invoice_line_description/res_config.py'
--- invoice_line_description/res_config.py	1970-01-01 00:00:00 +0000
+++ invoice_line_description/res_config.py	2014-01-21 08:18:04 +0000
@@ -0,0 +1,37 @@
+# -*- coding: utf-8 -*-
+##############################################################################
+#
+#    Copyright (C) 2013 Agile Business Group sagl
+#    (<http://www.agilebg.com>)
+#
+#    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 fields, osv
+
+
+class account_config_settings(osv.TransientModel):
+    _inherit = 'account.config.settings'
+
+    _columns = {
+        'group_use_product_description_per_inv_line': fields.boolean(
+            """Allow using only the product description on the
+            invoice order lines""",
+            implied_group="invoice_line_description."
+            "group_use_product_description_per_inv_line",
+            help="""Allows you to use only product description on the
+            invoice order lines."""
+        ),
+    }

=== added file 'invoice_line_description/res_config_view.xml'
--- invoice_line_description/res_config_view.xml	1970-01-01 00:00:00 +0000
+++ invoice_line_description/res_config_view.xml	2014-01-21 08:18:04 +0000
@@ -0,0 +1,20 @@
+<?xml version="1.0" encoding="utf-8"?>
+<openerp>
+    <data>
+
+        <record id="view_account_config" model="ir.ui.view">
+            <field name="name">account settings</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="//label[@for='module_account_budget']" position="after">
+                    <div>
+                        <field name="group_use_product_description_per_inv_line" class="oe_inline"/>
+                        <label for="group_use_product_description_per_inv_line"/>
+                    </div>
+                </xpath>
+            </field>
+        </record>
+
+    </data>
+</openerp>
\ No newline at end of file

=== added directory 'invoice_line_description/security'
=== added file 'invoice_line_description/security/invoice_security.xml'
--- invoice_line_description/security/invoice_security.xml	1970-01-01 00:00:00 +0000
+++ invoice_line_description/security/invoice_security.xml	2014-01-21 08:18:04 +0000
@@ -0,0 +1,13 @@
+<?xml version="1.0" encoding="utf-8"?>
+<openerp>
+
+    <data noupdate="0">
+
+        <record id="group_use_product_description_per_inv_line" model="res.groups">
+            <field name="name">Use only product description on invoice lines</field>
+            <field name="category_id" ref="base.module_category_hidden"/>
+        </record>
+
+    </data>
+
+</openerp>


Follow ups