From 8a9c6c04f745ea5bc525974417f31dd757cc759e Mon Sep 17 00:00:00 2001 From: unknown Date: Mon, 25 Nov 2013 13:38:21 +0100 Subject: [PATCH] [RM] sale_stock_ownership moved to https://launchpad.net/purchase-wkfl --- sale_ownership/__init__.py | 20 ------ sale_ownership/__openerp__.py | 72 ------------------- sale_sourced_by_line/__openerp__.py | 2 +- stock_location_ownership/__init__.py | 22 ------ stock_location_ownership/__openerp__.py | 44 ------------ stock_location_ownership/model/__init__.py | 22 ------ stock_location_ownership/model/sale.py | 54 -------------- stock_location_ownership/model/stock.py | 34 --------- .../test/sale_order_not_sourced.yml | 38 ---------- .../test/sale_order_source.yml | 40 ----------- stock_location_ownership/view/sale_view.xml | 27 ------- stock_location_ownership/view/stock_view.xml | 15 ---- 12 files changed, 1 insertion(+), 389 deletions(-) delete mode 100644 sale_ownership/__init__.py delete mode 100644 sale_ownership/__openerp__.py delete mode 100644 stock_location_ownership/__init__.py delete mode 100644 stock_location_ownership/__openerp__.py delete mode 100644 stock_location_ownership/model/__init__.py delete mode 100644 stock_location_ownership/model/sale.py delete mode 100644 stock_location_ownership/model/stock.py delete mode 100644 stock_location_ownership/test/sale_order_not_sourced.yml delete mode 100644 stock_location_ownership/test/sale_order_source.yml delete mode 100644 stock_location_ownership/view/sale_view.xml delete mode 100644 stock_location_ownership/view/stock_view.xml diff --git a/sale_ownership/__init__.py b/sale_ownership/__init__.py deleted file mode 100644 index ef15c0593d9..00000000000 --- a/sale_ownership/__init__.py +++ /dev/null @@ -1,20 +0,0 @@ -# -*- coding: utf-8 -*- -############################################################################## -# -# Author: Guewen Baconnier -# Copyright 2013 Camptocamp SA -# -# 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 . -# -############################################################################## diff --git a/sale_ownership/__openerp__.py b/sale_ownership/__openerp__.py deleted file mode 100644 index cd18b30e789..00000000000 --- a/sale_ownership/__openerp__.py +++ /dev/null @@ -1,72 +0,0 @@ -# -*- coding: utf-8 -*- -############################################################################## -# -# Author: Guewen Baconnier -# Copyright 2013 Camptocamp SA -# -# 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': 'Sale Ownership', - 'version': '0.1', - 'author': 'Camptocamp', - 'category': 'Warehouse', - 'license': 'AGPL-3', - 'complexity': 'expert', - 'images': [], - 'website': "http://www.camptocamp.com", - 'description': """ -Sale Ownership -============== - -As of today, this addon does nothing more than installing its -dependencies. Its final goal is to handle the use case of having goods -owned by a supplier in our stock. - -Let's say we are a restaurant. We ask 10'000 bottles of wine to a supplier. -We receive the 10'000 bottles and store them in a stock location, but we -will not pay them directly. Instead, when we need bottles, we will take -them from the stock location and create an invoice that we have to pay to -our supplier. - -Technically, we have more than one way to accomplish this and that's why -this addon does not do it actually, however, thanks to its dependencies, -it gathers the necessary pieces: - -stock_location_ownership - Adds an ownership on the location, meaning that we are able to store - the bottles in a location and specify that the location is owned by our - supplier. - -sale_sourced_by_line - A different source location can be choosed on each sales order line. - So for one sale order line of 10 bottles, we can say that they will be - taken from the location owned by our supplier. - -sale_dropshipping - Allows to use dropshipping for the bottles, that is, they are directly - delivered from our supplier, as in some sense they have a stock - location in our stock. -""", - 'depends': ['stock_location_ownership', - 'sale_sourced_by_line', - 'sale_dropshipping', - ], - 'demo': [], - 'data': [], - 'test': [], - 'auto_install': True, - 'installable': True, - } diff --git a/sale_sourced_by_line/__openerp__.py b/sale_sourced_by_line/__openerp__.py index 384a15de9d2..806aa3f5fb1 100644 --- a/sale_sourced_by_line/__openerp__.py +++ b/sale_sourced_by_line/__openerp__.py @@ -44,5 +44,5 @@ 'test/sale_order_not_sourced.yml', ], 'auto_install': False, - 'installable': True, + 'installable': False, } diff --git a/stock_location_ownership/__init__.py b/stock_location_ownership/__init__.py deleted file mode 100644 index 643bee7abed..00000000000 --- a/stock_location_ownership/__init__.py +++ /dev/null @@ -1,22 +0,0 @@ -# -*- coding: utf-8 -*- -############################################################################## -# -# Author: Guewen Baconnier -# Copyright 2013 Camptocamp SA -# -# 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 model diff --git a/stock_location_ownership/__openerp__.py b/stock_location_ownership/__openerp__.py deleted file mode 100644 index bcd2582c085..00000000000 --- a/stock_location_ownership/__openerp__.py +++ /dev/null @@ -1,44 +0,0 @@ -# -*- coding: utf-8 -*- -############################################################################## -# -# Author: Guewen Baconnier -# Copyright 2013 Camptocamp SA -# -# 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': 'Stock Location Ownership', - 'version': '0.1', - 'author': 'Camptocamp', - 'category': 'Warehouse', - 'license': 'AGPL-3', - 'complexity': 'normal', - 'images': [], - 'website': "http://www.camptocamp.com", - 'description': """ -Stock Location Ownership -======================== - -Adds an ownership on the stock locations -""", - 'depends': ['stock', - ], - 'demo': [], - 'data': ['view/stock_view.xml', - ], - 'test': [], - 'auto_install': False, - 'installable': True, - } diff --git a/stock_location_ownership/model/__init__.py b/stock_location_ownership/model/__init__.py deleted file mode 100644 index 8f66ed0bc1e..00000000000 --- a/stock_location_ownership/model/__init__.py +++ /dev/null @@ -1,22 +0,0 @@ -# -*- coding: utf-8 -*- -############################################################################## -# -# Author: Guewen Baconnier -# Copyright 2013 Camptocamp SA -# -# 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 diff --git a/stock_location_ownership/model/sale.py b/stock_location_ownership/model/sale.py deleted file mode 100644 index 954d989506a..00000000000 --- a/stock_location_ownership/model/sale.py +++ /dev/null @@ -1,54 +0,0 @@ -# -*- coding: utf-8 -*- -############################################################################## -# -# Author: Guewen Baconnier -# Copyright 2013 Camptocamp SA -# -# 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.osv import orm, fields - - -class sale_order(orm.Model): - _inherit = 'sale.order' - - def _prepare_order_line_move(self, cr, uid, order, line, picking_id, - date_planned, context=None): - values = super(sale_order, self)._prepare_order_line_move( - cr, uid, order, line, picking_id, date_planned, context=context) - if line.location_id: - values['location_id'] = line.location_id.id - return values - - def _prepare_order_line_procurement(self, cr, uid, order, line, move_id, date_planned, - context=None): - values = super(sale_order, self)._prepare_order_line_procurement( - cr, uid, order, line, move_id, date_planned, context=context) - if line.location_id: - values['location_id'] = line.location_id.id - return values - - -class sale_order_line(orm.Model): - _inherit = 'sale.order.line' - - _columns = { - 'location_id': fields.many2one( - 'stock.location', - 'Source Location', - help="If a source location is selected, " - "it will be used as source of the stock moves. "), - } diff --git a/stock_location_ownership/model/stock.py b/stock_location_ownership/model/stock.py deleted file mode 100644 index 5a7e46e2859..00000000000 --- a/stock_location_ownership/model/stock.py +++ /dev/null @@ -1,34 +0,0 @@ -# -*- coding: utf-8 -*- -############################################################################## -# -# Author: Guewen Baconnier -# Copyright 2013 Camptocamp SA -# -# 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.osv import orm, fields - - -class stock_location(orm.Model): - _inherit = 'stock.location' - - _columns = { - 'owner_id': fields.many2one( - 'res.partner', - 'Owner', - help="Owner of the location if different from the company " - "or address."), - } diff --git a/stock_location_ownership/test/sale_order_not_sourced.yml b/stock_location_ownership/test/sale_order_not_sourced.yml deleted file mode 100644 index 97aca450fc7..00000000000 --- a/stock_location_ownership/test/sale_order_not_sourced.yml +++ /dev/null @@ -1,38 +0,0 @@ -- - In order to check if the source location of a sale order line - still use the location of the shop if not specified on the - sale order line. -- - !record {model: sale.order, id: sale_notsourced_01}: - partner_id: base.res_partner_2 - note: Invoice after delivery - order_line: - - product_id: product.product_product_7 - product_uom_qty: 8 -- - When I confirm the sale order -- - !workflow {model: sale.order, action: order_confirm, ref: sale_notsourced_01} -- - Then a delivery order should have been generated -- - !python {model: sale.order}: | - sale_order = self.browse(cr, uid, ref("sale_notsourced_01")) - assert len(sale_order.picking_ids) == 1, ( - "1 delivery order expected, got %d" % len(sale_order.picking_ids)) -- - And the source location of the stock move should be the one of - the sales order's shop -- - !python {model: sale.order}: | - sale_order = self.browse(cr, uid, ref("sale_notsourced_01")) - picking = sale_order.picking_ids[0] - location_id = sale_order.shop_id.warehouse_id.lot_stock_id - for move in picking.move_lines: - assert move.location_id == location_id, ( - "Wrong location_id, expected %s, got %s" % - (location_id, move.location_id)) - for procurement in move.procurements: - assert procurement.location_id == location_id, ( - "Wrong location_id in procurement.order, expected %s, got %s" % - (location_id, procurement.location_id)) diff --git a/stock_location_ownership/test/sale_order_source.yml b/stock_location_ownership/test/sale_order_source.yml deleted file mode 100644 index ac2572cd117..00000000000 --- a/stock_location_ownership/test/sale_order_source.yml +++ /dev/null @@ -1,40 +0,0 @@ -- - In order to check if the source location of a sale order line - becomes the source location of the delivery stock move. - I create a sale order. -- - !record {model: sale.order, id: sale_source_01}: - partner_id: base.res_partner_2 - note: Invoice after delivery - order_line: - - product_id: product.product_product_7 - product_uom_qty: 8 - location_id: stock.stock_location_shop1 -- - When I confirm the sale order -- - !workflow {model: sale.order, action: order_confirm, ref: sale_source_01} -- - Then a delivery order should have been generated -- - !python {model: sale.order}: | - sale_order = self.browse(cr, uid, ref("sale_source_01")) - assert len(sale_order.picking_ids) == 1, ( - "1 delivery order expected, got %d" % len(sale_order.picking_ids)) -- - And the source location of the stock move should be the one of - the sale order line -- - !python {model: sale.order}: | - sale_order = self.browse(cr, uid, ref("sale_source_01")) - picking = sale_order.picking_ids[0] - for move in picking.move_lines: - expected_location_id = move.sale_line_id.location_id - assert move.location_id == expected_location_id, ( - "Wrong location_id in stock.move, expected %s, got %s" % - (expected_location_id, move.location_id)) - for procurement in move.procurements: - assert procurement.location_id == expected_location_id, ( - "Wrong location_id in procurement.order, expected %s, got %s" % - (expected_location_id, procurement.location_id)) - diff --git a/stock_location_ownership/view/sale_view.xml b/stock_location_ownership/view/sale_view.xml deleted file mode 100644 index c60e8d3cb5b..00000000000 --- a/stock_location_ownership/view/sale_view.xml +++ /dev/null @@ -1,27 +0,0 @@ - - - - - sale.order.form - sale.order - - - - - - - - - sale.order.form - sale.order - - - - - - - - - diff --git a/stock_location_ownership/view/stock_view.xml b/stock_location_ownership/view/stock_view.xml deleted file mode 100644 index a6df89d228c..00000000000 --- a/stock_location_ownership/view/stock_view.xml +++ /dev/null @@ -1,15 +0,0 @@ - - - - - stock.location.form - stock.location - - - - - - - - -