Browse Source

Merge pull request #184 from beescoop/12.0-beesdoo_purchase-po-mgmt

[12.0] beesdoo_purchase: allow inverting PO reference on invoice line
pull/188/merge
Rémy Taymans 4 years ago
committed by GitHub
parent
commit
d81c214518
No known key found for this signature in database GPG Key ID: 4AEE18F83AFDEB23
  1. 10
      beesdoo_purchase/README.rst
  2. 14
      beesdoo_purchase/__manifest__.py
  3. 66
      beesdoo_purchase/i18n/fr.po
  4. 50
      beesdoo_purchase/i18n/fr_BE.po
  5. 66
      beesdoo_purchase/i18n/fr_CH.po
  6. 2
      beesdoo_purchase/models/__init__.py
  7. 16
      beesdoo_purchase/models/account_invoice.py
  8. 13
      beesdoo_purchase/models/res_config.py
  9. 5
      beesdoo_purchase/readme/CONFIGURE.rst
  10. 1
      beesdoo_purchase/readme/DESCRIPTION.rst
  11. 9
      beesdoo_purchase/security/invoice_security.xml
  12. 33
      beesdoo_purchase/static/description/index.html
  13. 23
      beesdoo_purchase/views/res_config_settings_view.xml

10
beesdoo_purchase/README.rst

@ -27,12 +27,22 @@ create_uid ORM field. His user's contact info is printed on
purchases orders as 'Referent'. purchases orders as 'Referent'.
- A filter w.r.t. the mail sellers is placed on the products field of a - 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.
**Table of contents** **Table of contents**
.. contents:: .. contents::
:local: :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 Bug Tracker
=========== ===========

14
beesdoo_purchase/__manifest__.py

@ -1,15 +1,21 @@
{ {
"name": "Bees Purchase", "name": "Bees Purchase",
"summary": """ "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 - 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", "author": "Beescoop - Cellule IT, " "Coop IT Easy SCRLfs",
"website": "https://github.com/beescoop/Obeesdoo", "website": "https://github.com/beescoop/Obeesdoo",
"category": "Purchase", "category": "Purchase",
"version": "12.0.1.1.0",
"version": "12.0.1.2.0",
"depends": ["base", "purchase", "beesdoo_product"], "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", "license": "AGPL-3",
} }

66
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 "<strong>Your Referent:</strong>"
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"

50
beesdoo_purchase/i18n/fr_BE.po

@ -4,10 +4,10 @@
# #
msgid "" msgid ""
msgstr "" msgstr ""
"Project-Id-Version: Odoo Server 9.0c\n"
"Project-Id-Version: Odoo Server 12.0\n"
"Report-Msgid-Bugs-To: \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" "Last-Translator: <>\n"
"Language-Team: \n" "Language-Team: \n"
"MIME-Version: 1.0\n" "MIME-Version: 1.0\n"
@ -15,8 +15,52 @@ msgstr ""
"Content-Transfer-Encoding: \n" "Content-Transfer-Encoding: \n"
"Plural-Forms: \n" "Plural-Forms: \n"
#. module: beesdoo_purchase
#: model_terms:ir.ui.view,arch_db:beesdoo_purchase.report_purchaseorder_document
msgid "<strong>Your Referent:</strong>"
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 #. module: beesdoo_purchase
#: model:ir.model,name:beesdoo_purchase.model_purchase_order #: model:ir.model,name:beesdoo_purchase.model_purchase_order
msgid "Purchase Order" msgid "Purchase Order"
msgstr "Commande fournisseur" msgstr "Commande fournisseur"
#. module: beesdoo_purchase
#: model:ir.model.fields,field_description:beesdoo_purchase.field_purchase_order__supervisor_id
msgid "Responsible"
msgstr "Responsable"

66
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 "<strong>Your Referent:</strong>"
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"

2
beesdoo_purchase/models/__init__.py

@ -1 +1,3 @@
from . import account_invoice
from . import purchase from . import purchase
from . import res_config

16
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

13
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.""",
)

5
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)

1
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'. purchases orders as 'Referent'.
- A filter w.r.t. the mail sellers is placed on the products field of a - 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.

9
beesdoo_purchase/security/invoice_security.xml

@ -0,0 +1,9 @@
<?xml version="1.0" encoding="utf-8"?>
<odoo>
<record id="group_invert_po_ref_on_inv_line" model="res.groups">
<field name="name">Invert Purchase Order Reference on invoice line</field>
<field name="category_id" ref="base.module_category_hidden"/>
</record>
</odoo>

33
beesdoo_purchase/static/description/index.html

