From ee91b30fc610d169d7f01310b3d06212c0e998ef Mon Sep 17 00:00:00 2001 From: chafique-delli Date: Mon, 4 Jul 2016 17:41:07 +0200 Subject: [PATCH] finalization of the purchase_suggest_supplierinfo_on_product module --- .../__init__.py | 2 + .../__openerp__.py | 28 +++---- .../i18n/fr.po | 74 +++++++++++++++++++ .../wizard/__init__.py | 3 + .../wizard/purchase_suggest.py | 9 ++- .../wizard/purchase_suggest_view.xml | 19 +++++ 6 files changed, 117 insertions(+), 18 deletions(-) create mode 100644 purchase_suggest_supplierinfo_on_product/i18n/fr.po diff --git a/purchase_suggest_supplierinfo_on_product/__init__.py b/purchase_suggest_supplierinfo_on_product/__init__.py index 3b4c3ed..1eb0237 100644 --- a/purchase_suggest_supplierinfo_on_product/__init__.py +++ b/purchase_suggest_supplierinfo_on_product/__init__.py @@ -1,3 +1,5 @@ # -*- coding: utf-8 -*- +# © 2016 Chafique DELLI @ Akretion +# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html). from . import wizard diff --git a/purchase_suggest_supplierinfo_on_product/__openerp__.py b/purchase_suggest_supplierinfo_on_product/__openerp__.py index 4968989..78ec149 100644 --- a/purchase_suggest_supplierinfo_on_product/__openerp__.py +++ b/purchase_suggest_supplierinfo_on_product/__openerp__.py @@ -1,24 +1,20 @@ # -*- coding: utf-8 -*- - +# © 2016 Chafique DELLI @ Akretion +# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html). { 'name': 'Purchase Suggest Supplierinfo on Product', - 'version': '0.1', - 'category': 'Purchase', - 'license': 'AGPL-3', 'summary': 'Replace orderpoints by supplierinfo on product', - 'description': """ -Purchase Suggest Supplierinfo on Product -======================================== - -With this module, instead of using orderpoints, we use supplierinfos on product. - -This module has been written by Chafique DELLI from Akretion . - """, + 'version': '8.0.1.0.0', + 'category': 'Purchase Management', + 'website': 'http://akretion.com', 'author': 'Akretion', - 'website': 'http://www.akretion.com', - 'depends': ['purchase_suggest', 'product_variant_supplierinfo'], + 'license': 'AGPL-3', + 'installable': True, + 'depends': [ + 'purchase_suggest', + 'product_variant_supplierinfo' + ], 'data': [ 'wizard/purchase_suggest_view.xml', - ], - 'installable': True, + ] } diff --git a/purchase_suggest_supplierinfo_on_product/i18n/fr.po b/purchase_suggest_supplierinfo_on_product/i18n/fr.po new file mode 100644 index 0000000..bcf75e9 --- /dev/null +++ b/purchase_suggest_supplierinfo_on_product/i18n/fr.po @@ -0,0 +1,74 @@ +# Translation of Odoo Server. +# This file contains the translation of the following modules: +# * purchase_suggest_supplierinfo_on_product +# +msgid "" +msgstr "" +"Project-Id-Version: Odoo Server 8.0\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2016-07-04 13:57+0000\n" +"PO-Revision-Date: 2016-07-04 13:57+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: purchase_suggest_supplierinfo_on_product +#: view:purchase.suggest.generate:purchase_suggest_supplierinfo_on_product.purchase_suggest_generate_form +msgid "Create Purchase Orders" +msgstr "Créer les commandes d'achat" + +#. module: purchase_suggest_supplierinfo_on_product +#: view:purchase.suggest.generate:purchase_suggest_supplierinfo_on_product.purchase_suggest_generate_form +msgid "More" +msgstr "Autres options" + +#. module: purchase_suggest_supplierinfo_on_product +#: view:purchase.suggest.generate:purchase_suggest_supplierinfo_on_product.purchase_suggest_generate_form +msgid "Once you have changed the Draft PO Quantity for all the lines you would like to re-order, select this lines and click on" +msgstr "Une fois que vous avez modifié la quantité de la demande de prix pour toutes les lignes pour lesquelles vous souhaitez re-commander, sélectionnez ces lignes et cliquer sur" + +#. module: purchase_suggest_supplierinfo_on_product +#: model:ir.model,name:purchase_suggest_supplierinfo_on_product.model_purchase_suggest +msgid "Purchase Suggestions" +msgstr "Suggestion réappro" + +#. module: purchase_suggest_supplierinfo_on_product +#: model:ir.model,name:purchase_suggest_supplierinfo_on_product.model_purchase_suggest_generate +msgid "Start to generate the purchase suggestions" +msgstr "Commencer à générer les suggestions d'achat" + +#. module: purchase_suggest_supplierinfo_on_product +#: code:addons/purchase_suggest_supplierinfo_on_product/wizard/purchase_suggest.py:111 +#, python-format +msgid "The new quantity for the existing purchase order line can not be less than the old quantity" +msgstr "La nouvelle quantité pour la ligne de commande d'achat existante ne peut pas être inférieure à l'ancienne quantité" + +#. module: purchase_suggest_supplierinfo_on_product +#: view:purchase.suggest.generate:purchase_suggest_supplierinfo_on_product.purchase_suggest_generate_form +msgid "The purchase suggestion lines display as much information as possible to help you take the decision on the quantity that you would like to re-order. When you have decided the quantity you want to re-order, add the quantity at the value in the Draft PO Quantity column." +msgstr "Les lignes de suggestion d'achat affichent autant d'informations que possible afin de vous aider à évaluer la quantité à re-commander. Quand vous avez décidé de la quantité à re-commander, ajouter cette quantité à la valeur de la colonne Quantité Demande de Prix." + +#. module: purchase_suggest_supplierinfo_on_product +#: code:addons/purchase_suggest_supplierinfo_on_product/wizard/purchase_suggest.py:95 +#, python-format +msgid "There are no purchase suggestions to generate." +msgstr "Aucune suggestion d'achat à faire." + +#. module: purchase_suggest_supplierinfo_on_product +#: view:purchase.suggest:purchase_suggest_supplierinfo_on_product.purchase_suggest_tree +msgid "context.get('purchase_suggest_supplier')" +msgstr "context.get('purchase_suggest_supplier')" + +#. module: purchase_suggest_supplierinfo_on_product +#: view:purchase.suggest.generate:purchase_suggest_supplierinfo_on_product.purchase_suggest_generate_form +msgid "if found product then it will create a purchase suggestion line" +msgstr "il sera créé autant de lignes de suggestion d'achat que de produits trouvés" + +#. module: purchase_suggest_supplierinfo_on_product +#: view:purchase.suggest.generate:purchase_suggest_supplierinfo_on_product.purchase_suggest_generate_form +msgid "it will search all the products linked to the selected stock location and suppliers, limited to the product categories if some were selected" +msgstr "il recherchera tous les produits pour les emplacements et les fournisseurs sélectionnés, en filtrant également sur la catégorie si l'option a été renseignée" + diff --git a/purchase_suggest_supplierinfo_on_product/wizard/__init__.py b/purchase_suggest_supplierinfo_on_product/wizard/__init__.py index 846ea38..6309bf2 100644 --- a/purchase_suggest_supplierinfo_on_product/wizard/__init__.py +++ b/purchase_suggest_supplierinfo_on_product/wizard/__init__.py @@ -1,3 +1,6 @@ # -*- coding: utf-8 -*- +# © 2016 Chafique DELLI @ Akretion +# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html). + from . import purchase_suggest diff --git a/purchase_suggest_supplierinfo_on_product/wizard/purchase_suggest.py b/purchase_suggest_supplierinfo_on_product/wizard/purchase_suggest.py index 33454c2..ac7f01c 100644 --- a/purchase_suggest_supplierinfo_on_product/wizard/purchase_suggest.py +++ b/purchase_suggest_supplierinfo_on_product/wizard/purchase_suggest.py @@ -1,4 +1,6 @@ # -*- coding: utf-8 -*- +# © 2016 Chafique DELLI @ Akretion +# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html). from openerp import models, fields, api, _ @@ -15,6 +17,7 @@ class PurchaseSuggestionGenerate(models.TransientModel): sline = super(PurchaseSuggestionGenerate, self)._prepare_suggest_line( product_id, qty_dict) sline['company_id'] = self.env.user.company_id.id + sline['qty_to_order'] = 0.0 if sline['seller_id'] not in self.seller_ids.ids: product = self.env['product.product'].browse(sline['product_id']) for supplierinfo in product.seller_ids: @@ -102,11 +105,13 @@ class PurchaseSuggest(models.TransientModel): @api.multi def write(self, vals): - vals['qty_to_order'] = 0.0 + #vals['qty_to_order'] = 0.0 if 'draft_po_qty' in vals: if vals['draft_po_qty'] > self.draft_po_qty: vals['qty_to_order'] = vals['draft_po_qty'] - self.draft_po_qty else: - raise Warning(_("La nouvelle quantité sur la commande ne peut pas être inférieure à l'anciennne quantité")) + raise Warning(_('The new quantity for the existing ' + 'purchase order line can not be less than ' + 'the old quantity')) super(PurchaseSuggest, self).write(vals) return True diff --git a/purchase_suggest_supplierinfo_on_product/wizard/purchase_suggest_view.xml b/purchase_suggest_supplierinfo_on_product/wizard/purchase_suggest_view.xml index 757b109..b5ba5fd 100644 --- a/purchase_suggest_supplierinfo_on_product/wizard/purchase_suggest_view.xml +++ b/purchase_suggest_supplierinfo_on_product/wizard/purchase_suggest_view.xml @@ -19,5 +19,24 @@ + + purchase.suggest.generate + + + +
    +
  1. it will search all the products linked to the selected stock location and suppliers, limited to the product categories if some were selected
  2. +
  3. if found product then it will create a purchase suggestion line
  4. +
+
+ +

The purchase suggestion lines display as much information as possible to help you take the decision on the quantity that you would like to re-order. When you have decided the quantity you want to re-order, add the quantity at the value in the Draft PO Quantity column.

+
+ +

Once you have changed the Draft PO Quantity for all the lines you would like to re-order, select this lines and click on More > Create Purchase Orders

+
+
+
+