From 08011d69f0a0fe2e550fd44aa0face6314a50fa5 Mon Sep 17 00:00:00 2001 From: "Anup (OpenERP)" Date: Wed, 23 Jun 2010 19:28:06 +0530 Subject: [PATCH 01/11] [FIX] account: centralize movement fixed bzr revid: ach@tinyerp.com-20100623135806-458pw5csif1d0e2w --- addons/account/account.py | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/addons/account/account.py b/addons/account/account.py index ca5584a2c20..0abdd2af7e0 100644 --- a/addons/account/account.py +++ b/addons/account/account.py @@ -1144,6 +1144,7 @@ class account_move(osv.osv): return amount def _centralise(self, cr, uid, move, mode, context=None): + assert(mode in ('debit', 'credit'), 'Invalid Mode') #to prevent sql injection if context is None: context = {} @@ -1191,10 +1192,7 @@ class account_move(osv.osv): else: line_id2 = 0 - cr.execute('SELECT SUM('+mode+') '\ - 'FROM account_move_line '\ - 'WHERE move_id=%s AND id<>%s', - (move.id, line_id2)) + cr.execute('SELECT SUM(%s) FROM account_move_line WHERE move_id=%%s AND id!=%%s' % (mode,), (move.id, line_id2)) result = cr.fetchone()[0] or 0.0 cr.execute('update account_move_line set '+mode2+'=%s where id=%s', (result, line_id)) return True From abce6c32df34cbc65290d0ca42b95babb2105917 Mon Sep 17 00:00:00 2001 From: "Anup (OpenERP)" Date: Wed, 23 Jun 2010 19:32:59 +0530 Subject: [PATCH 02/11] [FIX] account: Added Allow Cancelling Entries on Journal View bzr revid: ach@tinyerp.com-20100623140259-yiy3lzvh4ha8t1y0 --- addons/account/account_view.xml | 1 + 1 file changed, 1 insertion(+) diff --git a/addons/account/account_view.xml b/addons/account/account_view.xml index b22ce445f53..adf62bcddcc 100644 --- a/addons/account/account_view.xml +++ b/addons/account/account_view.xml @@ -309,6 +309,7 @@ + From e77035d3ea8494bf48739a930fced08fedf6aad4 Mon Sep 17 00:00:00 2001 From: Fabien Pinckaers Date: Wed, 23 Jun 2010 17:01:35 +0200 Subject: [PATCH 03/11] modifs bzr revid: fp@tinyerp.com-20100623150135-03o40pysuf9dymdy --- .../marketing_campaign/marketing_campaign.py | 38 +++++++------- .../report/campaign_analysis.py | 52 +++++++++---------- .../report/campaign_analysis_view.xml | 51 +++++++++--------- 3 files changed, 70 insertions(+), 71 deletions(-) diff --git a/addons/marketing_campaign/marketing_campaign.py b/addons/marketing_campaign/marketing_campaign.py index 86eea3f7631..feeaa074b6d 100644 --- a/addons/marketing_campaign/marketing_campaign.py +++ b/addons/marketing_campaign/marketing_campaign.py @@ -395,9 +395,9 @@ class marketing_campaign_workitem(osv.osv): 'object': wi.activity_id, 'transition': wi.activity_id.to_ids } - expr = eval(str(wi.activity_id.condition), eval_context) - if expr: - try: + try: + expr = eval(str(wi.activity_id.condition), eval_context) + if expr: result = True if wi.campaign_id.mode in ('manual','active'): result = self.pool.get('marketing.campaign.activity').process( @@ -410,11 +410,10 @@ class marketing_campaign_workitem(osv.osv): if type(result) == type({}) and 'error_msg' in result: vals['error_msg'] = result['error_msg'] self.write(cr, uid, wi.id, vals) - except Exception,e: - self.write(cr, uid, wi.id, {'state': 'exception', 'error_msg': str(e)}) - else : - self.write(cr, uid, wi.id, {'state': 'cancelled'}) - + else: + self.write(cr, uid, wi.id, {'state': 'cancelled'}) + except Exception,e: + self.write(cr, uid, wi.id, {'state': 'exception', 'error_msg': str(e)}) return True def process_all(self, cr, uid, camp_ids=None, context={}): @@ -422,16 +421,19 @@ class marketing_campaign_workitem(osv.osv): if not camp_ids: camp_ids = camp_obj.search(cr, uid, [('state','=','running')], context=context) for camp in camp_obj.browse(cr, uid, camp_ids, context=context): - if camp.mode in ('test_realtime','active'): - workitem_ids = self.search(cr, uid, [('state', '=', 'todo'), - ('date','<=', time.strftime('%Y-%m-%d %H:%M:%S'))]) - elif camp.mode == 'test': - workitem_ids = self.search(cr, uid, [('state', '=', 'todo')]) - else: - # manual states are not processed automatically - workitem_ids = [] - if workitem_ids: - self.process(cr, uid, workitem_ids, context) + while True: + if camp.mode in ('test_realtime','active'): + workitem_ids = self.search(cr, uid, [('state', '=', 'todo'), + ('date','<=', time.strftime('%Y-%m-%d %H:%M:%S'))]) + elif camp.mode == 'test': + workitem_ids = self.search(cr, uid, [('state', '=', 'todo')]) + else: + # manual states are not processed automatically + workitem_ids = [] + if workitem_ids: + self.process(cr, uid, workitem_ids, context) + else: + break def preview(self, cr, uid, ids, context): res = {} diff --git a/addons/marketing_campaign/report/campaign_analysis.py b/addons/marketing_campaign/report/campaign_analysis.py index 590a1b47bc0..590abf47fce 100644 --- a/addons/marketing_campaign/report/campaign_analysis.py +++ b/addons/marketing_campaign/report/campaign_analysis.py @@ -49,7 +49,7 @@ class campaign_analysis(osv.osv): #{{{ ('07','July'), ('08','August'), ('09','September'), ('10','October'), ('11','November'), ('12','December')], 'Month', readonly=True), - 'date': fields.date('Date', readonly=True), + 'date': fields.datetime('Date', readonly=True), 'campaign_id': fields.many2one('marketing.campaign', 'Campaign', readonly=True), 'activity_id': fields.many2one('marketing.campaign.activity', 'Activity', @@ -61,36 +61,34 @@ class campaign_analysis(osv.osv): #{{{ type='many2one', relation='res.country',string='Country'), 'total_cost' : fields.function(_total_cost, string='Cost', method=True, type="float" ), - 'revenue': fields.float('Revenue',readonly=True), -# 'case_id': fields.many2one('crm.lead', 'Opportunity', readonly=True), -# 'count' : fields.integer('Count', readonly=True), + 'revenue': fields.float('Revenue',digits=(16,2),readonly=True), + 'count' : fields.integer('# of Actions', readonly=True), } def init(self, cr): tools.drop_view_if_exists(cr, 'campaign_analysis') cr.execute(""" - create or replace view campaign_analysis as ( - select - wi.id as id, - to_char(wi.date, 'YYYY') as year, - to_char(wi.date, 'MM') as month, - wi.date as date, - s.campaign_id as campaign_id, - wi.activity_id as activity_id, - wi.segment_id as segment_id, - wi.partner_id as partner_id , - act.revenue as revenue - from - marketing_campaign_workitem wi - left join res_partner p on (p.id=wi.partner_id) - left join marketing_campaign_segment s on (s.id=wi.segment_id) - left join marketing_campaign_activity act on (act.id= wi.activity_id) - group by - to_char(wi.date, 'YYYY'),to_char(wi.date, 'MM'), - s.campaign_id,wi.activity_id,wi.segment_id,wi.partner_id,revenue, - wi.date,wi.id - ) - """) - + create or replace view campaign_analysis as ( + select + min(wi.id) as id, + to_char(wi.date::date, 'YYYY') as year, + to_char(wi.date::date, 'MM') as month, + wi.date::date as date, + s.campaign_id as campaign_id, + wi.activity_id as activity_id, + wi.segment_id as segment_id, + wi.partner_id as partner_id , + sum(act.revenue) as revenue, + count(*) as count + from + marketing_campaign_workitem wi + left join res_partner p on (p.id=wi.partner_id) + left join marketing_campaign_segment s on (s.id=wi.segment_id) + left join marketing_campaign_activity act on (act.id= wi.activity_id) + group by + s.campaign_id,wi.activity_id,wi.segment_id,wi.partner_id, + wi.date::date + ) + """) campaign_analysis() #}}} diff --git a/addons/marketing_campaign/report/campaign_analysis_view.xml b/addons/marketing_campaign/report/campaign_analysis_view.xml index d7827033809..5a622d1364b 100644 --- a/addons/marketing_campaign/report/campaign_analysis_view.xml +++ b/addons/marketing_campaign/report/campaign_analysis_view.xml @@ -1,7 +1,7 @@ - - + + campaign.analysis.tree campaign.analysis tree @@ -15,37 +15,36 @@ - - + - + campaign.analysis.search campaign.analysis search - - - - - - - - - - - + + + + + + + + + + + @@ -60,17 +59,17 @@ - + Campaigns campaign.analysis form tree - {'group_by': [], 'search_default_Campaign': 1, 'search_default_Segment': 1} + {'group_by': [], 'search_default_Campaign': 1, 'search_default_Segment': 1, 'group_by_no_leaf':1} - + - + From cff5d130d12ac21b942a5ecd6e37f51c5b1d4864 Mon Sep 17 00:00:00 2001 From: Fabien Pinckaers Date: Wed, 23 Jun 2010 17:24:51 +0200 Subject: [PATCH 05/11] merge bzr revid: fp@tinyerp.com-20100623152451-v1ibzl70zr5my8iv --- addons/mrp/mrp.py | 15 ++- addons/product_expiry/__init__.py | 2 - .../{__terp__.py => __openerp__.py} | 2 +- addons/product_expiry/i18n/ca.po | 21 ++- addons/product_expiry/i18n/es.po | 23 +++- addons/product_expiry/i18n/fr.po | 19 ++- addons/product_expiry/product_expiry.py | 41 +++--- addons/product_expiry/report/__init__.py | 25 ---- addons/product_expiry/report/report_stock.py | 121 ------------------ .../report/report_stock_view.xml | 103 --------------- addons/product_expiry/wizard/__init__.py | 1 - addons/product_expiry/wizard/stock_partial.py | 70 ---------- .../wizard/stock_partial_view.xml | 22 ---- addons/product_manufacturer/__openerp__.py | 2 +- addons/product_manufacturer/i18n/fr_BE.po | 50 ++++---- ...anufacturer.pot => product_electronic.pot} | 50 ++++---- .../product_manufacturer.py | 19 +-- .../product_manufacturer_view.xml | 112 +++++++--------- .../security/ir.model.access.csv | 4 +- 19 files changed, 183 insertions(+), 519 deletions(-) rename addons/product_expiry/{__terp__.py => __openerp__.py} (93%) delete mode 100644 addons/product_expiry/report/__init__.py delete mode 100644 addons/product_expiry/report/report_stock.py delete mode 100644 addons/product_expiry/report/report_stock_view.xml delete mode 100644 addons/product_expiry/wizard/__init__.py delete mode 100644 addons/product_expiry/wizard/stock_partial.py delete mode 100644 addons/product_expiry/wizard/stock_partial_view.xml rename addons/product_manufacturer/i18n/{product_manufacturer.pot => product_electronic.pot} (61%) diff --git a/addons/mrp/mrp.py b/addons/mrp/mrp.py index 86e7a57dd53..9f28cff4594 100644 --- a/addons/mrp/mrp.py +++ b/addons/mrp/mrp.py @@ -543,16 +543,21 @@ class mrp_production(osv.osv): return {'value': {'location_dest_id': src}} return {} - def product_id_change(self, cr, uid, ids, product): + def product_id_change(self, cr, uid, ids, product, context=None): """ Finds UoM of changed product. @param product: Id of changed product. @return: Dictionary of values. """ if not product: - return {} - res = self.pool.get('product.product').read(cr, uid, [product], ['uom_id'])[0] - uom = res['uom_id'] and res['uom_id'][0] - result = {'product_uom': uom} + return {'value': { + 'product_uom': False, + 'bom_id': False + }} + res = self.pool.get('product.product').browse(cr, uid, product, context=context) + result = { + 'product_uom': res.uom_id and res.uom_id.id or False, + 'bom_id': res.bom_ids and res.bom_ids[0].id or False + } return {'value': result} def bom_id_change(self, cr, uid, ids, product): diff --git a/addons/product_expiry/__init__.py b/addons/product_expiry/__init__.py index 3b5500415c2..de4fe83ab83 100644 --- a/addons/product_expiry/__init__.py +++ b/addons/product_expiry/__init__.py @@ -19,7 +19,5 @@ ############################################################################## import product_expiry -import wizard -import report # vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4: diff --git a/addons/product_expiry/__terp__.py b/addons/product_expiry/__openerp__.py similarity index 93% rename from addons/product_expiry/__terp__.py rename to addons/product_expiry/__openerp__.py index 2e44f2c6462..1d0b9356efe 100644 --- a/addons/product_expiry/__terp__.py +++ b/addons/product_expiry/__openerp__.py @@ -31,7 +31,7 @@ - removal date - alert date Used, for example, in food industries.''', - "update_xml" : ["product_expiry_view.xml", "report/report_stock_view.xml", "wizard/stock_partial_view.xml"], + "update_xml" : ["product_expiry_view.xml"], "active": False, "installable": True } diff --git a/addons/product_expiry/i18n/ca.po b/addons/product_expiry/i18n/ca.po index 0ed0bfcab10..c4acce0421f 100644 --- a/addons/product_expiry/i18n/ca.po +++ b/addons/product_expiry/i18n/ca.po @@ -8,13 +8,13 @@ msgstr "" "Project-Id-Version: openobject-addons\n" "Report-Msgid-Bugs-To: FULL NAME \n" "POT-Creation-Date: 2009-06-30 15:09+0000\n" -"PO-Revision-Date: 2010-06-21 15:56+0000\n" +"PO-Revision-Date: 2010-01-10 22:56+0000\n" "Last-Translator: FULL NAME \n" "Language-Team: Catalan \n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -"X-Launchpad-Export-Date: 2010-06-22 04:20+0000\n" +"X-Launchpad-Export-Date: 2010-04-24 04:01+0000\n" "X-Generator: Launchpad (build Unknown)\n" #. module: product_expiry @@ -161,3 +161,20 @@ msgstr "" #: field:product.product,alert_time:0 msgid "Product alert time" msgstr "Data alerta producte" + +#~ msgid "Alert date" +#~ msgstr "Data alarma" + +#~ msgid "" +#~ "Track different dates on products and lots. Used, for exampel, in food " +#~ "industries: expiry date, alert date, date of removal, eso." +#~ msgstr "" +#~ "Gestiona diferents dates per a productes i lots. Utilitzat, per exemple, en " +#~ "la indústria alimentària: Data de caducitat, data d'alarma, data " +#~ "d'eliminació, ..." + +#~ msgid "DLUO" +#~ msgstr "Data caducitat" + +#~ msgid "Removal date" +#~ msgstr "Data eliminació" diff --git a/addons/product_expiry/i18n/es.po b/addons/product_expiry/i18n/es.po index 72a3aeec0e2..537d7ce26ef 100644 --- a/addons/product_expiry/i18n/es.po +++ b/addons/product_expiry/i18n/es.po @@ -8,13 +8,13 @@ msgstr "" "Project-Id-Version: openobject-addons\n" "Report-Msgid-Bugs-To: FULL NAME \n" "POT-Creation-Date: 2009-06-30 15:09+0000\n" -"PO-Revision-Date: 2010-06-21 15:56+0000\n" -"Last-Translator: FULL NAME \n" +"PO-Revision-Date: 2010-04-29 04:43+0000\n" +"Last-Translator: Rhubeni Lopes de Andrade \n" "Language-Team: Spanish \n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -"X-Launchpad-Export-Date: 2010-06-22 04:20+0000\n" +"X-Launchpad-Export-Date: 2010-04-30 03:57+0000\n" "X-Generator: Launchpad (build Unknown)\n" #. module: product_expiry @@ -161,3 +161,20 @@ msgstr "" #: field:product.product,alert_time:0 msgid "Product alert time" msgstr "Fecha alerta producto" + +#~ msgid "Alert date" +#~ msgstr "Fecha alarma" + +#~ msgid "" +#~ "Track different dates on products and lots. Used, for exampel, in food " +#~ "industries: expiry date, alert date, date of removal, eso." +#~ msgstr "" +#~ "Gestiona distintas fechas para productos y lotes. Utilizado, por ejemplo, en " +#~ "industria alimentaria: Fecha de caducidad, fecha de alarma, fecha de " +#~ "eliminación, ..." + +#~ msgid "DLUO" +#~ msgstr "Fecha caducidad" + +#~ msgid "Removal date" +#~ msgstr "Fecha eliminación" diff --git a/addons/product_expiry/i18n/fr.po b/addons/product_expiry/i18n/fr.po index 45cf454a094..13a3e127700 100644 --- a/addons/product_expiry/i18n/fr.po +++ b/addons/product_expiry/i18n/fr.po @@ -1,20 +1,19 @@ -# French translation for openobject-addons -# Copyright (c) 2010 Rosetta Contributors and Canonical Ltd 2010 -# This file is distributed under the same license as the openobject-addons package. -# FIRST AUTHOR , 2010. +# Translation of OpenERP Server. +# This file contains the translation of the following modules: +# * product_expiry # msgid "" msgstr "" -"Project-Id-Version: openobject-addons\n" -"Report-Msgid-Bugs-To: FULL NAME \n" +"Project-Id-Version: OpenERP Server 5.0.1\n" +"Report-Msgid-Bugs-To: support@openerp.com\n" "POT-Creation-Date: 2009-06-30 15:09+0000\n" -"PO-Revision-Date: 2010-06-21 15:56+0000\n" -"Last-Translator: FULL NAME \n" -"Language-Team: French \n" +"PO-Revision-Date: 2010-01-04 18:19+0000\n" +"Last-Translator: Fabien (Open ERP) \n" +"Language-Team: \n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -"X-Launchpad-Export-Date: 2010-06-22 04:20+0000\n" +"X-Launchpad-Export-Date: 2010-04-24 04:01+0000\n" "X-Generator: Launchpad (build Unknown)\n" #. module: product_expiry diff --git a/addons/product_expiry/product_expiry.py b/addons/product_expiry/product_expiry.py index ad9b8252d49..72f18412af4 100644 --- a/addons/product_expiry/product_expiry.py +++ b/addons/product_expiry/product_expiry.py @@ -21,21 +21,10 @@ import datetime from osv import fields, osv import pooler -import time class stock_production_lot(osv.osv): _name = 'stock.production.lot' _inherit = 'stock.production.lot' - def name_get(self, cr, uid, ids, context=None): - if not len(ids): - return [] - result = [] - for line in self.browse(cr, uid, ids, context): - if line.life_date: - result.append((line.id, (line.name or '')+' ('+line.life_date+')')) - else: - result.append((line.id, line.name)) - return result def _get_date(dtype): """Return a function to compute the limit date for this type""" @@ -52,24 +41,36 @@ class stock_production_lot(osv.osv): # set date to False when no expiry time specified on the product date = duration and (datetime.datetime.today() + datetime.timedelta(days=duration)) - return date and date.strftime('%Y-%m-%d') + return date and date.strftime('%Y-%m-%d %H:%M:%S') return calc_date _columns = { - 'life_date': fields.date('End of Life Date', + 'life_date': fields.datetime('End of Life Date', help='The date the lot may become dangerous and should not be consumed.'), - 'use_date': fields.date('Best before Date', + 'use_date': fields.datetime('Best before Date', help='The date the lot starts deteriorating without becoming dangerous.'), - 'removal_date': fields.date('Removal Date', + 'removal_date': fields.datetime('Removal Date', help='The date the lot should be removed.'), - 'alert_date': fields.date('Alert Date'), + 'alert_date': fields.datetime('Alert Date'), } + # Assign dates according to products data + def create(self, cr, uid, vals, context=None): + newid = super(stock_production_lot, self).create(cr, uid, vals, context=context) + obj = self.browse(cr, uid, newid, context=context) + towrite = [] + for f in ('life_date','use_date','removal_date','alert_date'): + if not getattr(obj, f): + towrite.append(f) + context = context or {} + context['product_id'] = obj.product_id.id + self.write(cr, uid, [obj.id], self.default_get(cr, uid, towrite, context=context)) + return newid _defaults = { - # 'life_date': _get_date('life_time'), - # 'use_date': _get_date('use_time'), - # 'removal_date': _get_date('removal_time'), - # 'alert_date': _get_date('alert_time'), + 'life_date': _get_date('life_time'), + 'use_date': _get_date('use_time'), + 'removal_date': _get_date('removal_time'), + 'alert_date': _get_date('alert_time'), } stock_production_lot() diff --git a/addons/product_expiry/report/__init__.py b/addons/product_expiry/report/__init__.py deleted file mode 100644 index a6006ed47b3..00000000000 --- a/addons/product_expiry/report/__init__.py +++ /dev/null @@ -1,25 +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 . -# -############################################################################## - -import report_stock - -# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4: - diff --git a/addons/product_expiry/report/report_stock.py b/addons/product_expiry/report/report_stock.py deleted file mode 100644 index bef64eaffa6..00000000000 --- a/addons/product_expiry/report/report_stock.py +++ /dev/null @@ -1,121 +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 . -# -############################################################################## - -from osv import osv, fields -from tools.translate import _ -import tools -from tools.sql import drop_view_if_exists - -class stock_report_prodlots(osv.osv): - _name = "stock.report.prodlots1" - _description = "Stock report by production lots" - _auto = False - _columns = { - 'name': fields.float('Quantity', readonly=True), - 'location_id': fields.many2one('stock.location', 'Location', readonly=True, select=True), - 'product_id': fields.many2one('product.product', 'Product', readonly=True, select=True), - 'prodlot_id': fields.many2one('stock.production.lot', 'Production lot', readonly=True, select=True), - 'life_date': fields.date('End of Life Date', - help='The date the lot may become dangerous and should not be consumed.'), - 'use_date': fields.date('Best before Date', - help='The date the lot starts deteriorating without becoming dangerous.'), - 'removal_date': fields.date('Removal Date', - help='The date the lot should be removed.'), - 'alert_date': fields.date('Alert Date'), - - } - - def init(self, cr): - drop_view_if_exists(cr, 'stock_report_prodlots1') - cr.execute(""" - create or replace view stock_report_prodlots1 as ( - select max(id) as id, - location_id, - product_id, - prodlot_id, - life_date, - use_date, - removal_date, - alert_date, - sum(qty) as name - from ( - select -max(sm.id) as id, - sm.location_id, - sm.product_id, - sm.prodlot_id, - spl.life_date, - spl.use_date, - spl.removal_date, - spl.alert_date, - -sum(sm.product_qty /uo.factor) as qty - from stock_move as sm - left join stock_location sl - on (sl.id = sm.location_id) - left join stock_production_lot spl - on (sm.prodlot_id=spl.id) - left join product_uom uo - on (uo.id=sm.product_uom) - where state = 'done' - group by sm.location_id, sm.product_id, sm.product_uom, sm.prodlot_id, - spl.life_date, - spl.use_date, - spl.removal_date, - spl.alert_date - - union all - select max(sm.id) as id, - sm.location_dest_id as location_id, - sm.product_id, - sm.prodlot_id, - spl.life_date, - spl.use_date, - spl.removal_date, - spl.alert_date, - sum(sm.product_qty /uo.factor) as qty - from stock_move as sm - left join stock_location sl - on (sl.id = sm.location_dest_id) - left join stock_production_lot spl - on (sm.prodlot_id=spl.id) - left join product_uom uo - on (uo.id=sm.product_uom) - where sm.state = 'done' - group by sm.location_dest_id, sm.product_id, sm.product_uom, sm.prodlot_id, - spl.life_date, - spl.use_date, - spl.removal_date, - spl.alert_date - - ) as report - group by location_id, product_id, prodlot_id, - life_date, - use_date, - removal_date, - alert_date - )""") - - def unlink(self, cr, uid, ids, context={}): - raise osv.except_osv(_('Error !'), _('You cannot delete any record!')) - - -stock_report_prodlots() - -# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4: diff --git a/addons/product_expiry/report/report_stock_view.xml b/addons/product_expiry/report/report_stock_view.xml deleted file mode 100644 index 68198e87dd3..00000000000 --- a/addons/product_expiry/report/report_stock_view.xml +++ /dev/null @@ -1,103 +0,0 @@ - - - - - - stock.report.prodlots.filter - stock.report.prodlots1 - search - - - - - - - - - - - - - - - - - - - - - - - - - - - stock.report.prodlots.view - stock.report.prodlots1 - form - -
- - - - - - - - - - -
- - - stock.report.prodlots.view - stock.report.prodlots1 - tree - - - - - - - - - - - - - - - - stock.report.prodlots.view - stock.report.prodlots1 - graph - - - - - - - - - - - Inventory by Location - ir.actions.act_window - stock.report.prodlots1 - form - tree,form - {'full':'1','search_default_internal_locations':1} - - - - - - -
-
diff --git a/addons/product_expiry/wizard/__init__.py b/addons/product_expiry/wizard/__init__.py deleted file mode 100644 index 2b1b55ed6e0..00000000000 --- a/addons/product_expiry/wizard/__init__.py +++ /dev/null @@ -1 +0,0 @@ -import stock_partial diff --git a/addons/product_expiry/wizard/stock_partial.py b/addons/product_expiry/wizard/stock_partial.py deleted file mode 100644 index 6af52951613..00000000000 --- a/addons/product_expiry/wizard/stock_partial.py +++ /dev/null @@ -1,70 +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 . -# -############################################################################## - -from osv import fields, osv -from service import web_services -from tools.misc import UpdateableStr, UpdateableDict -from tools.translate import _ -import netsvc -import pooler -import time -import datetime, time -import wizard - -class stock_production_lot(osv.osv): - _inherit = "stock.production.lot" - def create(self, cr, uid, vals, context={}): - new_id = super(stock_production_lot, self).create(cr, uid, vals, context=context) - prodlot_obj = self.pool.get('stock.production.lot') - prod = prodlot_obj.browse(cr, uid, new_id, context=context) - res = {} - current_date = time.strftime('%Y-%m-%d %H:%M:%S') - if not prod.life_date: - date_life = (datetime.datetime.strptime(current_date, '%Y-%m-%d %H:%M:%S') + datetime.timedelta(days=prod.product_id.life_time)) - res['life_date'] = date_life.strftime('%Y-%m-%d') - if not prod.use_date: - date_use = (datetime.datetime.strptime(current_date, '%Y-%m-%d %H:%M:%S') + datetime.timedelta(days=prod.product_id.use_time)) - res['use_date'] = date_use.strftime('%Y-%m-%d') - if not prod.removal_date: - date_removal = (datetime.datetime.strptime(current_date, '%Y-%m-%d %H:%M:%S') + datetime.timedelta(days=prod.product_id.removal_time)) - res['removal_date'] = date_removal.strftime('%Y-%m-%d') - if not prod.alert_date: - date_alert = (datetime.datetime.strptime(current_date, '%Y-%m-%d %H:%M:%S') + datetime.timedelta(days=prod.product_id.alert_time)) - res['alert_date'] = date_alert.strftime('%Y-%m-%d') - prodlot_obj.write(cr, uid, [prod.id], res) - return new_id -stock_production_lot() - -class stock_move_split_lines_exist(osv.osv_memory): - _inherit = "stock.move.split.lines" - _columns = { - 'date': fields.date('Expiry Date'), - } - # TODO: use this date instead of default one - def on_change_product(self, cr, uid, ids, product_id): - if not product_id: - return {'value':{'date': False}} - day_life = self.pool.get('product.product').browse(cr, uid, product_id).life_time - date_life = (datetime.datetime.now() + datetime.timedelta(days=day_life)) - return {'value': - {'date': date_life.strftime('%Y-%m-%d')} - } -stock_move_split_lines_exist() diff --git a/addons/product_expiry/wizard/stock_partial_view.xml b/addons/product_expiry/wizard/stock_partial_view.xml deleted file mode 100644 index b42ea07ba40..00000000000 --- a/addons/product_expiry/wizard/stock_partial_view.xml +++ /dev/null @@ -1,22 +0,0 @@ - - - - - - Split in lots - stock.move.split - form - - - - - - - - - - - - - - diff --git a/addons/product_manufacturer/__openerp__.py b/addons/product_manufacturer/__openerp__.py index 5d7e8922520..e6a1a919865 100644 --- a/addons/product_manufacturer/__openerp__.py +++ b/addons/product_manufacturer/__openerp__.py @@ -21,7 +21,7 @@ "name" : "Products Attributes & Manufacturers", "version" : "1.0", "author" : "Tiny", - "category" : "Enterprise Specific Modules/Industries", + "category" : "Enterprise Specific Modules/Manufacturer Industries", "depends" : ["base", "account", "product", "stock"], "init_xml" : [], "demo_xml" : [], diff --git a/addons/product_manufacturer/i18n/fr_BE.po b/addons/product_manufacturer/i18n/fr_BE.po index 2fc936e9dfc..11351ba679d 100644 --- a/addons/product_manufacturer/i18n/fr_BE.po +++ b/addons/product_manufacturer/i18n/fr_BE.po @@ -1,6 +1,6 @@ # Translation of OpenERP Server. # This file contains the translation of the following modules: -# * product_electronic +# * product_manufacturer # msgid "" msgstr "" @@ -15,88 +15,88 @@ msgstr "" "Content-Transfer-Encoding: \n" "Plural-Forms: \n" -#. module: product_electronic -#: model:ir.module.module,description:product_electronic.module_meta_information +#. module: product_manufacturer +#: model:ir.module.module,description:product_manufacturer.module_meta_information msgid "A module that add manufacturers and attributes on the product form" msgstr "" -#. module: product_electronic +#. module: product_manufacturer #: field:product.product,manufacturer_pref:0 msgid "Manufacturer product code" msgstr "" -#. module: product_electronic +#. module: product_manufacturer #: constraint:ir.ui.view:0 msgid "Invalid XML for View Architecture!" msgstr "" -#. module: product_electronic -#: view:product.electronic.attribute:0 +#. module: product_manufacturer +#: view:product.manufacturer.attribute:0 msgid "Product Template Name" msgstr "" -#. module: product_electronic +#. module: product_manufacturer #: constraint:ir.model:0 msgid "The Object name must start with x_ and not contain any special character !" msgstr "" -#. module: product_electronic -#: model:ir.model,name:product_electronic.model_product_electronic_attribute +#. module: product_manufacturer +#: model:ir.model,name:product_manufacturer.model_product_electronic_attribute msgid "Product attributes" msgstr "" -#. module: product_electronic +#. module: product_manufacturer #: view:product.product:0 msgid "Manufacturing data" msgstr "" -#. module: product_electronic +#. module: product_manufacturer #: view:product.product:0 msgid "Product reference" msgstr "" -#. module: product_electronic -#: field:product.electronic.attribute,name:0 +#. module: product_manufacturer +#: field:product.manufacturer.attribute,name:0 msgid "Attribute" msgstr "" -#. module: product_electronic -#: field:product.electronic.attribute,product_id:0 +#. module: product_manufacturer +#: field:product.manufacturer.attribute,product_id:0 msgid "Product" msgstr "" -#. module: product_electronic -#: field:product.electronic.attribute,value:0 +#. module: product_manufacturer +#: field:product.manufacturer.attribute,value:0 msgid "Value" msgstr "" -#. module: product_electronic +#. module: product_manufacturer #: view:product.product:0 msgid "Manufacturing Data" msgstr "" -#. module: product_electronic +#. module: product_manufacturer #: view:product.product:0 msgid "Product name" msgstr "" -#. module: product_electronic +#. module: product_manufacturer #: view:product.product:0 #: field:product.product,attribute_ids:0 msgid "Attributes" msgstr "" -#. module: product_electronic -#: model:ir.module.module,shortdesc:product_electronic.module_meta_information +#. module: product_manufacturer +#: model:ir.module.module,shortdesc:product_manufacturer.module_meta_information msgid "Products Attributes & Manufacturers" msgstr "" -#. module: product_electronic +#. module: product_manufacturer #: field:product.product,manufacturer_pname:0 msgid "Manufacturer product name" msgstr "" -#. module: product_electronic +#. module: product_manufacturer #: field:product.product,manufacturer:0 msgid "Manufacturer" msgstr "" diff --git a/addons/product_manufacturer/i18n/product_manufacturer.pot b/addons/product_manufacturer/i18n/product_electronic.pot similarity index 61% rename from addons/product_manufacturer/i18n/product_manufacturer.pot rename to addons/product_manufacturer/i18n/product_electronic.pot index 2fc936e9dfc..11351ba679d 100644 --- a/addons/product_manufacturer/i18n/product_manufacturer.pot +++ b/addons/product_manufacturer/i18n/product_electronic.pot @@ -1,6 +1,6 @@ # Translation of OpenERP Server. # This file contains the translation of the following modules: -# * product_electronic +# * product_manufacturer # msgid "" msgstr "" @@ -15,88 +15,88 @@ msgstr "" "Content-Transfer-Encoding: \n" "Plural-Forms: \n" -#. module: product_electronic -#: model:ir.module.module,description:product_electronic.module_meta_information +#. module: product_manufacturer +#: model:ir.module.module,description:product_manufacturer.module_meta_information msgid "A module that add manufacturers and attributes on the product form" msgstr "" -#. module: product_electronic +#. module: product_manufacturer #: field:product.product,manufacturer_pref:0 msgid "Manufacturer product code" msgstr "" -#. module: product_electronic +#. module: product_manufacturer #: constraint:ir.ui.view:0 msgid "Invalid XML for View Architecture!" msgstr "" -#. module: product_electronic -#: view:product.electronic.attribute:0 +#. module: product_manufacturer +#: view:product.manufacturer.attribute:0 msgid "Product Template Name" msgstr "" -#. module: product_electronic +#. module: product_manufacturer #: constraint:ir.model:0 msgid "The Object name must start with x_ and not contain any special character !" msgstr "" -#. module: product_electronic -#: model:ir.model,name:product_electronic.model_product_electronic_attribute +#. module: product_manufacturer +#: model:ir.model,name:product_manufacturer.model_product_electronic_attribute msgid "Product attributes" msgstr "" -#. module: product_electronic +#. module: product_manufacturer #: view:product.product:0 msgid "Manufacturing data" msgstr "" -#. module: product_electronic +#. module: product_manufacturer #: view:product.product:0 msgid "Product reference" msgstr "" -#. module: product_electronic -#: field:product.electronic.attribute,name:0 +#. module: product_manufacturer +#: field:product.manufacturer.attribute,name:0 msgid "Attribute" msgstr "" -#. module: product_electronic -#: field:product.electronic.attribute,product_id:0 +#. module: product_manufacturer +#: field:product.manufacturer.attribute,product_id:0 msgid "Product" msgstr "" -#. module: product_electronic -#: field:product.electronic.attribute,value:0 +#. module: product_manufacturer +#: field:product.manufacturer.attribute,value:0 msgid "Value" msgstr "" -#. module: product_electronic +#. module: product_manufacturer #: view:product.product:0 msgid "Manufacturing Data" msgstr "" -#. module: product_electronic +#. module: product_manufacturer #: view:product.product:0 msgid "Product name" msgstr "" -#. module: product_electronic +#. module: product_manufacturer #: view:product.product:0 #: field:product.product,attribute_ids:0 msgid "Attributes" msgstr "" -#. module: product_electronic -#: model:ir.module.module,shortdesc:product_electronic.module_meta_information +#. module: product_manufacturer +#: model:ir.module.module,shortdesc:product_manufacturer.module_meta_information msgid "Products Attributes & Manufacturers" msgstr "" -#. module: product_electronic +#. module: product_manufacturer #: field:product.product,manufacturer_pname:0 msgid "Manufacturer product name" msgstr "" -#. module: product_electronic +#. module: product_manufacturer #: field:product.product,manufacturer:0 msgid "Manufacturer" msgstr "" diff --git a/addons/product_manufacturer/product_manufacturer.py b/addons/product_manufacturer/product_manufacturer.py index d77ab518efe..969b4ce69cf 100644 --- a/addons/product_manufacturer/product_manufacturer.py +++ b/addons/product_manufacturer/product_manufacturer.py @@ -24,26 +24,13 @@ class product_product(osv.osv): _inherit = 'product.product' _name = 'product.product' _columns = { + 'manufacturer' : fields.many2one('res.partner', 'Manufacturer'), + 'manufacturer_pname' : fields.char('Manufacturer Product Name', size=64), + 'manufacturer_pref' : fields.char('Manufacturer Product Code', size=64), 'attribute_ids': fields.one2many('product.manufacturer.attribute', 'product_id', 'Attributes'), - 'manufacturer_ids': fields.one2many('res.partner.manufacturer', 'product_id', 'Manufacturers'), } product_product() -class res_partner_manufacturer(osv.osv): - _name = 'res.partner.manufacturer' - _rec_name = 'manufacturer_id' - _columns = { - 'manufacturer_id' : fields.many2one('res.partner', 'Manufacturer'), - 'country_id' : fields.many2one('res.country', 'Country'), - 'authorized' : fields.boolean('Authorized'), - 'product_id': fields.many2one('product.product', 'Product', ondelete='cascade'), - } - _defaults = { - 'authorized': lambda *a: True, - } - -res_partner_manufacturer() - class product_attribute(osv.osv): _name = "product.manufacturer.attribute" _description = "Product attributes" diff --git a/addons/product_manufacturer/product_manufacturer_view.xml b/addons/product_manufacturer/product_manufacturer_view.xml index cfd7f23ae8d..1d1f952cd4d 100644 --- a/addons/product_manufacturer/product_manufacturer_view.xml +++ b/addons/product_manufacturer/product_manufacturer_view.xml @@ -1,72 +1,56 @@ - + - - product.normal.form - product.product - - form - - - - - + + product.normal.form + product.product + + form + + + + + + + + - - - - - - + + + + + + + + + + + - - product.manufacturer.attribute.tree - product.manufacturer.attribute - tree - - - - - - - - - product.manufacturer.attribute.form - product.manufacturer.attribute - form - -
- - - - -
+ + product.manufacturer.attribute.tree + product.manufacturer.attribute + tree + + + + + + + + + product.manufacturer.attribute.form + product.manufacturer.attribute + form + +
+ + + + +
- - res.partner.manufacturer.tree - res.partner.manufacturer - tree - - - - - - - - - - res.partner.manufacturer.form - res.partner.manufacturer - form - -
- - - - - -
-
+
diff --git a/addons/product_manufacturer/security/ir.model.access.csv b/addons/product_manufacturer/security/ir.model.access.csv index 1d3f9af7a2b..6f07fb1dc94 100644 --- a/addons/product_manufacturer/security/ir.model.access.csv +++ b/addons/product_manufacturer/security/ir.model.access.csv @@ -1,5 +1,3 @@ "id","name","model_id:id","group_id:id","perm_read","perm_write","perm_create","perm_unlink" -"access_product_manufacturer_attribute","product.manufacturer.attribute","model_product_manufacturer_attribute",,1,0,0,0 +"access_product_manufacturer_attribute","product.manufacturer.attribute","model_product_manufacturer_attribute",base.group_user,1,0,0,0 "access_product_manufacturer_attribute_manager","product.manufacturer.attribute","model_product_manufacturer_attribute","product.group_product_manager",1,1,1,1 -"access_partner_manufacturer","res.partner.manufacturer","model_res_partner_manufacturer",,1,0,0,0 -"access_partner_manufacturer_manager","res.partner.manufacturer","model_res_partner_manufacturer","product.group_product_manager",1,1,1,1 From 0a403e732c4c98e0344094d116c6eb6a9352ae9a Mon Sep 17 00:00:00 2001 From: Fabien Pinckaers Date: Mon, 14 Jun 2010 08:50:20 +0200 Subject: [PATCH 07/11] [IMP] better modules descriptions bzr revid: fp@tinyerp.com-20100614065020-45em7h3t5r5l5wca --- addons/crm_claim/__openerp__.py | 8 ++++++-- addons/product_expiry/__openerp__.py | 2 +- addons/product_manufacturer/__openerp__.py | 2 +- 3 files changed, 8 insertions(+), 4 deletions(-) diff --git a/addons/crm_claim/__openerp__.py b/addons/crm_claim/__openerp__.py index 6ad4af16266..c3533af2702 100644 --- a/addons/crm_claim/__openerp__.py +++ b/addons/crm_claim/__openerp__.py @@ -24,8 +24,12 @@ 'name': 'Customer & Supplier Relationship Management', 'version': '1.0', 'category': 'Generic Modules/CRM & SRM', - 'description': """claim""", - 'author': 'Tiny', + 'description': """ +This modules allows you to track your customers/suppliers claims and flames. +It is fully integrated with the email gateway so that you can create +automatically new claims based on incoming emails. + """, + 'author': 'OpenERP SA', 'website': 'http://www.openerp.com', 'depends': ['crm'], 'init_xml': [ diff --git a/addons/product_expiry/__openerp__.py b/addons/product_expiry/__openerp__.py index 1d0b9356efe..b03777ecec6 100644 --- a/addons/product_expiry/__openerp__.py +++ b/addons/product_expiry/__openerp__.py @@ -20,7 +20,7 @@ { "name" : "Products date of expiry", "version" : "1.0", - "author" : "Tiny", + "author" : "OpenERP SA", "category" : "Enterprise Specific Modules/Food Industries", "depends" : ["base", "account", "product", "stock"], "init_xml" : [], diff --git a/addons/product_manufacturer/__openerp__.py b/addons/product_manufacturer/__openerp__.py index e6a1a919865..bccabe95283 100644 --- a/addons/product_manufacturer/__openerp__.py +++ b/addons/product_manufacturer/__openerp__.py @@ -20,7 +20,7 @@ { "name" : "Products Attributes & Manufacturers", "version" : "1.0", - "author" : "Tiny", + "author" : "OpenERP SA", "category" : "Enterprise Specific Modules/Manufacturer Industries", "depends" : ["base", "account", "product", "stock"], "init_xml" : [], From 7c8fad14205a0d28b3dace5058b022fc0c40a4bf Mon Sep 17 00:00:00 2001 From: Fabien Pinckaers Date: Wed, 23 Jun 2010 17:37:08 +0200 Subject: [PATCH 08/11] [IMP] marketing campaign statistics bzr revid: fp@tinyerp.com-20100623153708-njpaifwv52fnhssj --- .../report/campaign_analysis.py | 16 +++++++--------- .../report/campaign_analysis_view.xml | 15 +++++++++++++-- 2 files changed, 20 insertions(+), 11 deletions(-) diff --git a/addons/marketing_campaign/report/campaign_analysis.py b/addons/marketing_campaign/report/campaign_analysis.py index 590abf47fce..4853cb65e2c 100644 --- a/addons/marketing_campaign/report/campaign_analysis.py +++ b/addons/marketing_campaign/report/campaign_analysis.py @@ -26,13 +26,13 @@ class campaign_analysis(osv.osv): #{{{ _description = "Campaign Analysis" _auto = False _rec_name = 'date' - def _total_cost(self, cr, uid, ids, field_name, arg, context={}): - - """ @param cr: the current row, from the database cursor, + """ + @param cr: the current row, from the database cursor, @param uid: the current user’s ID for security checks, @param ids: List of case and section Data’s IDs - @param context: A standard dictionary for contextual values """ + @param context: A standard dictionary for contextual values + """ result = {} for ca_obj in self.browse(cr, uid, ids, context): wi_ids = self.pool.get('marketing.campaign.workitem').search(cr, uid, @@ -41,7 +41,6 @@ class campaign_analysis(osv.osv): #{{{ (ca_obj.campaign_id.fixed_cost / len(wi_ids)) result[ca_obj.id] = total_cost return result - _columns = { 'year': fields.char('Year', size=4, readonly=True), 'month':fields.selection([('01','January'), ('02','February'), @@ -49,7 +48,7 @@ class campaign_analysis(osv.osv): #{{{ ('07','July'), ('08','August'), ('09','September'), ('10','October'), ('11','November'), ('12','December')], 'Month', readonly=True), - 'date': fields.datetime('Date', readonly=True), + 'date': fields.date('Date', readonly=True), 'campaign_id': fields.many2one('marketing.campaign', 'Campaign', readonly=True), 'activity_id': fields.many2one('marketing.campaign.activity', 'Activity', @@ -64,10 +63,8 @@ class campaign_analysis(osv.osv): #{{{ 'revenue': fields.float('Revenue',digits=(16,2),readonly=True), 'count' : fields.integer('# of Actions', readonly=True), } - def init(self, cr): tools.drop_view_if_exists(cr, 'campaign_analysis') - cr.execute(""" create or replace view campaign_analysis as ( select @@ -79,6 +76,7 @@ class campaign_analysis(osv.osv): #{{{ wi.activity_id as activity_id, wi.segment_id as segment_id, wi.partner_id as partner_id , + wi.state as state, sum(act.revenue) as revenue, count(*) as count from @@ -87,7 +85,7 @@ class campaign_analysis(osv.osv): #{{{ left join marketing_campaign_segment s on (s.id=wi.segment_id) left join marketing_campaign_activity act on (act.id= wi.activity_id) group by - s.campaign_id,wi.activity_id,wi.segment_id,wi.partner_id, + s.campaign_id,wi.activity_id,wi.segment_id,wi.partner_id,wi.state, wi.date::date ) """) diff --git a/addons/marketing_campaign/report/campaign_analysis_view.xml b/addons/marketing_campaign/report/campaign_analysis_view.xml index 5a622d1364b..fb83e12a225 100644 --- a/addons/marketing_campaign/report/campaign_analysis_view.xml +++ b/addons/marketing_campaign/report/campaign_analysis_view.xml @@ -35,11 +35,20 @@ - + + + + @@ -50,6 +59,8 @@ + + From b1991d21d501face1db8383c99ecd9b9ead145e3 Mon Sep 17 00:00:00 2001 From: Mantavya Gajjar Date: Thu, 24 Jun 2010 01:14:06 +0530 Subject: [PATCH 09/11] [IMP]: accounting improvements * account.move * account.move.line * account.invoice * account.voucher * bank statement bzr revid: mga@tinyerp.com-20100623194406-3go72eb7hseiylhb --- addons/account/account_bank_statement.py | 10 +- addons/account/account_invoice_view.xml | 8 +- addons/account/account_report.xml | 2 +- addons/account/account_view.xml | 105 +++++++++++++----- .../process/customer_invoice_process.xml | 8 +- .../process/supplier_invoice_process.xml | 6 +- addons/account_voucher/voucher_report.xml | 4 +- addons/account_voucher/voucher_view.xml | 17 ++- 8 files changed, 112 insertions(+), 48 deletions(-) diff --git a/addons/account/account_bank_statement.py b/addons/account/account_bank_statement.py index 6de3dabaa28..0e46944a436 100644 --- a/addons/account/account_bank_statement.py +++ b/addons/account/account_bank_statement.py @@ -45,7 +45,7 @@ class account_bank_statement(osv.osv): 'type': 'ir.actions.act_window', 'target': 'new', 'nodestroy': True - } + } def _default_journal_id(self, cr, uid, context={}): if context.get('journal_id', False): @@ -556,9 +556,9 @@ account_bank_statement_reconcile_line() class account_bank_statement_line(osv.osv): - def onchange_partner_id(self, cursor, user, line_id, partner_id, type, currency_id, - context={}): + def onchange_partner_id(self, cursor, user, line_id, partner_id, type, currency_id, context={}): res = {'value': {}} + if not partner_id: return res line = self.browse(cursor, user, line_id) @@ -591,6 +591,10 @@ class account_bank_statement_line(osv.osv): balance = res_currency_obj.compute(cursor, user, company_currency_id, currency_id, balance, context=context) res['value']['amount'] = balance + + if context.get('amount', 0) > 0: + res['value']['amount'] = context.get('amount') + return res def _reconcile_amount(self, cursor, user, ids, name, args, context=None): diff --git a/addons/account/account_invoice_view.xml b/addons/account/account_invoice_view.xml index bceb1b3c857..fc10c58cc8f 100644 --- a/addons/account/account_invoice_view.xml +++ b/addons/account/account_invoice_view.xml @@ -349,11 +349,15 @@ + + - + + + @@ -363,7 +367,7 @@ - + diff --git a/addons/account/account_report.xml b/addons/account/account_report.xml index 6480178d1ae..fc622d8f0c0 100644 --- a/addons/account/account_report.xml +++ b/addons/account/account_report.xml @@ -34,7 +34,7 @@ string="Taxes Report"/> tree,form - + + + account.bank.statement.select + account.bank.statement + search + + + + + + + + + + + + + + account.bank.statement.tree account.bank.statement @@ -358,19 +376,20 @@ form
- - - - - - - - -