Skip to content

Commit

Permalink
Merge pull request #133 from tafaRU/8.0-account_invoice_line_descript…
Browse files Browse the repository at this point in the history
…ion-fix

[FIX] account_invoice_line_description: use description_sale or description_purchase depending on the invoice type
  • Loading branch information
pedrobaeza committed Mar 2, 2016
2 parents b6d3c65 + 7a105fe commit df120d3
Show file tree
Hide file tree
Showing 3 changed files with 24 additions and 7 deletions.
21 changes: 17 additions & 4 deletions account_invoice_line_description/README.rst
@@ -1,10 +1,12 @@
.. image:: https://img.shields.io/badge/licence-AGPL--3-blue.svg
:alt: License: AGPL-3

================================
Account invoice line description
================================

This module allows to use only the product description on the invoice lines.
This module allows to use only the sale description or the purchase description
on the invoice lines depending on the invoice type.

Configuration
=============
Expand All @@ -14,6 +16,12 @@ This is possible by selecting the related option in the following menu:

* Settings --> Configuration --> Invoicing --> Features

Usage
=====

.. image:: https://odoo-community.org/website/image/ir.attachment/5784_f2813bd/datas
:alt: Try me on Runbot
:target: https://runbot.odoo-community.org/runbot/95/8.0

Bug Tracker
===========
Expand All @@ -27,6 +35,11 @@ If you spotted it first, help us smashing it by providing a detailed and welcome
Credits
=======

Images
------

* Odoo Community Association: `Icon <https://github.com/OCA/maintainer-tools/blob/master/template/module/static/description/icon.svg>`_.

Contributors
------------

Expand All @@ -35,14 +48,14 @@ Contributors
Maintainer
----------

.. image:: http://odoo-community.org/logo.png
.. image:: https://odoo-community.org/logo.png
:alt: Odoo Community Association
:target: http://odoo-community.org
:target: https://odoo-community.org

This module is maintained by the OCA.

OCA, or the Odoo Community Association, is a nonprofit organization whose
mission is to support the collaborative development of Odoo features and
promote its widespread use.

To contribute to this module, please visit http://odoo-community.org.
To contribute to this module, please visit https://odoo-community.org.
2 changes: 1 addition & 1 deletion account_invoice_line_description/__openerp__.py
Expand Up @@ -20,7 +20,7 @@
##############################################################################
{
'name': "Account invoice line description",
'version': '8.0.1.0.0',
'version': '8.0.1.0.1',
'category': 'Generic Modules/Accounting',
'author': "Agile Business Group, Odoo Community Association (OCA)",
'website': 'http://www.agilebg.com',
Expand Down
8 changes: 6 additions & 2 deletions account_invoice_line_description/invoice.py
Expand Up @@ -43,8 +43,12 @@ def product_id_change(
'group_use_product_description_per_inv_line',
):
product = self.env['product.product'].browse(product)
if product.description:
description = ((product.description_sale
if type in ('out_invoice', 'out_refund')
else product.description_purchase) or
product.description)
if description:
if 'value' not in res:
res['value'] = {}
res['value']['name'] = product.description
res['value']['name'] = description
return res

0 comments on commit df120d3

Please sign in to comment.