Skip to content

Commit

Permalink
Merge PR #70 into 12.0
Browse files Browse the repository at this point in the history
Signed-off-by pedrobaeza
  • Loading branch information
OCA-git-bot committed Aug 13, 2019
2 parents 1d98146 + 4028960 commit 8130967
Show file tree
Hide file tree
Showing 32 changed files with 1,367 additions and 1 deletion.
135 changes: 135 additions & 0 deletions sale_layout_category_hide_detail/README.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,135 @@
================================
Sale layout category hide detail
================================

.. !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
!! This file is generated by oca-gen-addon-readme !!
!! changes will be overwritten. !!
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
.. |badge1| image:: https://img.shields.io/badge/maturity-Beta-yellow.png
:target: https://odoo-community.org/page/development-status
:alt: Beta
.. |badge2| image:: https://img.shields.io/badge/licence-AGPL--3-blue.png
:target: http://www.gnu.org/licenses/agpl-3.0-standalone.html
:alt: License: AGPL-3
.. |badge3| image:: https://img.shields.io/badge/github-OCA%2Fsale--reporting-lightgray.png?logo=github
:target: https://github.com/OCA/sale-reporting/tree/12.0/sale_layout_category_hide_detail
:alt: OCA/sale-reporting
.. |badge4| image:: https://img.shields.io/badge/weblate-Translate%20me-F47D42.png
:target: https://translation.odoo-community.org/projects/sale-reporting-12-0/sale-reporting-12-0-sale_layout_category_hide_detail
:alt: Translate me on Weblate
.. |badge5| image:: https://img.shields.io/badge/runbot-Try%20me-875A7B.png
:target: https://runbot.odoo-community.org/runbot/148/12.0
:alt: Try me on Runbot

|badge1| |badge2| |badge3| |badge4| |badge5|

This module allows you to check/uncheck the new 'Show details' and
'Show subtotal' flags in *Sale order section lines* and
*Customer invoice section lines* if you want to show or hide their
lines or their subtotals in the PDF report and in the website.

**Table of contents**

.. contents::
:local:

Usage
=====

To use this module, you need to:

#. Go to *Sales -> Orders -> Quotations* and create a new *Quotation*.
#. In *Order lines* tab add a section line.
#. Add some product lines.
#. Add another section line, but this time, click on the *plus-circle*
icon |plus-circle-icon| on your right. That icon will be replaced by
*minus-circle* icon |minus-circle-icon|. That mean *Show subtotal* field is
set to False.
#. Add some product lines.
#. Add another section line and click on the *eye* icon |eye-icon| on your
right. That icon will be replaced by *eye-slash* icon |eye-slash-icon|.
That mean *Show details* field is set to False.
#. Add some product lines.
#. Print a *Quotation / Order* report for this quotation.

After following the steps described above, in the report you will see the
following:

* The first 'line section' and its product order lines will be shown in
a normal way.
* The second 'line section' and its product order lines will be shown in
a normal way, but the subtotal won't be shown. That is because in this
section line *Show subtotal* field was set to False.
* The third 'line section' will show the name on the left and the
subtotal on the right. Besides, its product order lines won't be shown.
That is because in this line *Show details* field was set to False.

The behavior described before is the same for Quotations and Invoices.

.. |eye-icon| image:: sale_layout_category_hide_detail/static/description/readme-icons/eye.png
:alt: plus-circle icon
:width: 12 px

.. |eye-slash-icon| image:: sale_layout_category_hide_detail/static/description/readme-icons/eye-slash.png
:alt: minus-circle icon
:width: 12 px

.. |plus-circle-icon| image:: sale_layout_category_hide_detail/static/description/readme-icons/plus-circle.png
:alt: plus-circle icon
:width: 12 px

.. |minus-circle-icon| image:: sale_layout_category_hide_detail/static/description/readme-icons/minus-circle.png
:alt: minus-circle icon
:width: 12 px

Known issues / Roadmap
======================

* The `boolean_fa_icon` widget has not been extracted to a module into OCA/web
because until now this widget has not been needed for anything else, but it's
good that in the future that would be done.

Bug Tracker
===========

Bugs are tracked on `GitHub Issues <https://github.com/OCA/sale-reporting/issues>`_.
In case of trouble, please check there if your issue has already been reported.
If you spotted it first, help us smashing it by providing a detailed and welcomed
`feedback <https://github.com/OCA/sale-reporting/issues/new?body=module:%20sale_layout_category_hide_detail%0Aversion:%2012.0%0A%0A**Steps%20to%20reproduce**%0A-%20...%0A%0A**Current%20behavior**%0A%0A**Expected%20behavior**>`_.

Do not contact contributors directly about support or help with technical issues.

Credits
=======

Authors
~~~~~~~

* Tecnativa

