Skip to content

Commit

Permalink
Merge PR #677 into 17.0
Browse files Browse the repository at this point in the history
Signed-off-by AaronHForgeFlow
  • Loading branch information
OCA-git-bot committed Dec 2, 2024
2 parents e0a04e6 + d8ef995 commit 5e04c33
Show file tree
Hide file tree
Showing 16 changed files with 1,271 additions and 0 deletions.
81 changes: 81 additions & 0 deletions report_qweb_operating_unit/README.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,81 @@
===============================
Qweb Report With Operating Unit
===============================

..
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
!! This file is generated by oca-gen-addon-readme !!
!! changes will be overwritten. !!
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
!! source digest: sha256:f71338809acc383a797732ef2f0672e94f2d5d43726bee7a87689b76ebf52121
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
.. |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-LGPL--3-blue.png
:target: http://www.gnu.org/licenses/lgpl-3.0-standalone.html
:alt: License: LGPL-3
.. |badge3| image:: https://img.shields.io/badge/github-OCA%2Foperating--unit-lightgray.png?logo=github
:target: https://github.com/OCA/operating-unit/tree/17.0/report_qweb_operating_unit
:alt: OCA/operating-unit
.. |badge4| image:: https://img.shields.io/badge/weblate-Translate%20me-F47D42.png
:target: https://translation.odoo-community.org/projects/operating-unit-17-0/operating-unit-17-0-report_qweb_operating_unit
:alt: Translate me on Weblate
.. |badge5| image:: https://img.shields.io/badge/runboat-Try%20me-875A7B.png
:target: https://runboat.odoo-community.org/builds?repo=OCA/operating-unit&target_branch=17.0
:alt: Try me on Runboat

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

This module allows to use custom operating unit headers for any report
in Odoo

**Table of contents**

.. contents::
:local:

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

Bugs are tracked on `GitHub Issues <https://github.com/OCA/operating-unit/issues>`_.
In case of trouble, please check there if your issue has already been reported.
If you spotted it first, help us to smash it by providing a detailed and welcomed
`feedback <https://github.com/OCA/operating-unit/issues/new?body=module:%20report_qweb_operating_unit%0Aversion:%2017.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
-------

* ForgeFlow S.L.
* Serpent Consulting Services Pvt. Ltd.

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

- ForgeFlow S.L. <contact@forgeflow.com>
- Serpent Consulting Services Pvt. Ltd. <support@serpentcs.com>
- Jarsa Sistemas <info@jarsa.com.mx>
- Juany Davila <juany.davila@forgeflow.com>

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/operating-unit <https://github.com/OCA/operating-unit/tree/17.0/report_qweb_operating_unit>`_ project on GitHub.

You are welcome to contribute. To learn how please visit https://odoo-community.org/page/Contribute.
1 change: 1 addition & 0 deletions report_qweb_operating_unit/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
from . import models
17 changes: 17 additions & 0 deletions report_qweb_operating_unit/__manifest__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
# Copyright 2017 ForgeFlow S.L.
# Copyright 2017 Serpent Consulting Services Pvt. Ltd.
# License LGPL-3.0 or later (https://www.gnu.org/licenses/agpl.html).

{
"name": "Qweb Report With Operating Unit",
"version": "17.0.1.0.0",
"category": "Reports/Qweb",
"license": "LGPL-3",
"author": "ForgeFlow S.L., "
"Serpent Consulting Services Pvt. Ltd.,"
"Odoo Community Association (OCA)",
"website": "https://github.com/OCA/operating-unit",
"depends": ["operating_unit"],
"data": ["views/operating_unit_view.xml", "views/report_qweb_operating_unit.xml"],
"installable": True,
}
83 changes: 83 additions & 0 deletions report_qweb_operating_unit/i18n/es_MX.po
Original file line number Diff line number Diff line change
@@ -0,0 +1,83 @@
# Translation of Odoo Server.
# This file contains the translation of the following modules:
# * report_qweb_operating_unit
#
msgid ""
msgstr ""
"Project-Id-Version: Odoo Server 13.0\n"
"Report-Msgid-Bugs-To: \n"
"PO-Revision-Date: 2020-02-19 16:13+0000\n"
"Last-Translator: Jesús Alan Ramos Rodríguez <alan.ramos@jarsa.com.mx>\n"
"Language-Team: none\n"
"Language: es_MX\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: \n"
"Plural-Forms: nplurals=2; plural=n != 1;\n"
"X-Generator: Weblate 3.10\n"

#. module: report_qweb_operating_unit
#: model_terms:ir.ui.view,arch_db:report_qweb_operating_unit.external_layout_background_ou
msgid ""
"<i class=\"fa fa-at\" role=\"img\" aria-label=\"Email\" title=\"Email\"/>"
msgstr ""
"<i class=\"fa fa-at\" role=\"img\" aria-label=\"Correo electrónico\" title="
"\"Correo electrónico\"/>"

