Maintainers
+Maintainers
This module is part of the beescoop/obeesdoo project on GitHub.
You are welcome to contribute.
diff --git a/beesdoo_purchase/README.rst b/beesdoo_purchase/README.rst
index 9570923..35bb0bf 100644
--- a/beesdoo_purchase/README.rst
+++ b/beesdoo_purchase/README.rst
@@ -27,12 +27,22 @@ create_uid ORM field. His user's contact info is printed on
purchases orders as 'Referent'.
- A filter w.r.t. the mail sellers is placed on the products field of a
purchase order.
+- Allow inverting the Purchase Order Reference on the invoice lines.
**Table of contents**
.. contents::
:local:
+Configuration
+=============
+
+The setting *Invert Purchase Order Reference on invoice line* needs to be checked.
+This can be done in these following ways:
+
+* on the Access Rights (Technical Settings) of the user (Invert Purchase Order Reference on invoice line)
+* on the Invoicing Settings inside of the section `Invoices` (Allow inverting the Purchase Order Reference on the invoice lines)
+
Bug Tracker
===========
diff --git a/beesdoo_purchase/__manifest__.py b/beesdoo_purchase/__manifest__.py
index 54c42a7..eaf8630 100644
--- a/beesdoo_purchase/__manifest__.py
+++ b/beesdoo_purchase/__manifest__.py
@@ -1,15 +1,21 @@
{
"name": "Bees Purchase",
"summary": """
- - Adds a 'Responsible' field to purchase orders,
+ - Adds a 'Responsible' field to purchase orders
- A filter w.r.t. the mail sellers is placed on the products field of a
- purchase order.
+ purchase order
+ - Allow inverting the Purchase Order Reference on the invoice lines
""",
"author": "Beescoop - Cellule IT, " "Coop IT Easy SCRLfs",
"website": "https://github.com/beescoop/Obeesdoo",
"category": "Purchase",
- "version": "12.0.1.1.0",
+ "version": "12.0.1.2.0",
"depends": ["base", "purchase", "beesdoo_product"],
- "data": ["views/purchase_order.xml", "report/report_purchaseorder.xml"],
+ "data": [
+ "security/invoice_security.xml",
+ "views/purchase_order.xml",
+ "views/res_config_settings_view.xml",
+ "report/report_purchaseorder.xml",
+ ],
"license": "AGPL-3",
}
diff --git a/beesdoo_purchase/i18n/fr.po b/beesdoo_purchase/i18n/fr.po
new file mode 100644
index 0000000..e5eb8de
--- /dev/null
+++ b/beesdoo_purchase/i18n/fr.po
@@ -0,0 +1,66 @@
+# Translation of Odoo Server.
+# This file contains the translation of the following modules:
+# * beesdoo_purchase
+#
+msgid ""
+msgstr ""
+"Project-Id-Version: Odoo Server 12.0\n"
+"Report-Msgid-Bugs-To: \n"
+"POT-Creation-Date: 2020-09-22 12:55+0000\n"
+"PO-Revision-Date: 2020-09-22 12:55+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: beesdoo_purchase
+#: model_terms:ir.ui.view,arch_db:beesdoo_purchase.report_purchaseorder_document
+msgid "Your Referent:"
+msgstr ""
+
+#. module: beesdoo_purchase
+#: model:ir.model.fields,field_description:beesdoo_purchase.field_res_config_settings__group_invert_po_ref_on_inv_line
+msgid "Allow inverting the Purchase Order Reference on the\n"
+" invoice lines"
+msgstr "Permet d'inverser la référence du Bon De Commande sur\n"
+" les lignes de facture"
+
+#. module: beesdoo_purchase
+#: model:ir.model.fields,help:beesdoo_purchase.field_res_config_settings__group_invert_po_ref_on_inv_line
+msgid "Allows you to invert Purchase Order Reference on the\n"
+" invoice lines."
+msgstr "Permet d'inverser la référence du Bon De Commande sur\n"
+" les lignes de facture."
+
+#. module: beesdoo_purchase
+#: model:ir.model,name:beesdoo_purchase.model_res_config_settings
+msgid "Config Settings"
+msgstr "Paramètres de configuration"
+
+#. module: beesdoo_purchase
+#: model:ir.model.fields,field_description:beesdoo_purchase.field_purchase_order__create_uid
+msgid "Create Uid"
+msgstr ""
+
+#. module: beesdoo_purchase
+#: model:res.groups,name:beesdoo_purchase.group_invert_po_ref_on_inv_line
+msgid "Invert Purchase Order Reference on invoice line"
+msgstr "Inverser la référence du Bon De Commande sur la ligne de facture"
+
+#. module: beesdoo_purchase
+#: model:ir.model,name:beesdoo_purchase.model_account_invoice
+msgid "Invoice"
+msgstr "Facture"
+
+#. module: beesdoo_purchase
+#: model:ir.model,name:beesdoo_purchase.model_purchase_order
+msgid "Purchase Order"
+msgstr "Commande fournisseur"
+
+#. module: beesdoo_purchase
+#: model:ir.model.fields,field_description:beesdoo_purchase.field_purchase_order__supervisor_id
+msgid "Responsible"
+msgstr "Responsable"
+
diff --git a/beesdoo_purchase/i18n/fr_BE.po b/beesdoo_purchase/i18n/fr_BE.po
index cd16936..e5eb8de 100644
--- a/beesdoo_purchase/i18n/fr_BE.po
+++ b/beesdoo_purchase/i18n/fr_BE.po
@@ -4,10 +4,10 @@
#
msgid ""
msgstr ""
-"Project-Id-Version: Odoo Server 9.0c\n"
+"Project-Id-Version: Odoo Server 12.0\n"
"Report-Msgid-Bugs-To: \n"
-"POT-Creation-Date: 2016-11-13 15:25+0000\n"
-"PO-Revision-Date: 2016-11-13 15:25+0000\n"
+"POT-Creation-Date: 2020-09-22 12:55+0000\n"
+"PO-Revision-Date: 2020-09-22 12:55+0000\n"
"Last-Translator: <>\n"
"Language-Team: \n"
"MIME-Version: 1.0\n"
@@ -15,8 +15,52 @@ msgstr ""
"Content-Transfer-Encoding: \n"
"Plural-Forms: \n"
+#. module: beesdoo_purchase
+#: model_terms:ir.ui.view,arch_db:beesdoo_purchase.report_purchaseorder_document
+msgid "Your Referent:"
+msgstr ""
+
+#. module: beesdoo_purchase
+#: model:ir.model.fields,field_description:beesdoo_purchase.field_res_config_settings__group_invert_po_ref_on_inv_line
+msgid "Allow inverting the Purchase Order Reference on the\n"
+" invoice lines"
+msgstr "Permet d'inverser la référence du Bon De Commande sur\n"
+" les lignes de facture"
+
+#. module: beesdoo_purchase
+#: model:ir.model.fields,help:beesdoo_purchase.field_res_config_settings__group_invert_po_ref_on_inv_line
+msgid "Allows you to invert Purchase Order Reference on the\n"
+" invoice lines."
+msgstr "Permet d'inverser la référence du Bon De Commande sur\n"
+" les lignes de facture."
+
+#. module: beesdoo_purchase
+#: model:ir.model,name:beesdoo_purchase.model_res_config_settings
+msgid "Config Settings"
+msgstr "Paramètres de configuration"
+
+#. module: beesdoo_purchase
+#: model:ir.model.fields,field_description:beesdoo_purchase.field_purchase_order__create_uid
+msgid "Create Uid"
+msgstr ""
+
+#. module: beesdoo_purchase
+#: model:res.groups,name:beesdoo_purchase.group_invert_po_ref_on_inv_line
+msgid "Invert Purchase Order Reference on invoice line"
+msgstr "Inverser la référence du Bon De Commande sur la ligne de facture"
+
+#. module: beesdoo_purchase
+#: model:ir.model,name:beesdoo_purchase.model_account_invoice
+msgid "Invoice"
+msgstr "Facture"
+
#. module: beesdoo_purchase
#: model:ir.model,name:beesdoo_purchase.model_purchase_order
msgid "Purchase Order"
msgstr "Commande fournisseur"
+#. module: beesdoo_purchase
+#: model:ir.model.fields,field_description:beesdoo_purchase.field_purchase_order__supervisor_id
+msgid "Responsible"
+msgstr "Responsable"
+
diff --git a/beesdoo_purchase/i18n/fr_CH.po b/beesdoo_purchase/i18n/fr_CH.po
new file mode 100644
index 0000000..e5eb8de
--- /dev/null
+++ b/beesdoo_purchase/i18n/fr_CH.po
@@ -0,0 +1,66 @@
+# Translation of Odoo Server.
+# This file contains the translation of the following modules:
+# * beesdoo_purchase
+#
+msgid ""
+msgstr ""
+"Project-Id-Version: Odoo Server 12.0\n"
+"Report-Msgid-Bugs-To: \n"
+"POT-Creation-Date: 2020-09-22 12:55+0000\n"
+"PO-Revision-Date: 2020-09-22 12:55+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: beesdoo_purchase
+#: model_terms:ir.ui.view,arch_db:beesdoo_purchase.report_purchaseorder_document
+msgid "Your Referent:"
+msgstr ""
+
+#. module: beesdoo_purchase
+#: model:ir.model.fields,field_description:beesdoo_purchase.field_res_config_settings__group_invert_po_ref_on_inv_line
+msgid "Allow inverting the Purchase Order Reference on the\n"
+" invoice lines"
+msgstr "Permet d'inverser la référence du Bon De Commande sur\n"
+" les lignes de facture"
+
+#. module: beesdoo_purchase
+#: model:ir.model.fields,help:beesdoo_purchase.field_res_config_settings__group_invert_po_ref_on_inv_line
+msgid "Allows you to invert Purchase Order Reference on the\n"
+" invoice lines."
+msgstr "Permet d'inverser la référence du Bon De Commande sur\n"
+" les lignes de facture."
+
+#. module: beesdoo_purchase
+#: model:ir.model,name:beesdoo_purchase.model_res_config_settings
+msgid "Config Settings"
+msgstr "Paramètres de configuration"
+
+#. module: beesdoo_purchase
+#: model:ir.model.fields,field_description:beesdoo_purchase.field_purchase_order__create_uid
+msgid "Create Uid"
+msgstr ""
+
+#. module: beesdoo_purchase
+#: model:res.groups,name:beesdoo_purchase.group_invert_po_ref_on_inv_line
+msgid "Invert Purchase Order Reference on invoice line"
+msgstr "Inverser la référence du Bon De Commande sur la ligne de facture"
+
+#. module: beesdoo_purchase
+#: model:ir.model,name:beesdoo_purchase.model_account_invoice
+msgid "Invoice"
+msgstr "Facture"
+
+#. module: beesdoo_purchase
+#: model:ir.model,name:beesdoo_purchase.model_purchase_order
+msgid "Purchase Order"
+msgstr "Commande fournisseur"
+
+#. module: beesdoo_purchase
+#: model:ir.model.fields,field_description:beesdoo_purchase.field_purchase_order__supervisor_id
+msgid "Responsible"
+msgstr "Responsable"
+
diff --git a/beesdoo_purchase/models/__init__.py b/beesdoo_purchase/models/__init__.py
index 370f577..415c11a 100644
--- a/beesdoo_purchase/models/__init__.py
+++ b/beesdoo_purchase/models/__init__.py
@@ -1 +1,3 @@
+from . import account_invoice
from . import purchase
+from . import res_config
diff --git a/beesdoo_purchase/models/account_invoice.py b/beesdoo_purchase/models/account_invoice.py
new file mode 100644
index 0000000..2bdf44c
--- /dev/null
+++ b/beesdoo_purchase/models/account_invoice.py
@@ -0,0 +1,16 @@
+from odoo import api, fields, models, _
+
+
+class AccountInvoice(models.Model):
+ _inherit = "account.invoice"
+
+ def _prepare_invoice_line_from_po_line(self, line):
+ """ Override parent's method to invert Purchase Order Reference on invoice line"""
+ invoice_line = super(
+ AccountInvoice, self
+ )._prepare_invoice_line_from_po_line(line)
+ if self.user_has_groups(
+ "beesdoo_purchase." "group_invert_po_ref_on_inv_line"
+ ):
+ invoice_line["name"] = line.name + ": " + line.order_id.name
+ return invoice_line
diff --git a/beesdoo_purchase/models/res_config.py b/beesdoo_purchase/models/res_config.py
new file mode 100644
index 0000000..7f36d18
--- /dev/null
+++ b/beesdoo_purchase/models/res_config.py
@@ -0,0 +1,13 @@
+from odoo import fields, models
+
+
+class ResConfigSettings(models.TransientModel):
+ _inherit = "res.config.settings"
+
+ group_invert_po_ref_on_inv_line = fields.Boolean(
+ """Allow inverting the Purchase Order Reference on the
+ invoice lines""",
+ implied_group="beesdoo_purchase." "group_invert_po_ref_on_inv_line",
+ help="""Allows you to invert Purchase Order Reference on the
+ invoice lines.""",
+ )
diff --git a/beesdoo_purchase/readme/CONFIGURE.rst b/beesdoo_purchase/readme/CONFIGURE.rst
new file mode 100644
index 0000000..fcce31a
--- /dev/null
+++ b/beesdoo_purchase/readme/CONFIGURE.rst
@@ -0,0 +1,5 @@
+The setting *Invert Purchase Order Reference on invoice line* needs to be checked.
+This can be done in these following ways:
+
+* on the Access Rights (Technical Settings) of the user (Invert Purchase Order Reference on invoice line)
+* on the Invoicing Settings inside of the section `Invoices` (Allow inverting the Purchase Order Reference on the invoice lines)
diff --git a/beesdoo_purchase/readme/DESCRIPTION.rst b/beesdoo_purchase/readme/DESCRIPTION.rst
index 6d9e566..8accc85 100644
--- a/beesdoo_purchase/readme/DESCRIPTION.rst
+++ b/beesdoo_purchase/readme/DESCRIPTION.rst
@@ -6,3 +6,4 @@ create_uid ORM field. His user's contact info is printed on
purchases orders as 'Referent'.
- A filter w.r.t. the mail sellers is placed on the products field of a
purchase order.
+- Allow inverting the Purchase Order Reference on the invoice lines.
diff --git a/beesdoo_purchase/security/invoice_security.xml b/beesdoo_purchase/security/invoice_security.xml
new file mode 100644
index 0000000..344d146
--- /dev/null
+++ b/beesdoo_purchase/security/invoice_security.xml
@@ -0,0 +1,9 @@
+
+
Table of contents
The setting Invert Purchase Order Reference on invoice line needs to be checked. +This can be done in these following ways:
+Bugs are tracked on GitHub 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 @@ -397,23 +408,23 @@ If you spotted it first, help us smashing it by providing a detailed and welcome
Do not contact contributors directly about support or help with technical issues.
This module is part of the beescoop/obeesdoo project on GitHub.
You are welcome to contribute.