Contributors
~~~~~~~~~~~~

* `Tecnativa <https://www.tecnativa.com>`_:

* Ernesto Tejeda
* Pedro M. Baeza

Maintainers
~~~~~~~~~~~

This module is maintained by the OCA.

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

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.

This module is part of the `OCA/sale-reporting <https://github.com/OCA/sale-reporting/tree/12.0/sale_layout_category_hide_detail>`_ project on GitHub.

You are welcome to contribute. To learn how please visit https://odoo-community.org/page/Contribute.
3 changes: 3 additions & 0 deletions sale_layout_category_hide_detail/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html).

from . import models
27 changes: 27 additions & 0 deletions sale_layout_category_hide_detail/__manifest__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
# Copyright 2018-2019 Tecnativa - Ernesto Tejeda
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html).

{
"name": "Sale layout category hide detail",
"summary": "Hide details for sections in sale orders and invoices for "
"reports and customer portal",
"version": "12.0.1.0.0",
"category": "Sales Management",
"website": "http://github.com/OCA/sale-reporting",
"author": "Tecnativa, "
"Odoo Community Association (OCA)",
"license": "AGPL-3",
"depends": [
"sale_management",
],
"data": [
"views/assets.xml",
"views/account_invoice_view.xml",
"views/invoice_report_templates.xml",
"views/sale_views.xml",
"views/sale_order_report_templates.xml",
"views/sale_portal_templates.xml",
],
"application": False,
'installable': True,
}
87 changes: 87 additions & 0 deletions sale_layout_category_hide_detail/i18n/es.po
Original file line number Diff line number Diff line change
@@ -0,0 +1,87 @@
# Translation of Odoo Server.
# This file contains the translation of the following modules:
# * sale_layout_category_hide_detail
#
msgid ""
msgstr ""
"Project-Id-Version: Odoo Server 12.0\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2019-08-12 14:31+0000\n"
"PO-Revision-Date: 2019-08-12 14:31+0000\n"
"Last-Translator: <>\n"
"Language-Team: \n"
"Language: \n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: \n"
"Plural-Forms: \n"

#. module: sale_layout_category_hide_detail
#. openerp-web
#: code:addons/sale_layout_category_hide_detail/static/src/js/boolean_fa_icon_widget.js:52
#, python-format
msgid "Click to check"
msgstr ""

#. module: sale_layout_category_hide_detail
#. openerp-web
#: code:addons/sale_layout_category_hide_detail/static/src/js/boolean_fa_icon_widget.js:51
#, python-format
msgid "Click to uncheck"
msgstr ""

#. module: sale_layout_category_hide_detail
#: model:ir.model,name:sale_layout_category_hide_detail.model_account_invoice_line
msgid "Invoice Line"
msgstr "Linea de factura"

#. module: sale_layout_category_hide_detail
#: model:ir.model,name:sale_layout_category_hide_detail.model_sale_order_line
msgid "Sales Order Line"
msgstr "Línea de pedido de venta"

#. module: sale_layout_category_hide_detail
#: model:ir.model.fields,field_description:sale_layout_category_hide_detail.field_account_invoice_line__show_details
#: model:ir.model.fields,field_description:sale_layout_category_hide_detail.field_sale_order_line__show_details
msgid "Show details"
msgstr "Mostrar detalles"

#. module: sale_layout_category_hide_detail
#: model:ir.model.fields,field_description:sale_layout_category_hide_detail.field_account_invoice_line__show_subtotal
#: model:ir.model.fields,field_description:sale_layout_category_hide_detail.field_sale_order_line__show_subtotal
msgid "Show subtotal"
msgstr "Mostrar subtotal"

#. module: sale_layout_category_hide_detail
#: model_terms:ir.ui.view,arch_db:sale_layout_category_hide_detail.report_saleorder_document_hide_detail
#: model_terms:ir.ui.view,arch_db:sale_layout_category_hide_detail.sale_order_portal_content_hide_detail
msgid "Subtotal"
msgstr "Subtotal"

#. module: sale_layout_category_hide_detail
#. openerp-web
#: code:addons/sale_layout_category_hide_detail/static/src/js/hide_details_translations.js:8
#, python-format
msgid "Switch to: details hidden"
msgstr "Cambiar a: detalles ocultos"

#. module: sale_layout_category_hide_detail
#. openerp-web
#: code:addons/sale_layout_category_hide_detail/static/src/js/hide_details_translations.js:9
#, python-format
msgid "Switch to: details shown"
msgstr "Cambiar a: detalles mostrados"

#. module: sale_layout_category_hide_detail
#. openerp-web
#: code:addons/sale_layout_category_hide_detail/static/src/js/hide_details_translations.js:10
#, python-format
msgid "Switch to: subtotal hidden"
msgstr "Cambiar a: subtotal oculto"