#. module: report_qweb_operating_unit
#: model_terms:ir.ui.view,arch_db:report_qweb_operating_unit.external_layout_background_ou
msgid ""
"<i class=\"fa fa-building-o\" role=\"img\" aria-label=\"Fiscal number\"/>"
msgstr "<i class=\"fa fa-building-o\" role=\"img\" aria-label=\"RFC\"/>"

#. module: report_qweb_operating_unit
#: model_terms:ir.ui.view,arch_db:report_qweb_operating_unit.external_layout_background_ou
msgid ""
"<i class=\"fa fa-globe\" role=\"img\" aria-label=\"Website\" title=\"Website"
"\"/>"
msgstr ""
"<i class=\"fa fa-globe\" role=\"img\" aria-label=\"Sitio Web\" title=\"Sitio "
"Web\"/>"

#. module: report_qweb_operating_unit
#: model_terms:ir.ui.view,arch_db:report_qweb_operating_unit.external_layout_background_ou
msgid ""
"<i class=\"fa fa-phone\" role=\"img\" aria-label=\"Phone\" title=\"Phone\"/>"
msgstr ""
"<i class=\"fa fa-phone\" role=\"img\" aria-label=\"Teléfono\" title="
"\"Teléfono\"/>"

#. module: report_qweb_operating_unit
#: model_terms:ir.ui.view,arch_db:report_qweb_operating_unit.external_layout_standard_ou
msgid "Email:"
msgstr "Correo electrónico:"

#. module: report_qweb_operating_unit
#: model_terms:ir.ui.view,arch_db:report_qweb_operating_unit.external_layout_background_ou
#: model_terms:ir.ui.view,arch_db:report_qweb_operating_unit.external_layout_boxed_ou
#: model_terms:ir.ui.view,arch_db:report_qweb_operating_unit.external_layout_clean_ou
#: model_terms:ir.ui.view,arch_db:report_qweb_operating_unit.external_layout_standard_ou
msgid "Logo"
msgstr "Logo"

#. module: report_qweb_operating_unit
#: model_terms:ir.ui.view,arch_db:report_qweb_operating_unit.external_layout_boxed_ou
msgid "Mail:"
msgstr "Correo electrónico:"

#. module: report_qweb_operating_unit
#: model_terms:ir.ui.view,arch_db:report_qweb_operating_unit.external_layout_standard_ou
msgid "Phone:"
msgstr "Teléfono:"

#. module: report_qweb_operating_unit
#: model_terms:ir.ui.view,arch_db:report_qweb_operating_unit.external_layout_boxed_ou
#: model_terms:ir.ui.view,arch_db:report_qweb_operating_unit.external_layout_clean_ou
msgid "Tel:"
msgstr "Tel:"

#. module: report_qweb_operating_unit
#: model_terms:ir.ui.view,arch_db:report_qweb_operating_unit.external_layout_boxed_ou
#: model_terms:ir.ui.view,arch_db:report_qweb_operating_unit.external_layout_standard_ou
msgid "Web:"
msgstr "Web:"
69 changes: 69 additions & 0 deletions report_qweb_operating_unit/i18n/report_qweb_operating_unit.pot
Original file line number Diff line number Diff line change
@@ -0,0 +1,69 @@
# Translation of Odoo Server.
# This file contains the translation of the following modules:
# * report_qweb_operating_unit
#
msgid ""
msgstr ""
"Project-Id-Version: Odoo Server 14.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: report_qweb_operating_unit
#: model_terms:ir.ui.view,arch_db:report_qweb_operating_unit.external_layout_background_ou
msgid "<i class=\"fa fa-at\" role=\"img\" aria-label=\"Email\" title=\"Email\"/>"
msgstr ""

#. module: report_qweb_operating_unit
#: model_terms:ir.ui.view,arch_db:report_qweb_operating_unit.external_layout_background_ou
msgid "<i class=\"fa fa-building-o\" role=\"img\" aria-label=\"Fiscal number\"/>"
msgstr ""

#. module: report_qweb_operating_unit
#: model_terms:ir.ui.view,arch_db:report_qweb_operating_unit.external_layout_background_ou
msgid "<i class=\"fa fa-globe\" role=\"img\" aria-label=\"Website\" title=\"Website\"/>"
msgstr ""

#. module: report_qweb_operating_unit
#: model_terms:ir.ui.view,arch_db:report_qweb_operating_unit.external_layout_background_ou
msgid "<i class=\"fa fa-phone\" role=\"img\" aria-label=\"Phone\" title=\"Phone\"/>"
msgstr ""

