Skip to content

Commit c878b60

Browse files
committed
Merge PR #15 into 18.0
Signed-off-by ValentinVinagre
2 parents bec0ef3 + 0939910 commit c878b60

18 files changed

Lines changed: 524 additions & 0 deletions
Lines changed: 85 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,85 @@
1+
.. image:: https://img.shields.io/badge/licence-AGPL--3-blue.svg
2+
:target: http://www.gnu.org/licenses/agpl
3+
:alt: License: AGPL-3
4+
5+
6+
=============================
7+
Hide Invoice Shipping Address
8+
=============================
9+
This module keeps the shipping address hidden on the invoice.
10+
11+
12+
Installation
13+
============
14+
To install this module, you need to:
15+
16+
#. Just install.
17+
18+
19+
Configuration
20+
=============
21+
22+
To configure this module, you need to:
23+
24+
#. Activate or deactivate the "Print The Shipping Invoice On The Invoice" option in
25+
Accounting > configuration > Settings > Customer Invoices if the shipping address has
26+
to be shown or hidden in customer invoices PDFs. This option applies when the customer does
27+
not have a value set in its field "Print The Shipping Invoice On The Invoice".
28+
29+
#. The "Print The Shipping Invoice On The Invoice" field can be found in the "Sales/Purchases"
30+
tab in the partner form view. Select "Yes" or "No" depending on whether the invoice address has
31+
to be shown in customer invoices PDFs. If no option is set, it will be applied the option selected
32+
in the field "Print The Shipping Invoice On The Invoice" in Accounting > Configration > Settings > Customer Invoices.
33+
34+
35+
Usage
36+
=====
37+
38+
To use this module, you need to:
39+
40+
#. On the sales invoice, just below the customer shipping address, we will find a check that will
41+
indicate whether or not this invoice will hide the shipping address when printed. This option will
42+
mainly take into account the settings specified in the shipping address contact. If it is blank,
43+
check the client configuration. And if it is also empty, it takes into account the general configuration we have.
44+
45+
46+
Bug Tracker
47+
===========
48+
49+
Bugs and errors are managed in `issues of GitHub <https://github.com/sygel-technology/sy-account-financial-reporting/issues>`_.
50+
In case of problems, please check if your problem has already been
51+
reported. If you are the first to discover it, help us solving it by indicating
52+
a detailed description `here <https://github.com/sygel-technology/sy-account-financial-reporting/issues/new>`_.
53+
54+
Do not contact contributors directly about support or help with technical issues.
55+
56+
57+
Credits
58+
=======
59+
60+
Authors
61+
~~~~~~~
62+
63+
* Sygel, Odoo Community Association (OCA)
64+
65+
66+
Contributors
67+
~~~~~~~~~~~~
68+
69+
* Valentin Vinagre <valentin.vinagre@sygel.es>
70+
* Roger Sans <roger.sans@sygel.es>
71+
72+
73+
Maintainer
74+
~~~~~~~~~~
75+
76+
This module is maintained by Sygel.
77+
78+
.. image:: https://www.sygel.es/logo.png
79+
:alt: Sygel
80+
:target: https://www.sygel.es
81+
82+
83+
This module is part of the `Sygel/sy-account-financial-reporting <https://github.com/sygel-technology/sy-account-financial-reporting>`_.
84+
85+
To contribute to this module, please visit https://github.com/sygel-technology.
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
# Copyright 2024 Roger Sans <roger.sans@sygel.es>
2+
# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl).
3+
4+
from . import models
Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
# Copyright 2024 Roger Sans <roger.sans@sygel.es>
2+
# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl).
3+
4+
{
5+
"name": "Account Invoice Report Hide Delivery Address",
6+
"version": "18.0.1.0.0",
7+
"author": "Sygel, Odoo Community Association (OCA)",
8+
"category": "Reporting",
9+
"license": "AGPL-3",
10+
"summary": "Keep the shipping address hidden on the invoice.",
11+
"website": "https://github.com/sygel-technology/sy-account-financial-reporting",
12+
"depends": [
13+
"account",
14+
"sale",
15+
],
16+
"data": [
17+
"views/res_partner_view.xml",
18+
"views/account_move_view.xml",
19+
"views/res_config_settings_view.xml",
20+
"report/report_invoice.xml",
21+
],
22+
}
Lines changed: 88 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,88 @@
1+
# Translation of Odoo Server.
2+
# This file contains the translation of the following modules:
3+
# * account_invoice_report_hide_delivery_address
4+
#
5+
msgid ""
6+
msgstr ""
7+
"Project-Id-Version: Odoo Server 14.0\n"
8+
"Report-Msgid-Bugs-To: \n"
9+
"POT-Creation-Date: 2024-07-10 09:14+0000\n"
10+
"PO-Revision-Date: 2024-07-10 11:15+0200\n"
11+
"Last-Translator: \n"
12+
"Language-Team: \n"
13+
"Language: ca_ES\n"
14+
"MIME-Version: 1.0\n"
15+
"Content-Type: text/plain; charset=UTF-8\n"
16+
"Content-Transfer-Encoding: 8bit\n"
17+
"Plural-Forms: nplurals=2; plural=(n != 1);\n"
18+
"X-Generator: Poedit 3.4.3\n"
19+
20+
#. module: account_invoice_report_hide_delivery_address
21+
#: model:ir.model,name:account_invoice_report_hide_delivery_address.model_res_company
22+
msgid "Companies"
23+
msgstr "Empreses"
24+
25+
#. module: account_invoice_report_hide_delivery_address
26+
#: model:ir.model,name:account_invoice_report_hide_delivery_address.model_res_config_settings
27+
msgid "Config Settings"
28+
msgstr "Configuració"
29+
30+
#. module: account_invoice_report_hide_delivery_address
31+
#: model:ir.model,name:account_invoice_report_hide_delivery_address.model_res_partner
32+
msgid "Contact"
33+
msgstr "Contacte"
34+
35+
#. module: account_invoice_report_hide_delivery_address
36+
#: model:ir.model.fields,field_description:account_invoice_report_hide_delivery_address.field_account_move__display_name
37+
#: model:ir.model.fields,field_description:account_invoice_report_hide_delivery_address.field_res_company__display_name
38+
#: model:ir.model.fields,field_description:account_invoice_report_hide_delivery_address.field_res_config_settings__display_name
39+
#: model:ir.model.fields,field_description:account_invoice_report_hide_delivery_address.field_res_partner__display_name
40+
msgid "Display Name"
41+
msgstr "Nom mostrat"
42+
43+
#. module: account_invoice_report_hide_delivery_address
44+
#: model:ir.model.fields.selection,name:account_invoice_report_hide_delivery_address.selection__res_partner__invoice_shipping_address_print__hide
45+
msgid "Hide"
46+
msgstr "Amaga"
47+
48+
#. module: account_invoice_report_hide_delivery_address
49+
#: model:ir.model.fields,field_description:account_invoice_report_hide_delivery_address.field_account_move__id
50+
#: model:ir.model.fields,field_description:account_invoice_report_hide_delivery_address.field_res_company__id
51+
#: model:ir.model.fields,field_description:account_invoice_report_hide_delivery_address.field_res_config_settings__id
52+
#: model:ir.model.fields,field_description:account_invoice_report_hide_delivery_address.field_res_partner__id
53+
msgid "ID"
54+
msgstr ""
55+
56+
#. module: account_invoice_report_hide_delivery_address
57+
#: model:ir.model,name:account_invoice_report_hide_delivery_address.model_account_move
58+
msgid "Journal Entry"
59+
msgstr "Assentament comptable"
60+
61+
#. module: account_invoice_report_hide_delivery_address
62+
#: model:ir.model.fields,field_description:account_invoice_report_hide_delivery_address.field_account_move____last_update
63+
#: model:ir.model.fields,field_description:account_invoice_report_hide_delivery_address.field_res_company____last_update
64+
#: model:ir.model.fields,field_description:account_invoice_report_hide_delivery_address.field_res_config_settings____last_update
65+
#: model:ir.model.fields,field_description:account_invoice_report_hide_delivery_address.field_res_partner____last_update
66+
msgid "Last Modified on"
67+
msgstr "Última modificació el "
68+
69+
#. module: account_invoice_report_hide_delivery_address
70+
#: model:ir.model.fields,field_description:account_invoice_report_hide_delivery_address.field_account_bank_statement_line__invoice_shipping_address_print
71+
#: model:ir.model.fields,field_description:account_invoice_report_hide_delivery_address.field_account_move__invoice_shipping_address_print
72+
#: model:ir.model.fields,field_description:account_invoice_report_hide_delivery_address.field_account_payment__invoice_shipping_address_print
73+
#: model:ir.model.fields,field_description:account_invoice_report_hide_delivery_address.field_res_company__invoice_shipping_address_print
74+
#: model:ir.model.fields,field_description:account_invoice_report_hide_delivery_address.field_res_config_settings__invoice_shipping_address_print
75+
#: model:ir.model.fields,field_description:account_invoice_report_hide_delivery_address.field_res_partner__invoice_shipping_address_print
76+
#: model:ir.model.fields,field_description:account_invoice_report_hide_delivery_address.field_res_users__invoice_shipping_address_print
77+
msgid "Print The Shipping Invoice On The Invoice"
78+
msgstr "Imprimir direcció d'enviament a la factura"
79+
80+
#. module: account_invoice_report_hide_delivery_address
81+
#: model_terms:ir.ui.view,arch_db:account_invoice_report_hide_delivery_address.res_config_settings_view_form_shipping_address
82+
msgid "Print The Shipping Invoice On The Invoice."
83+
msgstr "Imprimir direcció d'enviament a la factura."
84+
85+
#. module: account_invoice_report_hide_delivery_address
86+
#: model:ir.model.fields.selection,name:account_invoice_report_hide_delivery_address.selection__res_partner__invoice_shipping_address_print__show
87+
msgid "Show"
88+
msgstr "Mostra"
Lines changed: 88 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,88 @@
1+
# Translation of Odoo Server.
2+
# This file contains the translation of the following modules:
3+
# * account_invoice_report_hide_delivery_address
4+
#
5+
msgid ""
6+
msgstr ""
7+
"Project-Id-Version: Odoo Server 14.0\n"
8+
"Report-Msgid-Bugs-To: \n"
9+
"POT-Creation-Date: 2024-07-10 09:13+0000\n"
10+
"PO-Revision-Date: 2024-07-10 11:15+0200\n"
11+
"Last-Translator: \n"
12+
"Language-Team: \n"
13+
"Language: es\n"
14+
"MIME-Version: 1.0\n"
15+
"Content-Type: text/plain; charset=UTF-8\n"
16+
"Content-Transfer-Encoding: 8bit\n"
17+
"Plural-Forms: nplurals=2; plural=(n != 1);\n"
18+
"X-Generator: Poedit 3.4.3\n"
19+
20+
#. module: account_invoice_report_hide_delivery_address
21+
#: model:ir.model,name:account_invoice_report_hide_delivery_address.model_res_company
22+
msgid "Companies"
23+
msgstr "Compañías"
24+
25+
#. module: account_invoice_report_hide_delivery_address
26+
#: model:ir.model,name:account_invoice_report_hide_delivery_address.model_res_config_settings
27+
msgid "Config Settings"
28+
msgstr "Opciones de configuración"
29+
30+
#. module: account_invoice_report_hide_delivery_address
31+
#: model:ir.model,name:account_invoice_report_hide_delivery_address.model_res_partner
32+
msgid "Contact"
33+
msgstr "Contacto"
34+
35+
#. module: account_invoice_report_hide_delivery_address
36+
#: model:ir.model.fields,field_description:account_invoice_report_hide_delivery_address.field_account_move__display_name
37+
#: model:ir.model.fields,field_description:account_invoice_report_hide_delivery_address.field_res_company__display_name
38+
#: model:ir.model.fields,field_description:account_invoice_report_hide_delivery_address.field_res_config_settings__display_name
39+
#: model:ir.model.fields,field_description:account_invoice_report_hide_delivery_address.field_res_partner__display_name
40+
msgid "Display Name"
41+
msgstr "Nombre mostrado"
42+
43+
#. module: account_invoice_report_hide_delivery_address
44+
#: model:ir.model.fields.selection,name:account_invoice_report_hide_delivery_address.selection__res_partner__invoice_shipping_address_print__hide
45+
msgid "Hide"
46+
msgstr "Ocultar"
47+
48+
#. module: account_invoice_report_hide_delivery_address
49+
#: model:ir.model.fields,field_description:account_invoice_report_hide_delivery_address.field_account_move__id
50+
#: model:ir.model.fields,field_description:account_invoice_report_hide_delivery_address.field_res_company__id
51+
#: model:ir.model.fields,field_description:account_invoice_report_hide_delivery_address.field_res_config_settings__id
52+
#: model:ir.model.fields,field_description:account_invoice_report_hide_delivery_address.field_res_partner__id
53+
msgid "ID"
54+
msgstr ""
55+
56+
#. module: account_invoice_report_hide_delivery_address
57+
#: model:ir.model,name:account_invoice_report_hide_delivery_address.model_account_move
58+
msgid "Journal Entry"
59+
msgstr "Asiento contable"
60+
61+
#. module: account_invoice_report_hide_delivery_address
62+
#: model:ir.model.fields,field_description:account_invoice_report_hide_delivery_address.field_account_move____last_update
63+
#: model:ir.model.fields,field_description:account_invoice_report_hide_delivery_address.field_res_company____last_update
64+
#: model:ir.model.fields,field_description:account_invoice_report_hide_delivery_address.field_res_config_settings____last_update
65+
#: model:ir.model.fields,field_description:account_invoice_report_hide_delivery_address.field_res_partner____last_update
66+
msgid "Last Modified on"
67+
msgstr "Última modificación en"
68+
69+
#. module: account_invoice_report_hide_delivery_address
70+
#: model:ir.model.fields,field_description:account_invoice_report_hide_delivery_address.field_account_bank_statement_line__invoice_shipping_address_print
71+
#: model:ir.model.fields,field_description:account_invoice_report_hide_delivery_address.field_account_move__invoice_shipping_address_print
72+
#: model:ir.model.fields,field_description:account_invoice_report_hide_delivery_address.field_account_payment__invoice_shipping_address_print
73+
#: model:ir.model.fields,field_description:account_invoice_report_hide_delivery_address.field_res_company__invoice_shipping_address_print
74+
#: model:ir.model.fields,field_description:account_invoice_report_hide_delivery_address.field_res_config_settings__invoice_shipping_address_print
75+
#: model:ir.model.fields,field_description:account_invoice_report_hide_delivery_address.field_res_partner__invoice_shipping_address_print
76+
#: model:ir.model.fields,field_description:account_invoice_report_hide_delivery_address.field_res_users__invoice_shipping_address_print
77+
msgid "Print The Shipping Invoice On The Invoice"
78+
msgstr "Imprimir dirección de envío en la factura"
79+
80+
#. module: account_invoice_report_hide_delivery_address
81+
#: model_terms:ir.ui.view,arch_db:account_invoice_report_hide_delivery_address.res_config_settings_view_form_shipping_address
82+
msgid "Print The Shipping Invoice On The Invoice."
83+
msgstr "Imprimir dirección de envío en la factura."
84+
85+
#. module: account_invoice_report_hide_delivery_address
86+
#: model:ir.model.fields.selection,name:account_invoice_report_hide_delivery_address.selection__res_partner__invoice_shipping_address_print__show
87+
msgid "Show"
88+
msgstr "Mostrar"
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
# Copyright 2024 Roger Sans <roger.sans@sygel.es>
2+
# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl).
3+
4+
from . import res_partner
5+
from . import res_company
6+
from . import account_move
7+
from . import res_config_settings
Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
# Copyright 2024 Roger Sans <roger.sans@sygel.es>
2+
# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl).
3+
4+
from odoo import api, fields, models
5+
6+
7+
class AccountMove(models.Model):
8+
_inherit = "account.move"
9+
10+
invoice_shipping_address_print = fields.Boolean(
11+
string="Print The Shipping Invoice On The Invoice",
12+
compute="_compute_invoice_shipping_address_print",
13+
store=True,
14+
readonly=False,
15+
)
16+
17+
@api.depends("partner_shipping_id", "company_id")
18+
def _compute_invoice_shipping_address_print(self):
19+
for record in self:
20+
result = record.company_id.invoice_shipping_address_print
21+
if record.partner_shipping_id:
22+
partner_shipping_state = (
23+
record.partner_shipping_id.invoice_shipping_address_print
24+
)
25+
if record.partner_shipping_id.invoice_shipping_address_print:
26+
result = True if partner_shipping_state == "show" else False
27+
28+
elif record.partner_shipping_id.commercial_partner_id:
29+
partner_shipping = record.partner_shipping_id
30+
commercial_partner = partner_shipping.commercial_partner_id
31+
commercial_partner_state = (
32+
commercial_partner.invoice_shipping_address_print
33+
)
34+
result = True if commercial_partner_state == "show" else False
35+
record.invoice_shipping_address_print = result
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
# Copyright 2024 Roger Sans <roger.sans@sygel.es>
2+
# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl).
3+
4+
from odoo import fields, models
5+
6+
7+
class ResCompany(models.Model):
8+
_inherit = "res.company"
9+
10+
invoice_shipping_address_print = fields.Boolean(
11+
string="Print The Shipping Invoice On The Invoice",
12+
default=True,
13+
)
Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
# Copyright 2024 Roger Sans <roger.sans@sygel.es>
2+
# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl).
3+
4+
from odoo import fields, models
5+
6+
7+
class ResConfigSettings(models.TransientModel):
8+
_inherit = "res.config.settings"
9+
10+
invoice_shipping_address_print = fields.Boolean(
11+
string="Print The Shipping Invoice On The Invoice",
12+
related="company_id.invoice_shipping_address_print",
13+
readonly=False,
14+
)
Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
# Copyright 2024 Roger Sans <roger.sans@sygel.es>
2+
# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl).
3+
4+
from odoo import fields, models
5+
6+
7+
class ResPartner(models.Model):
8+
_inherit = "res.partner"
9+
10+
invoice_shipping_address_print = fields.Selection(
11+
string="Print The Shipping Invoice On The Invoice",
12+
selection=[
13+
("show", "Show"),
14+
("hide", "Hide"),
15+
],
16+
)

0 commit comments

Comments
 (0)