diff --git a/procurement_suggest/__init__.py b/procurement_suggest/__init__.py deleted file mode 100644 index 80fe409..0000000 --- a/procurement_suggest/__init__.py +++ /dev/null @@ -1,24 +0,0 @@ -# -*- encoding: utf-8 -*- -############################################################################## -# -# Procurement Suggest module for Odoo -# Copyright (C) 2015 Akretion (http://www.akretion.com) -# @author Alexis de Lattre -# -# This program is free software: you can redistribute it and/or modify -# it under the terms of the GNU Affero General Public License as -# published by the Free Software Foundation, either version 3 of the -# License, or (at your option) any later version. -# -# This program is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU Affero General Public License for more details. -# -# You should have received a copy of the GNU Affero General Public License -# along with this program. If not, see . -# -############################################################################## - -from . import stock -from . import wizard diff --git a/procurement_suggest/__manifest__.py b/procurement_suggest/__manifest__.py deleted file mode 100644 index 3f71df1..0000000 --- a/procurement_suggest/__manifest__.py +++ /dev/null @@ -1,46 +0,0 @@ -# -*- encoding: utf-8 -*- -############################################################################## -# -# Procurement Suggest module for Odoo -# Copyright (C) 2015 Akretion (http://www.akretion.com) -# @author Alexis de Lattre -# -# This program is free software: you can redistribute it and/or modify -# it under the terms of the GNU Affero General Public License as -# published by the Free Software Foundation, either version 3 of the -# License, or (at your option) any later version. -# -# This program is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU Affero General Public License for more details. -# -# You should have received a copy of the GNU Affero General Public License -# along with this program. If not, see . -# -############################################################################## - - -{ - 'name': 'Procurement Suggest', - 'version': '0.1', - 'category': 'Procurements', - 'license': 'AGPL-3', - 'summary': 'Suggest POs/MOs from special suggest orderpoints', - 'description': """ -Procurement Suggest -=================== - -TODO - -This module has been written by Alexis de Lattre from Akretion . - """, - 'author': 'Akretion', - 'website': 'http://www.akretion.com', - 'depends': ['stock'], - 'data': [ - 'stock_view.xml', - 'wizard/procurement_suggest_view.xml', - ], - 'installable': False, -} diff --git a/procurement_suggest/i18n/fr.po b/procurement_suggest/i18n/fr.po deleted file mode 100644 index 0b1c339..0000000 --- a/procurement_suggest/i18n/fr.po +++ /dev/null @@ -1,212 +0,0 @@ -# Translation of Odoo Server. -# This file contains the translation of the following modules: -# * procurement_suggest -# -msgid "" -msgstr "" -"Project-Id-Version: Odoo Server 8.0\n" -"Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2015-12-07 15:19+0000\n" -"PO-Revision-Date: 2015-12-07 15:19+0000\n" -"Last-Translator: 2015-12-08\n" -"Language-Team: EL HADJ MIMOUNE Mourad \n" -"MIME-Version: 1.0\n" -"Content-Type: text/plain; charset=UTF-8\n" -"Content-Transfer-Encoding: \n" -"Plural-Forms: \n" - -#. module: procurement_suggest -#: code:addons/procurement_suggest/wizard/procurement_suggest.py:195 -#: code:addons/procurement_suggest/wizard/procurement_suggest.py:196 -#, python-format -msgid " Suggest" -msgstr " Suggerer" - -#. module: procurement_suggest -#: code:addons/procurement_suggest/wizard/procurement_suggest.py:202 -#, python-format -msgid "All requested quantities are null." -msgstr "Toutes les quantités recherchées sont null." - -#. module: procurement_suggest -#: view:procurement.create.from.suggest:procurement_suggest.procurement_create_from_suggest_form -#: view:procurement.suggest.generate:procurement_suggest.procurement_suggest_generate_form -msgid "Cancel" -msgstr "Annuler" - -#. module: procurement_suggest -#: model:ir.actions.act_window,name:procurement_suggest.procurement_create_from_suggest_action -#: view:procurement.create.from.suggest:procurement_suggest.procurement_create_from_suggest_form -msgid "Create Procurements" -msgstr "Créer un réappro" - -#. module: procurement_suggest -#: model:ir.model,name:procurement_suggest.model_procurement_create_from_suggest -msgid "Create Procurements from Procurement Suggestions" -msgstr "Créer un réappro à partir de Suggestions de réappro" - -#. module: procurement_suggest -#: view:procurement.create.from.suggest:procurement_suggest.procurement_create_from_suggest_form -msgid "Create Purchase Orders" -msgstr "Créer une commande d'achat" - -#. module: procurement_suggest -#: field:procurement.create.from.suggest,create_uid:0 -#: field:procurement.suggest,create_uid:0 -#: field:procurement.suggest.generate,create_uid:0 -msgid "Created by" -msgstr "Créé par" - -#. module: procurement_suggest -#: field:procurement.create.from.suggest,create_date:0 -#: field:procurement.suggest,create_date:0 -#: field:procurement.suggest.generate,create_date:0 -msgid "Created on" -msgstr "Créé le" - -#. module: procurement_suggest -#: field:procurement.suggest,procurement_qty:0 -msgid "Current Procurement Quantity" -msgstr "Qté réappro courrante" - -#. module: procurement_suggest -#: view:procurement.suggest.generate:procurement_suggest.procurement_suggest_generate_form -msgid "Generate" -msgstr "Générer" - -#. module: procurement_suggest -#: view:procurement.suggest.generate:procurement_suggest.procurement_suggest_generate_form -msgid "Generate Procurement Suggestions" -msgstr "Générer des Suggestions de réappro" - -#. module: procurement_suggest -#: view:procurement.suggest:procurement_suggest.procurement_suggest_search -msgid "Group By" -msgstr "Grouper par" - -#. module: procurement_suggest -#: field:procurement.create.from.suggest,id:0 -#: field:procurement.suggest,id:0 -#: field:procurement.suggest.generate,id:0 -msgid "ID" -msgstr "ID" - -#. module: procurement_suggest -#: field:procurement.suggest,incoming_qty:0 -msgid "Incoming Quantity" -msgstr "Qté Entrante" - -#. module: procurement_suggest -#: field:procurement.create.from.suggest,write_uid:0 -#: field:procurement.suggest,write_uid:0 -#: field:procurement.suggest.generate,write_uid:0 -msgid "Last Updated by" -msgstr "Dernière MAJ par" - -#. module: procurement_suggest -#: field:procurement.create.from.suggest,write_date:0 -#: field:procurement.suggest,write_date:0 -#: field:procurement.suggest.generate,write_date:0 -msgid "Last Updated on" -msgstr "Dernière MAJ le" - -#. module: procurement_suggest -#: model:ir.model,name:procurement_suggest.model_stock_warehouse_orderpoint -msgid "Minimum Inventory Rule" -msgstr "Règle de stock minimum" - -#. module: procurement_suggest -#: field:procurement.suggest,new_procurement_qty:0 -msgid "New Procurement Quantity" -msgstr "Qté à acheter" - -#. module: procurement_suggest -#: field:procurement.suggest,outgoing_qty:0 -msgid "Outgoing Quantity" -msgstr "Qté sortante" - -#. module: procurement_suggest -#: model:ir.actions.act_window,name:procurement_suggest.procurement_suggest_action -#: model:ir.actions.act_window,name:procurement_suggest.procurement_suggest_generate_action -#: model:ir.model,name:procurement_suggest.model_procurement_suggest -#: model:ir.ui.menu,name:procurement_suggest.procurement_suggest_generate_menu -#: view:procurement.suggest:procurement_suggest.procurement_suggest_search -#: view:procurement.suggest:procurement_suggest.procurement_suggest_tree -msgid "Procurement Suggestions" -msgstr "Suggestions" - -#. module: procurement_suggest -#: field:procurement.suggest,product_id:0 -msgid "Product" -msgstr "Article" - -#. module: procurement_suggest -#: field:procurement.suggest.generate,categ_id:0 -msgid "Product Category" -msgstr "Catégorie article" - -#. module: procurement_suggest -#: field:procurement.suggest,qty_available:0 -msgid "Quantity On Hand" -msgstr "Quantité en stock" - -#. module: procurement_suggest -#: field:procurement.suggest,orderpoint_id:0 -msgid "Re-ordering Rule" -msgstr "Règle de réassort" - -#. module: procurement_suggest -#: view:stock.warehouse.orderpoint:procurement_suggest.warehouse_orderpoint_search -msgid "Real" -msgstr "Réel" - -#. module: procurement_suggest -#: view:procurement.suggest:procurement_suggest.procurement_suggest_search -msgid "Seller" -msgstr "Fournisseur" - -#. module: procurement_suggest -#: model:ir.model,name:procurement_suggest.model_procurement_suggest_generate -msgid "Start to generate the procurement suggestions" -msgstr "Début de génération des suggestion de réappro" - -#. module: procurement_suggest -#: field:procurement.suggest.generate,location_id:0 -msgid "Stock Location" -msgstr "Emplacement de stock" - -#. module: procurement_suggest -#: view:stock.warehouse.orderpoint:procurement_suggest.warehouse_orderpoint_search -#: field:stock.warehouse.orderpoint,suggest:0 -msgid "Suggest" -msgstr "Suggerer" - -#. module: procurement_suggest -#: field:procurement.suggest,seller_id:0 -#: field:procurement.suggest.generate,seller_id:0 -msgid "Supplier" -msgstr "Fournisseur" - -#. module: procurement_suggest -#: code:addons/procurement_suggest/wizard/procurement_suggest.py:138 -#, python-format -msgid "The virtual stock for all related products is above the minimum stock level." -msgstr "Le stock virtuel des produits est au dessus de stock min." - -#. module: procurement_suggest -#: code:addons/procurement_suggest/wizard/procurement_suggest.py:102 -#, python-format -msgid "There are 2 orderpoints (%s and %s) for the same product on stock location %s or its children." -msgstr "Il y a 2 règle de stock min (%s and %s) pour le même article et le même dépot %s." - -#. module: procurement_suggest -#: view:procurement.create.from.suggest:procurement_suggest.procurement_create_from_suggest_form -msgid "This wizard will create procurements and confirm them, so that it creates purchase orders or manufacturing orders." -msgstr "Ce wizard créra des réapprot et les confirme. Ces réappro crééron des commandes d'achat ou des ordres de fabrication en fonction des articles." - - - - - - - diff --git a/procurement_suggest/odoo-procurement_suggest.patch b/procurement_suggest/odoo-procurement_suggest.patch deleted file mode 100644 index f415aa3..0000000 --- a/procurement_suggest/odoo-procurement_suggest.patch +++ /dev/null @@ -1,12 +0,0 @@ -diff --git a/addons/stock/procurement.py b/addons/stock/procurement.py -index 7b067ed..98857e6 100644 ---- a/addons/stock/procurement.py -+++ b/addons/stock/procurement.py -@@ -342,6 +342,7 @@ class procurement_order(osv.osv): - - procurement_obj = self.pool.get('procurement.order') - dom = company_id and [('company_id', '=', company_id)] or [] -+ dom.append(('suggest', '=', False)) - orderpoint_ids = orderpoint_obj.search(cr, uid, dom) - prev_ids = [] - while orderpoint_ids: diff --git a/procurement_suggest/static/description/icon.png b/procurement_suggest/static/description/icon.png deleted file mode 100644 index 1a60d0e..0000000 Binary files a/procurement_suggest/static/description/icon.png and /dev/null differ diff --git a/procurement_suggest/stock.py b/procurement_suggest/stock.py deleted file mode 100644 index fe2e41f..0000000 --- a/procurement_suggest/stock.py +++ /dev/null @@ -1,29 +0,0 @@ -# -*- encoding: utf-8 -*- -############################################################################## -# -# Procurement Suggest module for Odoo -# Copyright (C) 2015 Akretion (http://www.akretion.com) -# @author Alexis de Lattre -# -# This program is free software: you can redistribute it and/or modify -# it under the terms of the GNU Affero General Public License as -# published by the Free Software Foundation, either version 3 of the -# License, or (at your option) any later version. -# -# This program is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU Affero General Public License for more details. -# -# You should have received a copy of the GNU Affero General Public License -# along with this program. If not, see . -# -############################################################################## - -from openerp import models, fields - - -class StockWarehouseOrderpoint(models.Model): - _inherit = 'stock.warehouse.orderpoint' - - suggest = fields.Boolean(string='Suggest', default=True) diff --git a/procurement_suggest/stock_view.xml b/procurement_suggest/stock_view.xml deleted file mode 100644 index 1455cf9..0000000 --- a/procurement_suggest/stock_view.xml +++ /dev/null @@ -1,48 +0,0 @@ - - - - - - - - - procurement_suggest.orderpoint.form - stock.warehouse.orderpoint - - - - - - - - - - procurement_suggest.orderpoint.tree - stock.warehouse.orderpoint - - - - - - - - - - procurement_suggest.orderpoint.search - stock.warehouse.orderpoint - - - - - - - - - - - - diff --git a/procurement_suggest/wizard/__init__.py b/procurement_suggest/wizard/__init__.py deleted file mode 100644 index 3d2b6de..0000000 --- a/procurement_suggest/wizard/__init__.py +++ /dev/null @@ -1,23 +0,0 @@ -# -*- encoding: utf-8 -*- -############################################################################## -# -# Procurement Suggest module for Odoo -# Copyright (C) 2015 Akretion (http://www.akretion.com) -# @author Alexis de Lattre -# -# This program is free software: you can redistribute it and/or modify -# it under the terms of the GNU Affero General Public License as -# published by the Free Software Foundation, either version 3 of the -# License, or (at your option) any later version. -# -# This program is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU Affero General Public License for more details. -# -# You should have received a copy of the GNU Affero General Public License -# along with this program. If not, see . -# -############################################################################## - -from . import procurement_suggest diff --git a/procurement_suggest/wizard/procurement_suggest.py b/procurement_suggest/wizard/procurement_suggest.py deleted file mode 100644 index f354c2c..0000000 --- a/procurement_suggest/wizard/procurement_suggest.py +++ /dev/null @@ -1,204 +0,0 @@ -# -*- encoding: utf-8 -*- -############################################################################## -# -# Procurement Suggest module for Odoo -# Copyright (C) 2015 Akretion (http://www.akretion.com) -# @author Alexis de Lattre -# -# This program is free software: you can redistribute it and/or modify -# it under the terms of the GNU Affero General Public License as -# published by the Free Software Foundation, either version 3 of the -# License, or (at your option) any later version. -# -# This program is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU Affero General Public License for more details. -# -# You should have received a copy of the GNU Affero General Public License -# along with this program. If not, see . -# -############################################################################## - -from openerp import models, fields, api, _ -import openerp.addons.decimal_precision as dp -from openerp.exceptions import Warning -from openerp.tools import float_compare -import logging - -logger = logging.getLogger(__name__) - - -class ProcurementSuggestionGenerate(models.TransientModel): - _name = 'procurement.suggest.generate' - _description = 'Start to generate the procurement suggestions' - - categ_id = fields.Many2one( - 'product.category', string='Product Category') - seller_id = fields.Many2one( - 'res.partner', string='Supplier', - domain=[('supplier', '=', True), ('is_company', '=', True)]) - location_id = fields.Many2one( - 'stock.location', string='Stock Location', required=True, - default=lambda self: self.env.ref('stock.stock_location_stock')) - - @api.model - def _compute_procurement_qty(self, orderpoint): - procs = self.env['procurement.order'].search([ - ('state', 'not in', ('cancel', 'done', 'exception')), - ('orderpoint_id', '=', orderpoint.id)]) - puo = self.env['product.uom'] - proc_qty = 0 - for proc in procs: - proc_qty += puo._compute_qty_obj( - proc.product_uom, proc.product_qty, proc.product_id.uom_id) - # Only take into account the qty that is not already - # in the incoming qty or qty on hand - for move in proc.move_ids: - if move.state == 'draft': - proc_qty -= move.product_qty - return proc_qty - - @api.model - def _prepare_suggest_line(self, orderpoint): - sline = { - 'product_id': orderpoint.product_id.id, - 'seller_id': orderpoint.product_id.seller_id.id or False, - 'qty_available': orderpoint.product_id.qty_available, - 'incoming_qty': orderpoint.product_id.incoming_qty, - 'outgoing_qty': orderpoint.product_id.outgoing_qty, - 'procurement_qty': self._compute_procurement_qty(orderpoint), - 'orderpoint_id': orderpoint.id, - } - return sline - - @api.multi - def run(self): - pso = self.env['procurement.suggest'] - poo = self.env['procurement.order'] - swoo = self.env['stock.warehouse.orderpoint'] - op_domain = [ - ('suggest', '=', True), - ('company_id', '=', self.env.user.company_id.id), - ('location_id', 'child_of', self.location_id.id), - ] - if self.categ_id or self.seller_id: - product_domain = [] - if self.categ_id: - product_domain.append( - ('categ_id', 'child_of', self.categ_id.id)) - if self.seller_id: - product_domain.append( - ('seller_id', '=', self.seller_id.id)) - products = self.env['product.product'].search(product_domain) - op_domain.append(('product_id', 'in', products.ids)) - ops = swoo.search(op_domain) - p_suggest_lines = [] - lines = {} # key = product_id ; value = {'min_qty', ...} - for op in ops: - if op.product_id.id in lines: - raise Warning( - _("There are 2 orderpoints (%s and %s) for the same " - "product on stock location %s or its " - "children.") % ( - lines[op.product_id.id]['orderpoint'].name, - op.name, - self.location_id.complete_name)) - - virtual_qty = poo._product_virtual_get(op) - proc_qty = self._compute_procurement_qty(op) - product_qty = virtual_qty + proc_qty - logger.debug( - 'Product: %s Virtual qty = %s Cur. proc. qty = %s ' - 'Min. qty = %s', - op.product_id.name, virtual_qty, proc_qty, op.product_min_qty) - if float_compare( - product_qty, op.product_min_qty, - precision_rounding=op.product_uom.rounding) < 0: - logger.debug( - 'Create a procurement suggestion for %s', - op.product_id.name) - p_suggest_lines.append(self._prepare_suggest_line(op)) - p_suggest_lines_sorted = sorted( - p_suggest_lines, key=lambda to_sort: to_sort['seller_id']) - if p_suggest_lines_sorted: - p_suggest_ids = [] - for p_suggest_line in p_suggest_lines_sorted: - p_suggest = pso.create(p_suggest_line) - p_suggest_ids.append(p_suggest.id) - action = self.env['ir.actions.act_window'].for_xml_id( - 'procurement_suggest', 'procurement_suggest_action') - action.update({ - 'target': 'current', - 'domain': [('id', 'in', p_suggest_ids)], - }) - return action - else: - raise Warning(_( - "The virtual stock for all related products is above the " - "minimum stock level.")) - - -class ProcurementSuggest(models.TransientModel): - _name = 'procurement.suggest' - _description = 'Procurement Suggestions' - _rec_name = 'product_id' - - product_id = fields.Many2one( - 'product.product', string='Product', required=True, readonly=True) - seller_id = fields.Many2one( - 'res.partner', string='Supplier', readonly=True) - qty_available = fields.Float( - string='Quantity On Hand', readonly=True, - digits=dp.get_precision('Product Unit of Measure')) - incoming_qty = fields.Float( - string='Incoming Quantity', readonly=True, - digits=dp.get_precision('Product Unit of Measure')) - procurement_qty = fields.Float( - string='Current Procurement Quantity', readonly=True, - digits=dp.get_precision('Product Unit of Measure')) - outgoing_qty = fields.Float( - string='Outgoing Quantity', readonly=True, - digits=dp.get_precision('Product Unit of Measure')) - orderpoint_id = fields.Many2one( - 'stock.warehouse.orderpoint', string='Re-ordering Rule', - readonly=True) - uom_id = fields.Many2one( - 'product.uom', related='product_id.uom_id', readonly=True) - # on orderpoids, uom_id is a related field of product_id.uom_id - # so I do the same here - min_qty = fields.Float( - string="Min Quantity", readonly=True, - related='orderpoint_id.product_min_qty', - digits=dp.get_precision('Product Unit of Measure')) - new_procurement_qty = fields.Float( - string='New Procurement Quantity', - digits=dp.get_precision('Product Unit of Measure')) - - -class ProcurementCreateFromSuggest(models.TransientModel): - _name = 'procurement.create.from.suggest' - _description = 'Create Procurements from Procurement Suggestions' - - @api.multi - def create_proc(self): - self.ensure_one() - psuggest_ids = self.env.context.get('active_ids') - poo = self.env['procurement.order'] - new_procs = poo.browse(False) - for line in self.env['procurement.suggest'].browse(psuggest_ids): - if line.new_procurement_qty: - vals = poo._prepare_orderpoint_procurement( - line.orderpoint_id, line.new_procurement_qty) - vals['origin'] += _(' Suggest') - vals['name'] += _(' Suggest') - new_procs += poo.create(vals) - if new_procs: - new_procs.signal_workflow('button_confirm') - new_procs.run() - else: - raise Warning(_('All requested quantities are null.')) - action = self.env['ir.actions.act_window'].for_xml_id( - 'procurement', 'procurement_action') - action['domain'] = [('id', 'in', new_procs.ids)] - return action diff --git a/procurement_suggest/wizard/procurement_suggest_view.xml b/procurement_suggest/wizard/procurement_suggest_view.xml deleted file mode 100644 index bb74cc6..0000000 --- a/procurement_suggest/wizard/procurement_suggest_view.xml +++ /dev/null @@ -1,110 +0,0 @@ - - - - - - - - - procurement_suggest_generate.form - procurement.suggest.generate - -
- - - - - -
-
-
-
-
- - - Procurement Suggestions - procurement.suggest.generate - form - new - - - - - - procurement_suggest.tree - procurement.suggest - - - - - - - - - - - - - - - - - procurement_suggest.search - procurement.suggest - - - - - - - - - - - - - - Procurement Suggestions - procurement.suggest - tree - new - 500 - - - - procurement_create_from_suggest.form - procurement.create.from.suggest - -
-

