From 51298798ef9c58252a113938f2159de3d2b454f8 Mon Sep 17 00:00:00 2001 From: Fabien Pinckaers Date: Thu, 8 Apr 2010 22:12:54 +0200 Subject: [PATCH 01/40] [IMP] removed unused file bzr revid: fp@tinyerp.com-20100408201254-6k0d6wtgw2ztq81g --- addons/account/test/test_parent_structure.py | 54 ------------------- addons/account/test/test_parent_structure.yml | 11 +++- 2 files changed, 9 insertions(+), 56 deletions(-) delete mode 100644 addons/account/test/test_parent_structure.py diff --git a/addons/account/test/test_parent_structure.py b/addons/account/test/test_parent_structure.py deleted file mode 100644 index ba27d91c87c..00000000000 --- a/addons/account/test/test_parent_structure.py +++ /dev/null @@ -1,54 +0,0 @@ -# -*- coding: utf-8 -*- -############################################################################## -# -# OpenERP, Open Source Management Solution -# Copyright (C) 2004-2010 Tiny SPRL (). -# -# 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 . -# -############################################################################## - -# -# TODO: move this in a YAML test with !python tag -# - -import xmlrpclib - -DB = 'training3' -USERID = 1 -USERPASS = 'admin' - - -sock = xmlrpclib.ServerProxy('http://%s:%s/xmlrpc/object' % ('localhost',8069)) - -ids = sock.execute(DB, USERID, USERPASS, 'account.account', 'search', [], {}) -account_lists = sock.execute(DB, USERID, USERPASS, 'account.account', 'read', ids, ['parent_id','parent_left','parent_right']) - -accounts = dict(map(lambda x: (x['id'],x), account_lists)) -for a in account_lists: - if a['parent_id']: - assert a['parent_left'] > accounts[a['parent_id'][0]]['parent_left'] - assert a['parent_right'] < accounts[a['parent_id'][0]]['parent_right'] - assert a['parent_left'] < a['parent_right'] - for a2 in account_lists: - assert not ((a2['parent_right']>a['parent_left']) and - (a2['parent_left']a['parent_left']) and (a2['parent_right'] parent_right of all childs + . if an account is a child it is included in parent_left-parent_right + . if an account is not a child it is not included in parent_left-parent_right - !python {model: account.account}: | ids = self.search(cr, uid, []) From f4cdf72ea3605cb08dcdc389dee404fdbff3efb7 Mon Sep 17 00:00:00 2001 From: Fabien Pinckaers Date: Thu, 8 Apr 2010 22:36:37 +0200 Subject: [PATCH 02/40] [IMP] mrp workflows bzr revid: fp@tinyerp.com-20100408203637-jatmtejrcg55eb7g --- addons/mrp/mrp_workflow.xml | 24 +++++++----------------- 1 file changed, 7 insertions(+), 17 deletions(-) diff --git a/addons/mrp/mrp_workflow.xml b/addons/mrp/mrp_workflow.xml index 8be8f97b5d9..377fa790b70 100644 --- a/addons/mrp/mrp_workflow.xml +++ b/addons/mrp/mrp_workflow.xml @@ -163,8 +163,7 @@ produce - subflow - + function action_produce_assign_product() @@ -180,8 +179,7 @@ buy - subflow - + function action_po_assign() @@ -308,26 +306,16 @@ - - - - subflow.cancel - subflow.cancel - - - - subflow.cancel - - subflow.done + @@ -337,12 +325,14 @@ - subflow.delivery_done + - action_check_finnished() + action_check_finnished() or (not move_id) + stock.move + [move_id.id] From 7b8ec4c46d01a49b68e0ee9e2f4e0847ff8a5795 Mon Sep 17 00:00:00 2001 From: Fabien Pinckaers Date: Fri, 9 Apr 2010 01:10:41 +0200 Subject: [PATCH 03/40] [IMP] improving stock operations bzr revid: fp@tinyerp.com-20100408231041-9r7eg9k48reka8zx --- addons/mrp/mrp_view.xml | 4 +- addons/stock/security/ir.model.access.csv | 4 +- addons/stock/stock.py | 44 --------- addons/stock/stock_view.xml | 60 +----------- addons/stock/wizard/stock_partial_move.py | 108 ++++++++++------------ 5 files changed, 55 insertions(+), 165 deletions(-) diff --git a/addons/mrp/mrp_view.xml b/addons/mrp/mrp_view.xml index c215ff13fb0..83ae9ea4e55 100644 --- a/addons/mrp/mrp_view.xml +++ b/addons/mrp/mrp_view.xml @@ -808,7 +808,7 @@ - + @@ -896,7 +896,7 @@ + sequence="5" /> Procurement Exceptions diff --git a/addons/stock/security/ir.model.access.csv b/addons/stock/security/ir.model.access.csv index e7269d542f2..5622557e834 100644 --- a/addons/stock/security/ir.model.access.csv +++ b/addons/stock/security/ir.model.access.csv @@ -36,8 +36,6 @@ "access_stock_invoice_onshipping","stock.invoice.onshipping","model_stock_invoice_onshipping","stock.group_stock_user",1,0,0,0 "access_stock_location_product","stock.location.product","model_stock_location_product","stock.group_stock_user",1,0,0,0 "access_report_stock_picking","report.stock.picking","model_report_stock_picking","stock.group_stock_user",1,0,0,0 -"access_stock_delivery","stock.delivery","model_stock_delivery","stock.group_stock_user",1,0,0,0 - "access_stock_traceability_upstream","stock.traceability.upstream","model_stock_traceability_upstream","stock.group_stock_user",1,0,0,0 "access_stock_traceability_downstream","stock.traceability.downstream","model_stock_traceability_downstream","stock.group_stock_user",1,0,0,0 "access_stock_traceability_lot_upstream","stock.traceability.lot.upstream","model_stock_traceability_lot_upstream","stock.group_stock_user",1,0,0,0 @@ -46,4 +44,4 @@ "access_stock_partial_move","stock.partial.move","model_stock_partial_move","stock.group_stock_user",1,0,0,0 "access_stock_picking_make","stock.picking.make","model_stock_picking_make","stock.group_stock_user",1,0,0,0 "access_stock_inventory_merge","stock.inventory.merge","model_stock_inventory_merge","stock.group_stock_user",1,0,0,0 -"access_stock_change_standard_price","stock.change.standard.price","model_stock_change_standard_price","stock.group_stock_user",1,0,0,0 \ No newline at end of file +"access_stock_change_standard_price","stock.change.standard.price","model_stock_change_standard_price","stock.group_stock_user",1,0,0,0 diff --git a/addons/stock/stock.py b/addons/stock/stock.py index 94fab1dacec..7d8fd5b97c1 100644 --- a/addons/stock/stock.py +++ b/addons/stock/stock.py @@ -492,7 +492,6 @@ class stock_picking(osv.osv): 'max_date': fields.function(get_min_max_date, fnct_inv=_set_maximum_date, multi="min_max_date", method=True, store=True, type='datetime', string='Max. Expected Date', select=2), 'move_lines': fields.one2many('stock.move', 'picking_id', 'Entry lines', states={'done': [('readonly', True)], 'cancel': [('readonly', True)]}), - 'delivery_line':fields.one2many('stock.delivery', 'picking_id', 'Delivery lines', readonly=True), 'auto_picking': fields.boolean('Auto-Picking'), 'address_id': fields.many2one('res.partner.address', 'Partner', help="Address of partner"), 'invoice_state': fields.selection([ @@ -877,7 +876,6 @@ class stock_picking(osv.osv): """ res = {} move_obj = self.pool.get('stock.move') - delivery_obj = self.pool.get('stock.delivery') product_obj = self.pool.get('product.product') currency_obj = self.pool.get('res.currency') users_obj = self.pool.get('res.users') @@ -1003,14 +1001,6 @@ class stock_picking(osv.osv): delivered_pack_id = pick.id delivered_pack = self.browse(cr, uid, delivered_pack_id, context=context) - delivery_id = delivery_obj.create(cr, uid, { - 'name': delivered_pack.name, - 'partner_id': partner_id, - 'address_id': address_id, - 'date': delivery_date, - 'picking_id' : pick.id, - 'move_delivered' : [(6,0, map(lambda x:x.id, delivered_pack.move_lines))] - }, context=context) res[pick.id] = {'delivered_picking': delivered_pack.id or False} return res @@ -1112,26 +1102,6 @@ class stock_production_lot_revision(osv.osv): stock_production_lot_revision() -class stock_delivery(osv.osv): - - """ Tracability of partialdeliveries """ - - _name = "stock.delivery" - _description = "Delivery" - _columns = { - 'name': fields.char('Name', size=60, required=True), - 'date': fields.datetime('Date', required=True), - 'partner_id': fields.many2one('res.partner', 'Partner', required=True), - 'address_id': fields.many2one('res.partner.address', 'Address', required=True), - 'move_delivered':fields.one2many('stock.move', 'delivered_id', 'Move Delivered'), - 'picking_id': fields.many2one('stock.picking', 'Picking list'), - - } -stock_delivery() -# ---------------------------------------------------- -# Move -# ---------------------------------------------------- - # # Fields: # location_dest_id is only used for predicting futur stocks @@ -1211,7 +1181,6 @@ class stock_move(osv.osv): 'backorder_id': fields.related('picking_id','backorder_id',type='many2one', relation="stock.picking", string="Back Orders"), 'origin': fields.related('picking_id','origin',type='char', size=64, relation="stock.picking", string="Origin"), 'move_stock_return_history': fields.many2many('stock.move', 'stock_move_return_history', 'move_id', 'return_move_id', 'Move Return History',readonly=True), - 'delivered_id': fields.many2one('stock.delivery', 'Product delivered'), 'scraped': fields.boolean('Scraped'), } _constraints = [ @@ -1803,7 +1772,6 @@ class stock_move(osv.osv): """ res = {} picking_obj = self.pool.get('stock.picking') - delivery_obj = self.pool.get('stock.delivery') product_obj = self.pool.get('product.product') currency_obj = self.pool.get('res.currency') users_obj = self.pool.get('res.users') @@ -1909,18 +1877,6 @@ class stock_move(osv.osv): done_move_ids = [] for move in complete: done_move_ids.append(move.id) - if move.picking_id.id not in ref: - delivery_id = delivery_obj.create(cr, uid, { - 'partner_id': partner_id, - 'address_id': address_id, - 'date': delivery_date, - 'name' : move.picking_id.name, - 'picking_id': move.picking_id.id - }, context=context) - ref[move.picking_id.id] = delivery_id - delivery_obj.write(cr, uid, ref[move.picking_id.id], { - 'move_delivered' : [(4,move.id)] - }) return done_move_ids stock_move() diff --git a/addons/stock/stock_view.xml b/addons/stock/stock_view.xml index 1ac6d340334..230819b355e 100644 --- a/addons/stock/stock_view.xml +++ b/addons/stock/stock_view.xml @@ -1034,9 +1034,6 @@