#. module: report_qweb_operating_unit
#: model_terms:ir.ui.view,arch_db:report_qweb_operating_unit.external_layout_standard_ou
msgid "Email:"
msgstr ""

#. module: report_qweb_operating_unit
#: model_terms:ir.ui.view,arch_db:report_qweb_operating_unit.external_layout_background_ou
#: model_terms:ir.ui.view,arch_db:report_qweb_operating_unit.external_layout_boxed_ou
#: model_terms:ir.ui.view,arch_db:report_qweb_operating_unit.external_layout_clean_ou
#: model_terms:ir.ui.view,arch_db:report_qweb_operating_unit.external_layout_standard_ou
msgid "Logo"
msgstr ""

#. module: report_qweb_operating_unit
#: model_terms:ir.ui.view,arch_db:report_qweb_operating_unit.external_layout_boxed_ou
msgid "Mail:"
msgstr ""

#. module: report_qweb_operating_unit
#: model_terms:ir.ui.view,arch_db:report_qweb_operating_unit.external_layout_standard_ou
msgid "Phone:"
msgstr ""

#. module: report_qweb_operating_unit
#: model_terms:ir.ui.view,arch_db:report_qweb_operating_unit.external_layout_boxed_ou
#: model_terms:ir.ui.view,arch_db:report_qweb_operating_unit.external_layout_clean_ou
msgid "Tel:"
msgstr ""

#. module: report_qweb_operating_unit
#: model_terms:ir.ui.view,arch_db:report_qweb_operating_unit.external_layout_boxed_ou
#: model_terms:ir.ui.view,arch_db:report_qweb_operating_unit.external_layout_standard_ou
msgid "Web:"
msgstr ""
1 change: 1 addition & 0 deletions report_qweb_operating_unit/models/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
from . import operating_unit
67 changes: 67 additions & 0 deletions report_qweb_operating_unit/models/operating_unit.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,67 @@
# Copyright 2024 NSI-SA
# License LGPL-3.0 or later (https://www.gnu.org/licenses/lgpl.html).
from odoo import api, fields, models
from odoo.tools import html2plaintext


class OperatingUnit(models.Model):
_inherit = "operating.unit"

report_header = fields.Html(
string="Operating Unit Tagline",
translate=True,
compute="_compute_report_header",
store=True,
readonly=False,
help="Operating Unit tagline, which is included "
"in a printed document's header or footer "
"(depending on the selected layout).",
)
report_footer = fields.Html(
translate=True,
compute="_compute_report_footer",
store=True,
readonly=False,
help="Footer text displayed at the bottom of all reports.",
)
operating_unit_details = fields.Html(
translate=True,
compute="_compute_operating_unit_details",
store=True,
readonly=False,
help="Header text displayed at the top of all reports.",
)
is_operating_unit_details_empty = fields.Boolean(
compute="_compute_empty_operating_unit_details"
)

@api.depends("company_id")
def _compute_report_header(self):
for operating_unit in self:
if operating_unit.company_id:
operating_unit.report_header = operating_unit.company_id.report_header

@api.depends("company_id")
def _compute_report_footer(self):
for operating_unit in self:
if operating_unit.company_id:
operating_unit.report_footer = operating_unit.company_id.report_footer

@api.depends("company_id")
def _compute_operating_unit_details(self):
for operating_unit in self:
if operating_unit.company_id:
operating_unit.operating_unit_details = (
operating_unit.company_id.company_details
)

@api.depends("operating_unit_details")
def _compute_empty_operating_unit_details(self):
# In recent change when an html field is
# empty a <p> balise remains with a <br> in it,
# but when operating unit details is empty
# we want to put the info of the operating unit
for operating_unit in self:
operating_unit.is_operating_unit_details_empty = not html2plaintext(
operating_unit.operating_unit_details or ""
)
3 changes: 3 additions & 0 deletions report_qweb_operating_unit/pyproject.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
[build-system]
requires = ["whool"]
build-backend = "whool.buildapi"
4 changes: 4 additions & 0 deletions report_qweb_operating_unit/readme/CONTRIBUTORS.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
- ForgeFlow S.L. \<<contact@forgeflow.com>\>
- Serpent Consulting Services Pvt. Ltd. \<<support@serpentcs.com>\>
- Jarsa Sistemas \<<info@jarsa.com.mx>\>
- Juany Davila \<<juany.davila@forgeflow.com>\>
2 changes: 2 additions & 0 deletions report_qweb_operating_unit/readme/DESCRIPTION.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
This module allows to use custom operating unit headers for any report
in Odoo
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading

0 comments on commit 5e04c33

Please sign in to comment.