- This wizard will create procurements and confirm them, so that it creates purchase orders or manufacturing orders. -

-
-
-
-
-
- - - - -
-
diff --git a/procurement_suggest_purchase/__init__.py b/procurement_suggest_purchase/__init__.py deleted file mode 100644 index 9809b86..0000000 --- a/procurement_suggest_purchase/__init__.py +++ /dev/null @@ -1,3 +0,0 @@ -# -*- encoding: utf-8 -*- - -from . import wizard diff --git a/procurement_suggest_purchase/__manifest__.py b/procurement_suggest_purchase/__manifest__.py deleted file mode 100644 index 2283df2..0000000 --- a/procurement_suggest_purchase/__manifest__.py +++ /dev/null @@ -1,45 +0,0 @@ -# -*- encoding: utf-8 -*- -############################################################################## -# -# Procurement Suggest Purchase module for Odoo -# Copyright (C) 2015 Akretion (http://www.akretion.com) -# @author Alexis de Lattre -# -# This program is free software: you can redistribute it and/or modify -# it under the terms of the GNU Affero General Public License as -# published by the Free Software Foundation, either version 3 of the -# License, or (at your option) any later version. -# -# This program is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU Affero General Public License for more details. -# -# You should have received a copy of the GNU Affero General Public License -# along with this program. If not, see . -# -############################################################################## - - -{ - 'name': 'Procurement Suggest Purchase', - 'version': '0.1', - 'category': 'Procurements', - 'license': 'AGPL-3', - 'summary': 'Usability enhancements to procurement suggest for purchase', - 'description': """ -Procurement Suggest Purchase -============================ - -TODO - -This module has been written by Alexis de Lattre from Akretion . - """, - 'author': 'Akretion', - 'website': 'http://www.akretion.com', - 'depends': ['purchase', 'procurement_suggest'], - 'data': [ - 'wizard/procurement_suggest_view.xml', - ], - 'installable': False, -} diff --git a/procurement_suggest_purchase/wizard/__init__.py b/procurement_suggest_purchase/wizard/__init__.py deleted file mode 100644 index ecb4ed5..0000000 --- a/procurement_suggest_purchase/wizard/__init__.py +++ /dev/null @@ -1,3 +0,0 @@ -# -*- encoding: utf-8 -*- - -from . import procurement_suggest diff --git a/procurement_suggest_purchase/wizard/procurement_suggest.py b/procurement_suggest_purchase/wizard/procurement_suggest.py deleted file mode 100644 index 21f64ac..0000000 --- a/procurement_suggest_purchase/wizard/procurement_suggest.py +++ /dev/null @@ -1,75 +0,0 @@ -# -*- encoding: utf-8 -*- -############################################################################## -# -# Procurement Suggest Purchase module for Odoo -# Copyright (C) 2015 Akretion (http://www.akretion.com) -# @author Alexis de Lattre -# -# This program is free software: you can redistribute it and/or modify -# it under the terms of the GNU Affero General Public License as -# published by the Free Software Foundation, either version 3 of the -# License, or (at your option) any later version. -# -# This program is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU Affero General Public License for more details. -# -# You should have received a copy of the GNU Affero General Public License -# along with this program. If not, see . -# -############################################################################## - -from openerp import models, fields, api - - -class ProcurementSuggestionGenerate(models.TransientModel): - _inherit = 'procurement.suggest.generate' - - @api.model - def _prepare_suggest_line(self, orderpoint): - sline = super(ProcurementSuggestionGenerate, self).\ - _prepare_suggest_line(orderpoint) - porderline_id = False - if orderpoint.product_id.seller_id: - porderlines = self.env['purchase.order.line'].search([ - ('state', 'not in', ('draft', 'cancel')), - ('product_id', '=', orderpoint.product_id.id)], - order='id desc', limit=1) - # I cannot filter on 'date_order' because it is not a stored field - porderline_id = porderlines and porderlines[0].id or False - sline['last_po_line_id'] = porderline_id - return sline - - -class ProcurementSuggest(models.TransientModel): - _inherit = 'procurement.suggest' - - last_po_line_id = fields.Many2one( - 'purchase.order.line', string='Last Purchase Order Line', - readonly=True) - last_po_date = fields.Datetime( - related='last_po_line_id.order_id.date_order', - string='Date of the last PO', readonly=True) - last_po_qty = fields.Float( - related='last_po_line_id.product_qty', readonly=True, - string='Quantity of the Last Order') - - -class ProcurementCreateFromSuggest(models.TransientModel): - _inherit = 'procurement.create.from.suggest' - - @api.multi - def create_proc(self): - action = super(ProcurementCreateFromSuggest, self).create_proc() - poo = self.env['procurement.order'] - new_procs = poo.browse(action['domain'][0][2]) - po_ids = [] - for proc in new_procs: - if proc.purchase_id and proc.purchase_id.id not in po_ids: - po_ids.append(proc.purchase_id.id) - if po_ids: - action = self.env['ir.actions.act_window'].for_xml_id( - 'purchase', 'purchase_rfq') - action['domain'] = [('id', 'in', po_ids)] - return action diff --git a/procurement_suggest_purchase/wizard/procurement_suggest_view.xml b/procurement_suggest_purchase/wizard/procurement_suggest_view.xml deleted file mode 100644 index b9f1e1d..0000000 --- a/procurement_suggest_purchase/wizard/procurement_suggest_view.xml +++ /dev/null @@ -1,27 +0,0 @@ - - - - - - - - - - procurement_suggest.tree - procurement.suggest - - - - - - - - - - - -