@ -375,21 +375,32 @@ the creator in the order’s mail messages followers list, and in the
create_uid ORM field. His user’s contact info is printed on create_uid ORM field. His user’s contact info is printed on
purchases orders as ‘Referent’. purchases orders as ‘Referent’.
- A filter w.r.t. the mail sellers is placed on the products field of a - A filter w.r.t. the mail sellers is placed on the products field of a
purchase order.</p>
purchase order.
- Allow inverting the Purchase Order Reference on the invoice lines.</p>
<p><strong>Table of contents</strong></p> <p><strong>Table of contents</strong></p>
<div class="contents local topic" id="contents"> <div class="contents local topic" id="contents">
<ul class="simple"> <ul class="simple">
<li><a class="reference internal" href="#bug-tracker" id="id1">Bug Tracker</a></li>
<li><a class="reference internal" href="#credits" id="id2">Credits</a><ul>
<li><a class="reference internal" href="#authors" id="id3">Authors</a></li>
<li><a class="reference internal" href="#contributors" id="id4">Contributors</a></li>
<li><a class="reference internal" href="#maintainers" id="id5">Maintainers</a></li>
<li><a class="reference internal" href="#configuration" id="id1">Configuration</a></li>
<li><a class="reference internal" href="#bug-tracker" id="id2">Bug Tracker</a></li>
<li><a class="reference internal" href="#credits" id="id3">Credits</a><ul>
<li><a class="reference internal" href="#authors" id="id4">Authors</a></li>
<li><a class="reference internal" href="#contributors" id="id5">Contributors</a></li>
<li><a class="reference internal" href="#maintainers" id="id6">Maintainers</a></li>
</ul> </ul>
</li> </li>
</ul> </ul>
</div> </div>
<div class="section" id="configuration">
<h1><a class="toc-backref" href="#id1">Configuration</a></h1>
<p>The setting <em>Invert Purchase Order Reference on invoice line</em> needs to be checked.
This can be done in these following ways:</p>
<ul class="simple">
<li>on the Access Rights (Technical Settings) of the user (Invert Purchase Order Reference on invoice line)</li>
<li>on the Invoicing Settings inside of the section <cite>Invoices</cite> (Allow inverting the Purchase Order Reference on the invoice lines)</li>
</ul>
</div>
<div class="section" id="bug-tracker"> <div class="section" id="bug-tracker">
<h1><a class="toc-backref" href="#id1">Bug Tracker</a></h1>
<h1><a class="toc-backref" href="#id2">Bug Tracker</a></h1>
<p>Bugs are tracked on <a class="reference external" href="https://github.com/beescoop/obeesdoo/issues">GitHub Issues</a>. <p>Bugs are tracked on <a class="reference external" href="https://github.com/beescoop/obeesdoo/issues">GitHub Issues</a>.
In case of trouble, please check there if your issue has already been reported. 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 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
<p>Do not contact contributors directly about support or help with technical issues.</p> <p>Do not contact contributors directly about support or help with technical issues.</p>
</div> </div>
<div class="section" id="credits"> <div class="section" id="credits">
<h1><a class="toc-backref" href="#id2">Credits</a></h1>
<h1><a class="toc-backref" href="#id3">Credits</a></h1>
<div class="section" id="authors"> <div class="section" id="authors">
<h2><a class="toc-backref" href="#id3">Authors</a></h2>
<h2><a class="toc-backref" href="#id4">Authors</a></h2>
<ul class="simple"> <ul class="simple">
<li>Beescoop - Cellule IT</li> <li>Beescoop - Cellule IT</li>
<li>Coop IT Easy SCRLfs</li> <li>Coop IT Easy SCRLfs</li>
</ul> </ul>
</div> </div>
<div class="section" id="contributors"> <div class="section" id="contributors">
<h2><a class="toc-backref" href="#id4">Contributors</a></h2>
<h2><a class="toc-backref" href="#id5">Contributors</a></h2>
<ul class="simple"> <ul class="simple">
<li>Beescoop - Cellule IT</li> <li>Beescoop - Cellule IT</li>
<li>Coop IT Easy SCRLfs</li> <li>Coop IT Easy SCRLfs</li>
</ul> </ul>
</div> </div>
<div class="section" id="maintainers"> <div class="section" id="maintainers">
<h2><a class="toc-backref" href="#id5">Maintainers</a></h2>
<h2><a class="toc-backref" href="#id6">Maintainers</a></h2>
<p>This module is part of the <a class="reference external" href="https://github.com/beescoop/obeesdoo/tree/12.0/beesdoo_purchase">beescoop/obeesdoo</a> project on GitHub.</p> <p>This module is part of the <a class="reference external" href="https://github.com/beescoop/obeesdoo/tree/12.0/beesdoo_purchase">beescoop/obeesdoo</a> project on GitHub.</p>
<p>You are welcome to contribute.</p> <p>You are welcome to contribute.</p>
</div> </div>

23
beesdoo_purchase/views/res_config_settings_view.xml

@ -0,0 +1,23 @@
<?xml version="1.0" encoding="utf-8"?>
<odoo>
<record id="res_config_settings_view_form" model="ir.ui.view">
<field name="name">res invoice line description settings</field>
<field name="model">res.config.settings</field>
<field name="inherit_id" ref="account.res_config_settings_view_form"/>
<field name="arch" type="xml">
<xpath
expr="//div[@id='invoicing_settings']"
position="inside">
<div class="col-xs-12 col-md-6 o_setting_box">
<div class="o_setting_left_pane">
<field name="group_invert_po_ref_on_inv_line"/>
</div>
<div class="o_setting_right_pane">
<label for="group_invert_po_ref_on_inv_line"/>
</div>
</div>
</xpath>
</field>
</record>
</odoo>
Loading…
Cancel
Save