From 978801685ed20fc6e9a8cb3b72ef627319a92136 Mon Sep 17 00:00:00 2001 From: Leonardo Pistone Date: Wed, 26 Nov 2014 15:41:04 +0100 Subject: [PATCH 1/6] the reservation should reserve a quant For weird reasons, force-assigning a move does not associate quants. action_assign'ing the picking does, and is the same procedure that you can do via the interface. --- stock_reserve/model/stock_reserve.py | 2 +- stock_reserve/test/stock_reserve.yml | 8 ++++++++ 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/stock_reserve/model/stock_reserve.py b/stock_reserve/model/stock_reserve.py index 0b61a8b69..9581b47d9 100644 --- a/stock_reserve/model/stock_reserve.py +++ b/stock_reserve/model/stock_reserve.py @@ -125,7 +125,7 @@ class StockReservation(models.Model): move_recs = self.move_id move_recs.date_expected = fields.Datetime.now() move_recs.action_confirm() - move_recs.force_assign() + move_recs.picking_id.action_assign() return True @api.multi diff --git a/stock_reserve/test/stock_reserve.yml b/stock_reserve/test/stock_reserve.yml index e23ac9465..66b6f412e 100644 --- a/stock_reserve/test/stock_reserve.yml +++ b/stock_reserve/test/stock_reserve.yml @@ -62,6 +62,14 @@ - !python {model: stock.reservation}: | self.reserve(cr, uid, [ref('reserv_sorbet2')], context=context) +- + Then the reservation should be assigned and have reserved a quant +- + !python {model: stock.reservation, id: reserv_sorbet2}: | + from nose.tools import * + + assert_equal('assigned', self.state) + assert_equal(1, len(self.reserved_quant_ids)) - I check Virtual stock of Sorbet after update reservation - From d3c0f57a5d9e78bfec2a94f665401df344282889 Mon Sep 17 00:00:00 2001 From: Leonardo Pistone Date: Wed, 26 Nov 2014 15:45:03 +0100 Subject: [PATCH 2/6] refactor: get rid of move_recs --- stock_reserve/model/stock_reserve.py | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/stock_reserve/model/stock_reserve.py b/stock_reserve/model/stock_reserve.py index 9581b47d9..aab360675 100644 --- a/stock_reserve/model/stock_reserve.py +++ b/stock_reserve/model/stock_reserve.py @@ -122,10 +122,9 @@ class StockReservation(models.Model): The reservation is done using the default UOM of the product. A date until which the product is reserved can be specified. """ - move_recs = self.move_id - move_recs.date_expected = fields.Datetime.now() - move_recs.action_confirm() - move_recs.picking_id.action_assign() + self.date_expected = fields.Datetime.now() + self.move_id.action_confirm() + self.move_id.picking_id.action_assign() return True @api.multi From fd3af07ba7f0f2e9a5938179de9858bb1e0dc3ae Mon Sep 17 00:00:00 2001 From: Yannick Vaucher Date: Tue, 16 Dec 2014 11:19:08 +0100 Subject: [PATCH 3/6] Separated Lint tests --- .travis.yml | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/.travis.yml b/.travis.yml index e97406f77..07eae3221 100644 --- a/.travis.yml +++ b/.travis.yml @@ -6,8 +6,9 @@ python: - "2.7" env: - - VERSION="8.0" ODOO_REPO="odoo/odoo" - - VERSION="8.0" ODOO_REPO="OCA/OCB" + - VERSION="8.0" LINT_CHECK="1" + - VERSION="8.0" ODOO_REPO="odoo/odoo" LINT_CHECK="0" + - VERSION="8.0" ODOO_REPO="OCA/OCB" LINT_CHECK="0" virtualenv: system_site_packages: true From b11b7c3a629161dec5e68c3a1baec9a6fcb98f8b Mon Sep 17 00:00:00 2001 From: Yannick Vaucher Date: Tue, 16 Dec 2014 14:31:07 +0100 Subject: [PATCH 4/6] Remove deprecated travis_run_pep8 --- .travis.yml | 1 - 1 file changed, 1 deletion(-) diff --git a/.travis.yml b/.travis.yml index 07eae3221..303487e9b 100644 --- a/.travis.yml +++ b/.travis.yml @@ -21,7 +21,6 @@ install: - git clone https://github.com/OCA/stock-logistics-barcode -b ${VERSION} $HOME/stock-logistics-barcode script: - - travis_run_flake8 - travis_run_tests after_success: From 816ac2ebfeb0635e88f6a7ffb8bb5c9c1833305a Mon Sep 17 00:00:00 2001 From: Alexandre Fayolle Date: Mon, 16 Feb 2015 10:38:27 +0100 Subject: [PATCH 5/6] fix pep8 W503 --- stock_reserve_sale/model/sale.py | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/stock_reserve_sale/model/sale.py b/stock_reserve_sale/model/sale.py index 1dd688a56..5723f473f 100644 --- a/stock_reserve_sale/model/sale.py +++ b/stock_reserve_sale/model/sale.py @@ -123,11 +123,11 @@ class SaleOrderLine(models.Model): def _is_stock_reservable(self): for line in self: reservable = False - if (not (line.state != 'draft' - or line._get_procure_method() == 'make_to_order' - or not line.product_id - or line.product_id.type == 'service') - and not line.reservation_ids): + if (not (line.state != 'draft' or + line._get_procure_method() == 'make_to_order' or + not line.product_id or + line.product_id.type == 'service') and + not line.reservation_ids): reservable = True line.is_stock_reservable = reservable From 2270fd8816aa79ced02d5ab0a28fb39ffee0f042 Mon Sep 17 00:00:00 2001 From: Alexandre Fayolle Date: Mon, 2 Mar 2015 17:28:35 +0100 Subject: [PATCH 6/6] Add OCA as author of OCA addons In order to get visibility on https://www.odoo.com/apps the OCA board has decided to add the OCA as author of all the addons maintained as part of the association. --- __unported__/base_product_merge/__openerp__.py | 2 +- __unported__/configurable_stock_level/__openerp__.py | 2 +- __unported__/stock_available_immediately/__openerp__.py | 2 +- __unported__/stock_inventory_existing_lines/__openerp__.py | 2 +- __unported__/stock_inventory_extended/__openerp__.py | 2 +- __unported__/stock_inventory_with_location/__openerp__.py | 2 +- __unported__/stock_lot_valuation/__openerp__.py | 2 +- __unported__/stock_move_location/__openerp__.py | 2 +- __unported__/stock_optional_valuation/__openerp__.py | 2 +- __unported__/stock_orderpoint_creator/__openerp__.py | 2 +- __unported__/stock_reord_rule/__openerp__.py | 2 +- stock_location_ownership/__openerp__.py | 2 +- stock_reserve/__openerp__.py | 2 +- stock_reserve_sale/__openerp__.py | 2 +- 14 files changed, 14 insertions(+), 14 deletions(-) diff --git a/__unported__/base_product_merge/__openerp__.py b/__unported__/base_product_merge/__openerp__.py index b234f84b3..8994c0d12 100644 --- a/__unported__/base_product_merge/__openerp__.py +++ b/__unported__/base_product_merge/__openerp__.py @@ -32,7 +32,7 @@ { "name" : "Base Products Merge", "version" : "1.0", - "author" : "Camptocamp", + "author" : "Camptocamp,Odoo Community Association (OCA)", "category" : "Generic Modules/Base", "description":""" To merge 2 products, select them in the list view and execute the Action "Merge Products". diff --git a/__unported__/configurable_stock_level/__openerp__.py b/__unported__/configurable_stock_level/__openerp__.py index d54c8f2f4..73293f978 100644 --- a/__unported__/configurable_stock_level/__openerp__.py +++ b/__unported__/configurable_stock_level/__openerp__.py @@ -20,7 +20,7 @@ ############################################################################## {'name' : 'name', 'version' : '0.1', - 'author' : 'Camptocamp', + 'author' : "Camptocamp,Odoo Community Association (OCA)", 'maintainer': 'Camptocamp', 'category': 'Warehouse', 'complexity': "normal", # easy, normal, expert diff --git a/__unported__/stock_available_immediately/__openerp__.py b/__unported__/stock_available_immediately/__openerp__.py index 080dbe620..2011e85d7 100644 --- a/__unported__/stock_available_immediately/__openerp__.py +++ b/__unported__/stock_available_immediately/__openerp__.py @@ -25,7 +25,7 @@ "name": "Immediately Usable Stock Quantity", "version": "1.0", "depends": ["product", "stock", ], - "author": "Camptocamp", + "author": "Camptocamp,Odoo Community Association (OCA)", "license": "AGPL-3", "description": """ Compute the immediately usable stock. diff --git a/__unported__/stock_inventory_existing_lines/__openerp__.py b/__unported__/stock_inventory_existing_lines/__openerp__.py index 2f23e7c64..0d6b2823c 100644 --- a/__unported__/stock_inventory_existing_lines/__openerp__.py +++ b/__unported__/stock_inventory_existing_lines/__openerp__.py @@ -22,7 +22,7 @@ { "name" : "Inventory Extended", "version" : "1.0", - "author" : "Julius Network Solutions", + "author" : "Julius Network Solutions,Odoo Community Association (OCA)", "description" : """ Presentation: diff --git a/__unported__/stock_inventory_extended/__openerp__.py b/__unported__/stock_inventory_extended/__openerp__.py index 405ee4a5a..d6d60a933 100644 --- a/__unported__/stock_inventory_extended/__openerp__.py +++ b/__unported__/stock_inventory_extended/__openerp__.py @@ -22,7 +22,7 @@ { "name" : "Move Inventory Extended", "version" : "1.0", - "author" : "Julius Network Solutions", + "author" : "Julius Network Solutions,Odoo Community Association (OCA)", "description" : """ Presentation: diff --git a/__unported__/stock_inventory_with_location/__openerp__.py b/__unported__/stock_inventory_with_location/__openerp__.py index 8711d2e77..5bc6a45f1 100644 --- a/__unported__/stock_inventory_with_location/__openerp__.py +++ b/__unported__/stock_inventory_with_location/__openerp__.py @@ -22,7 +22,7 @@ { "name" : "Move Inventory Extended", "version" : "1.0", - "author" : "Julius Network Solutions", + "author" : "Julius Network Solutions,Odoo Community Association (OCA)", "description" : """ Presentation: diff --git a/__unported__/stock_lot_valuation/__openerp__.py b/__unported__/stock_lot_valuation/__openerp__.py index 922a276f8..fb936e2dd 100644 --- a/__unported__/stock_lot_valuation/__openerp__.py +++ b/__unported__/stock_lot_valuation/__openerp__.py @@ -34,7 +34,7 @@ Set the 'Lot valuation' flag on product form (used for real time valuation). As for products, lots have 'cost' and 'costing method' fields. Also, a 'Change Standard Price' wizard is available. """, - 'author': 'Agile Business Group', + 'author': "Agile Business Group,Odoo Community Association (OCA)", 'website': 'http://www.agilebg.com', 'license': 'AGPL-3', "depends": ['stock'], diff --git a/__unported__/stock_move_location/__openerp__.py b/__unported__/stock_move_location/__openerp__.py index 7f1580884..90a86f16a 100644 --- a/__unported__/stock_move_location/__openerp__.py +++ b/__unported__/stock_move_location/__openerp__.py @@ -22,7 +22,7 @@ { "name" : "Move Stock Location", "version" : "1.0", - "author" : "Julius Network Solutions", + "author" : "Julius Network Solutions,Odoo Community Association (OCA)", "description" : """ Presentation: diff --git a/__unported__/stock_optional_valuation/__openerp__.py b/__unported__/stock_optional_valuation/__openerp__.py index feeb7f033..d051f85c4 100644 --- a/__unported__/stock_optional_valuation/__openerp__.py +++ b/__unported__/stock_optional_valuation/__openerp__.py @@ -26,7 +26,7 @@ You can choose which stock moves have to generate inventory valuation accounting entries, by specifying it in the location form. """, - 'author': 'Agile Business Group', + 'author': "Agile Business Group,Odoo Community Association (OCA)", 'website': 'http://www.agilebg.com', 'license': 'AGPL-3', "depends": ['stock'], diff --git a/__unported__/stock_orderpoint_creator/__openerp__.py b/__unported__/stock_orderpoint_creator/__openerp__.py index 9eeff46c0..b31de413d 100644 --- a/__unported__/stock_orderpoint_creator/__openerp__.py +++ b/__unported__/stock_orderpoint_creator/__openerp__.py @@ -21,7 +21,7 @@ {'name': 'Configuration of order point in mass', 'version': '1.0', - 'author': 'Camptocamp', + 'author': "Camptocamp,Odoo Community Association (OCA)", 'maintainer': 'Camptocamp', 'category': 'Warehouse', 'complexity': 'easy', #easy, normal, expert diff --git a/__unported__/stock_reord_rule/__openerp__.py b/__unported__/stock_reord_rule/__openerp__.py index 949dc9218..8e348d6f9 100644 --- a/__unported__/stock_reord_rule/__openerp__.py +++ b/__unported__/stock_reord_rule/__openerp__.py @@ -46,7 +46,7 @@ executed daily and will update the maximum quantity in the reordering rule This module doesn't need purchase module to work, but it's useful with that module.""", - 'author': 'Sergio Corato', + 'author': "Sergio Corato,Odoo Community Association (OCA)", 'website': 'http://www.icstools.it', 'depends': ['procurement', 'sale', diff --git a/stock_location_ownership/__openerp__.py b/stock_location_ownership/__openerp__.py index bcd2582c0..91de5d27f 100644 --- a/stock_location_ownership/__openerp__.py +++ b/stock_location_ownership/__openerp__.py @@ -21,7 +21,7 @@ {'name': 'Stock Location Ownership', 'version': '0.1', - 'author': 'Camptocamp', + 'author': "Camptocamp,Odoo Community Association (OCA)", 'category': 'Warehouse', 'license': 'AGPL-3', 'complexity': 'normal', diff --git a/stock_reserve/__openerp__.py b/stock_reserve/__openerp__.py index d1114f1fc..23386630f 100644 --- a/stock_reserve/__openerp__.py +++ b/stock_reserve/__openerp__.py @@ -22,7 +22,7 @@ {'name': 'Stock Reservation', 'summary': 'Stock reservations on products', 'version': '0.1', - 'author': 'Camptocamp', + 'author': "Camptocamp,Odoo Community Association (OCA)", 'category': 'Warehouse', 'license': 'AGPL-3', 'complexity': 'normal', diff --git a/stock_reserve_sale/__openerp__.py b/stock_reserve_sale/__openerp__.py index 7d9d2b9b0..be0ae3152 100644 --- a/stock_reserve_sale/__openerp__.py +++ b/stock_reserve_sale/__openerp__.py @@ -21,7 +21,7 @@ {'name': 'Stock Reserve Sales', 'version': '0.1', - 'author': 'Camptocamp', + 'author': "Camptocamp,Odoo Community Association (OCA)", 'category': 'Warehouse', 'license': 'AGPL-3', 'complexity': 'normal',