#. module: sale_layout_category_hide_detail
#. openerp-web
#: code:addons/sale_layout_category_hide_detail/static/src/js/hide_details_translations.js:11
#, python-format
msgid "Switch to: subtotal shown"
msgstr "Cambiar a: subtotal mostrado"
Original file line number Diff line number Diff line change
@@ -0,0 +1,85 @@
# Translation of Odoo Server.
# This file contains the translation of the following modules:
# * sale_layout_category_hide_detail
#
msgid ""
msgstr ""
"Project-Id-Version: Odoo Server 12.0\n"
"Report-Msgid-Bugs-To: \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: sale_layout_category_hide_detail
#. openerp-web
#: code:addons/sale_layout_category_hide_detail/static/src/js/boolean_fa_icon_widget.js:52
#, python-format
msgid "Click to check"
msgstr ""

#. module: sale_layout_category_hide_detail
#. openerp-web
#: code:addons/sale_layout_category_hide_detail/static/src/js/boolean_fa_icon_widget.js:51
#, python-format
msgid "Click to uncheck"
msgstr ""

#. module: sale_layout_category_hide_detail
#: model:ir.model,name:sale_layout_category_hide_detail.model_account_invoice_line
msgid "Invoice Line"
msgstr ""

#. module: sale_layout_category_hide_detail
#: model:ir.model,name:sale_layout_category_hide_detail.model_sale_order_line
msgid "Sales Order Line"
msgstr ""

#. module: sale_layout_category_hide_detail
#: model:ir.model.fields,field_description:sale_layout_category_hide_detail.field_account_invoice_line__show_details
#: model:ir.model.fields,field_description:sale_layout_category_hide_detail.field_sale_order_line__show_details
msgid "Show details"
msgstr ""

#. module: sale_layout_category_hide_detail
#: model:ir.model.fields,field_description:sale_layout_category_hide_detail.field_account_invoice_line__show_subtotal
#: model:ir.model.fields,field_description:sale_layout_category_hide_detail.field_sale_order_line__show_subtotal
msgid "Show subtotal"
msgstr ""

#. module: sale_layout_category_hide_detail
#: model_terms:ir.ui.view,arch_db:sale_layout_category_hide_detail.report_saleorder_document_hide_detail
#: model_terms:ir.ui.view,arch_db:sale_layout_category_hide_detail.sale_order_portal_content_hide_detail
msgid "Subtotal"
msgstr ""

#. module: sale_layout_category_hide_detail
#. openerp-web
#: code:addons/sale_layout_category_hide_detail/static/src/js/hide_details_translations.js:8
#, python-format
msgid "Switch to: details hidden"
msgstr ""

#. module: sale_layout_category_hide_detail
#. openerp-web
#: code:addons/sale_layout_category_hide_detail/static/src/js/hide_details_translations.js:9
#, python-format
msgid "Switch to: details shown"
msgstr ""

#. module: sale_layout_category_hide_detail
#. openerp-web
#: code:addons/sale_layout_category_hide_detail/static/src/js/hide_details_translations.js:10
#, python-format
msgid "Switch to: subtotal hidden"
msgstr ""

#. module: sale_layout_category_hide_detail
#. openerp-web
#: code:addons/sale_layout_category_hide_detail/static/src/js/hide_details_translations.js:11
#, python-format
msgid "Switch to: subtotal shown"
msgstr ""

Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
# Copyright 2019 Tecnativa - Pedro M. Baeza
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html).

from openupgradelib import openupgrade


@openupgrade.migrate()
def migrate(env, version):
openupgrade.logged_query(
env.cr, """
UPDATE sale_order_line sol
SET show_details = NOT slc.hide_details,
show_subtotal = slc.subtotal
FROM sale_layout_category slc
WHERE slc.id = sol.layout_category_id
AND display_type = 'line_section'
""",
)
openupgrade.logged_query(
env.cr, """
UPDATE account_invoice_line ail
SET show_details = NOT slc.hide_details,
show_subtotal = slc.subtotal
FROM sale_layout_category slc
WHERE slc.id = ail.layout_category_id
AND display_type = 'line_section'
""",
)
4 changes: 4 additions & 0 deletions sale_layout_category_hide_detail/models/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html).

from . import sale_order
from . import account_invoice
15 changes: 15 additions & 0 deletions sale_layout_category_hide_detail/models/account_invoice.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
# Copyright 2018-2019 Tecnativa - Ernesto Tejeda
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html).

from odoo import fields, models


class AccountInvoiceLine(models.Model):
_inherit = 'account.invoice.line'

show_details = fields.Boolean(
string="Show details",
default=True)
show_subtotal = fields.Boolean(
string="Show subtotal",
default=True)

0 comments on commit 8130967

Please sign in to comment.