From b7d010baec77d47ba0eeaefd8f95acd70511d33f Mon Sep 17 00:00:00 2001 From: Fabien Pinckaers Date: Thu, 15 Jan 2009 18:37:46 +0100 Subject: [PATCH] modifs bzr revid: fp@tinyerp.com-20090115173746-pf9k1ld5bi4j2pag --- addons/account/wizard/wizard_unreconcile.py | 10 ++++- addons/sale/report/__init__.py | 4 -- addons/sale/sale_report.xml | 21 ---------- addons/sale_delivery_report/__init__.py | 24 +++++++++++ addons/sale_delivery_report/__terp__.py | 40 +++++++++++++++++++ .../sale_delivery_report/delivery_report.xml | 13 ++++++ .../sale_delivery_report/report/__init__.py | 24 +++++++++++ .../report/shipping.py | 2 +- .../report/shipping.rml | 2 +- 9 files changed, 112 insertions(+), 28 deletions(-) create mode 100644 addons/sale_delivery_report/__init__.py create mode 100644 addons/sale_delivery_report/__terp__.py create mode 100644 addons/sale_delivery_report/delivery_report.xml create mode 100644 addons/sale_delivery_report/report/__init__.py rename addons/{sale => sale_delivery_report}/report/shipping.py (98%) rename addons/{sale => sale_delivery_report}/report/shipping.rml (99%) diff --git a/addons/account/wizard/wizard_unreconcile.py b/addons/account/wizard/wizard_unreconcile.py index 898b107e4ca..1d263caa0fe 100644 --- a/addons/account/wizard/wizard_unreconcile.py +++ b/addons/account/wizard/wizard_unreconcile.py @@ -31,11 +31,19 @@ _info_form = ''' ''' def _trans_unrec(self, cr, uid, data, context): - recs = pooler.get_pool(cr.dbname).get('account.move.line').read(cr, uid, data['ids'], ['reconcile_id',]) + pool = pooler.get_pool(cr.dbname) + recs = pool.get('account.move.line').read(cr, uid, data['ids'], ['reconcile_id',]) recs = filter(lambda x: x['reconcile_id'], recs) rec_ids = [rec['reconcile_id'][0] for rec in recs] + move = {} + for r in pool.get('account.move.reconcile').browse(cr, uid, rec_ids): + for line in r.line_id: + move[line.move_id.id] = True if len(rec_ids): pooler.get_pool(cr.dbname).get('account.move.reconcile').unlink(cr, uid, rec_ids) + if move: + invoice_ids = pool.get('account.invoice').search(cr, uid, [('move_id','in',move.keys())], context=context) + pool.get('account.invoice').write(cr, uid, invoice_ids, {}, context=context) return {} class wiz_unreconcile(wizard.interface): diff --git a/addons/sale/report/__init__.py b/addons/sale/report/__init__.py index 1dfd30cfedd..1ec8fde6538 100644 --- a/addons/sale/report/__init__.py +++ b/addons/sale/report/__init__.py @@ -22,7 +22,3 @@ import sale_prepare_allot import order -import shipping - -# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4: - diff --git a/addons/sale/sale_report.xml b/addons/sale/sale_report.xml index afb43b869c5..f21f20c63f7 100644 --- a/addons/sale/sale_report.xml +++ b/addons/sale/sale_report.xml @@ -1,28 +1,7 @@ - - - - diff --git a/addons/sale_delivery_report/__init__.py b/addons/sale_delivery_report/__init__.py new file mode 100644 index 00000000000..bef9ff4838e --- /dev/null +++ b/addons/sale_delivery_report/__init__.py @@ -0,0 +1,24 @@ +# -*- encoding: utf-8 -*- +############################################################################## +# +# OpenERP, Open Source Management Solution +# Copyright (C) 2004-2009 Tiny SPRL (). All Rights Reserved +# $Id$ +# +# This program is free software: you can redistribute it and/or modify +# it under the terms of the GNU 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 General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program. If not, see . +# +############################################################################## + +import report + diff --git a/addons/sale_delivery_report/__terp__.py b/addons/sale_delivery_report/__terp__.py new file mode 100644 index 00000000000..9021888f235 --- /dev/null +++ b/addons/sale_delivery_report/__terp__.py @@ -0,0 +1,40 @@ +# -*- encoding: utf-8 -*- +############################################################################## +# +# OpenERP, Open Source Management Solution +# Copyright (C) 2004-2009 Tiny SPRL (). All Rights Reserved +# $Id$ +# +# This program is free software: you can redistribute it and/or modify +# it under the terms of the GNU 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 General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program. If not, see . +# +############################################################################## + + +{ + 'name': 'Print Delivery Order', + 'version': '1.0', + 'category': 'Generic Modules/Sales & Purchases', + 'description': """Allows to print a delivery order.""", + 'author': 'Tiny', + 'depends': ['sale', 'delivery'], + 'init_xml': [], + 'update_xml': [ + 'delivery_report.xml' + ], + 'demo_xml': [], + 'installable': True, + 'active': False, + 'certificate': '', +} +# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4: diff --git a/addons/sale_delivery_report/delivery_report.xml b/addons/sale_delivery_report/delivery_report.xml new file mode 100644 index 00000000000..b5192be59e3 --- /dev/null +++ b/addons/sale_delivery_report/delivery_report.xml @@ -0,0 +1,13 @@ + + + + + + + + diff --git a/addons/sale_delivery_report/report/__init__.py b/addons/sale_delivery_report/report/__init__.py new file mode 100644 index 00000000000..e3a97d242c9 --- /dev/null +++ b/addons/sale_delivery_report/report/__init__.py @@ -0,0 +1,24 @@ +# -*- encoding: utf-8 -*- +############################################################################## +# +# OpenERP, Open Source Management Solution +# Copyright (C) 2004-2009 Tiny SPRL (). All Rights Reserved +# $Id$ +# +# This program is free software: you can redistribute it and/or modify +# it under the terms of the GNU 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 General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program. If not, see . +# +############################################################################## + +import shipping + diff --git a/addons/sale/report/shipping.py b/addons/sale_delivery_report/report/shipping.py similarity index 98% rename from addons/sale/report/shipping.py rename to addons/sale_delivery_report/report/shipping.py index 667ca80b8d6..9b7fd0a80bb 100644 --- a/addons/sale/report/shipping.py +++ b/addons/sale_delivery_report/report/shipping.py @@ -71,4 +71,4 @@ class shipping(report_sxw.rml_parse): # sum_total = self.cr.fetchone()[0] or 0.00 # return True -report_sxw.report_sxw('report.sale.shipping','stock.picking','addons/sale/report/shipping.rml',parser=shipping) +report_sxw.report_sxw('report.sale.shipping','stock.picking','addons/sale_delivery/report/shipping.rml',parser=shipping) diff --git a/addons/sale/report/shipping.rml b/addons/sale_delivery_report/report/shipping.rml similarity index 99% rename from addons/sale/report/shipping.rml rename to addons/sale_delivery_report/report/shipping.rml index 8d0c82141ae..f7af0da65b0 100644 --- a/addons/sale/report/shipping.rml +++ b/addons/sale_delivery_report/report/shipping.rml @@ -222,4 +222,4 @@ - \ No newline at end of file +