From bf7fd5ba71a16a99419ff7bdf8adaad5920e39a3 Mon Sep 17 00:00:00 2001 From: Naresh Choksy Date: Wed, 19 Nov 2008 15:07:50 +0530 Subject: [PATCH 001/160] bugfixes and small improvements bzr revid: nch@tinyerp.com-20081119093750-o6j0uweg12tya5go --- bin/addons/base/ir/workflow/workflow.py | 22 +++++++++++----------- bin/addons/base/res/res_user.py | 4 ++-- bin/import_xml.rng | 4 ++-- 3 files changed, 15 insertions(+), 15 deletions(-) diff --git a/bin/addons/base/ir/workflow/workflow.py b/bin/addons/base/ir/workflow/workflow.py index 52e51ceddef..08d4fbba3e5 100644 --- a/bin/addons/base/ir/workflow/workflow.py +++ b/bin/addons/base/ir/workflow/workflow.py @@ -1,7 +1,7 @@ # -*- encoding: utf-8 -*- ############################################################################## # -# OpenERP, Open Source Management Solution +# OpenERP, Open Source Management Solution # Copyright (C) 2004-2008 Tiny SPRL (). All Rights Reserved # $Id$ # @@ -27,7 +27,7 @@ import netsvc class workflow(osv.osv): _name = "workflow" _table = "wkf" - _log_access = False + # _log_access = False _columns = { 'name': fields.char('Name', size=64, required=True), 'osv': fields.char('Resource Object', size=64, required=True,select=True), @@ -49,7 +49,7 @@ class workflow(osv.osv): # scale = (vertical-distance, horizontal-distance, min-node-width(optional), min-node-height(optional), margin(default=20)) # - + def graph_get(self, cr, uid, id, scale, context={}): nodes= [] @@ -67,24 +67,24 @@ class workflow(osv.osv): else: if not a.in_transitions: no_ancester.append(a.id) - + for t in a.out_transitions: transitions.append((a.id, t.act_to.id)) tres[t.id] = (a.id, t.act_to.id) - - + + g = graph(nodes, transitions, no_ancester) g.process(start) g.scale(*scale) result = g.result_get() results = {} - + for node in nodes_name: results[str(node[0])] = result[node[0]] results[str(node[0])]['name'] = node[1] - + return {'nodes': results, 'transitions': tres} - + def create(self, cr, user, vals, context=None): if not context: @@ -97,7 +97,7 @@ workflow() class wkf_activity(osv.osv): _name = "workflow.activity" _table = "wkf_activity" - _log_access = False + # _log_access = False _columns = { 'name': fields.char('Name', size=64, required=True), 'wkf_id': fields.many2one('workflow', 'Workflow', required=True, select=True, ondelete='cascade'), @@ -123,7 +123,7 @@ wkf_activity() class wkf_transition(osv.osv): _table = "wkf_transition" _name = "workflow.transition" - _log_access = False + # _log_access = False _rec_name = 'signal' _columns = { 'trigger_model': fields.char('Trigger Object', size=128), diff --git a/bin/addons/base/res/res_user.py b/bin/addons/base/res/res_user.py index d9f84a0d29d..d6a1c3ac491 100644 --- a/bin/addons/base/res/res_user.py +++ b/bin/addons/base/res/res_user.py @@ -1,7 +1,7 @@ # -*- encoding: utf-8 -*- ############################################################################## # -# OpenERP, Open Source Management Solution +# OpenERP, Open Source Management Solution # Copyright (C) 2004-2008 Tiny SPRL (). All Rights Reserved # $Id$ # @@ -92,7 +92,7 @@ def _tz_get(self,cr,uid, context={}): class users(osv.osv): _name = "res.users" - _log_access = False + #_log_access = False _columns = { 'name': fields.char('Name', size=64, required=True, select=True), 'login': fields.char('Login', size=64, required=True), diff --git a/bin/import_xml.rng b/bin/import_xml.rng index 91b3a9554e5..0b88766f472 100644 --- a/bin/import_xml.rng +++ b/bin/import_xml.rng @@ -134,9 +134,9 @@ - + - + From 962434674c0c67a6cc06983fae8f90dda9b91904 Mon Sep 17 00:00:00 2001 From: Stephane Wirtel Date: Fri, 21 Nov 2008 21:29:58 +0100 Subject: [PATCH 002/160] [FIX] Typo bzr revid: stephane@tinyerp.com-20081121202958-nsk3984rw9f435if --- addons/document_ics/__terp__.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/addons/document_ics/__terp__.py b/addons/document_ics/__terp__.py index ba665a6efba..f76096de470 100644 --- a/addons/document_ics/__terp__.py +++ b/addons/document_ics/__terp__.py @@ -20,7 +20,7 @@ # ############################################################################## { - "name" : "Suport for iCal based on Document Management System", + "name" : "Support for iCal based on Document Management System", "version" : "1.0", "author" : "Tiny", "category" : "Generic Modules/Others", From 15d51bf5e96522374d2bd08a3ec32e686ba0326c Mon Sep 17 00:00:00 2001 From: Mantavya Gajjar Date: Mon, 24 Nov 2008 11:56:51 +0530 Subject: [PATCH 003/160] bugfixing to the group tree action for opening related list of pages action change form wizard to ir.actions.act_window bzr revid: mga@tinyerp.com-20081124062651-l0crpajm6kqfx55w --- addons/wiki/wiki.py | 10 ---------- addons/wiki/wiki_view.xml | 4 ++-- 2 files changed, 2 insertions(+), 12 deletions(-) diff --git a/addons/wiki/wiki.py b/addons/wiki/wiki.py index e2032634eb7..3d749c2ef2f 100644 --- a/addons/wiki/wiki.py +++ b/addons/wiki/wiki.py @@ -86,16 +86,6 @@ class Wiki(osv.osv): } } - def read(self, cr, uid, cids, fields=None, context=None, load='_classic_read'): - ids = [] - for id in cids: - if type(id) == type(1): - ids.append(id) - elif type(id) == type(u''): - ids.append(10) - result = super(Wiki, self).read(cr, uid, ids, fields, None, load='_classic_read') - return result - def write(self, cr, uid, ids, vals, context=None): if vals.get('text_area'): vals['history_id']=[(0,0,{ diff --git a/addons/wiki/wiki_view.xml b/addons/wiki/wiki_view.xml index 825537811e2..0aed52c4856 100644 --- a/addons/wiki/wiki_view.xml +++ b/addons/wiki/wiki_view.xml @@ -174,11 +174,11 @@ res_model="wiki.wiki" src_model="wiki.groups"/> - + tree_but_open wiki.groups Wiki Pages - + From 2e4230ae7c4cc5e3742a91803d618795a5bee091 Mon Sep 17 00:00:00 2001 From: Mantavya Gajjar Date: Mon, 24 Nov 2008 12:19:47 +0530 Subject: [PATCH 004/160] * Few changes, fields in history * Bug fix for the create manu wizard bzr revid: mga@tinyerp.com-20081124064947-l0dgvyyzt49vkb6i --- addons/wiki/wiki.py | 31 ++++++++++++++++++------------- addons/wiki/wiki_view.xml | 11 +++++------ addons/wiki/wizard/create_menu.py | 2 +- 3 files changed, 24 insertions(+), 20 deletions(-) diff --git a/addons/wiki/wiki.py b/addons/wiki/wiki.py index 3d749c2ef2f..5d7d05615cb 100644 --- a/addons/wiki/wiki.py +++ b/addons/wiki/wiki.py @@ -87,14 +87,21 @@ class Wiki(osv.osv): } def write(self, cr, uid, ids, vals, context=None): + result = super(Wiki,self).write(cr, uid, ids, vals, context) + history = self.pool.get('wiki.wiki.history') + if vals.get('text_area'): - vals['history_id']=[(0,0,{ - 'minor_edit':vals.get('minor_edit', False), - 'text_area':vals['text_area'], - 'modify_by':uid, - 'summary':vals.get('summary','') - })] - return super(Wiki,self).write(cr, uid, ids, vals, context) + for id in ids: + res = { + 'minor_edit':vals.get('minor_edit', True), + 'text_area':vals.get('text_area',''), + 'write_uid':uid, + 'wiki_id' : id, + 'summary':vals.get('summary','') + } + history.create(cr, uid, res) + return result + Wiki() class History(osv.osv): @@ -103,17 +110,15 @@ class History(osv.osv): _rec_name="date_time" _order = 'id DESC' _columns={ - 'date_time':fields.datetime("Date",select=True), + 'create_date':fields.datetime("Date",select=True), 'text_area':fields.text("Text area",select=True), 'minor_edit':fields.boolean('This is a major edit ?',select=True), 'summary':fields.char('Summary',size=256, select=True), - 'modify_by':fields.many2one('res.users',"Modify By", select=True), - 'hist_write_date':fields.datetime("Last modified", select=True), - 'history_wiki_id':fields.many2one('wiki.wiki','Wiki Id', select=True) + 'write_uid':fields.many2one('res.users',"Modify By", select=True), + 'wiki_id':fields.many2one('wiki.wiki','Wiki Id', select=True) } _defaults = { - 'hist_write_date': lambda *a: time.strftime('%Y-%m-%d %H:%M:%S'), - 'modify_by': lambda obj,cr,uid,context: uid, + 'write_uid': lambda obj,cr,uid,context: uid, } def getDiff(self, cr, uid, v1, v2, context={}): import difflib diff --git a/addons/wiki/wiki_view.xml b/addons/wiki/wiki_view.xml index 0aed52c4856..4fca7a8f7df 100644 --- a/addons/wiki/wiki_view.xml +++ b/addons/wiki/wiki_view.xml @@ -126,8 +126,8 @@ tree - - + + @@ -140,12 +140,11 @@ form
- + - + -
@@ -161,7 +160,7 @@ id="menu_action_history" action="action_history"/> - Date: Mon, 24 Nov 2008 13:22:15 +0530 Subject: [PATCH 005/160] implement * differance wizard to show diff between 2 history lines bzr revid: mga@tinyerp.com-20081124075215-7bhiqoyc6vray2bg --- addons/wiki/__terp__.py | 1 + addons/wiki/wizard/__init__.py | 3 +- addons/wiki/wizard/create_menu.py | 4 +-- addons/wiki/wizard/show_diff.py | 50 ++++++++++++++++++++++++++++++ addons/wiki/wizard/wizard_view.xml | 25 +++++++++++++++ 5 files changed, 80 insertions(+), 3 deletions(-) create mode 100644 addons/wiki/wizard/show_diff.py create mode 100644 addons/wiki/wizard/wizard_view.xml diff --git a/addons/wiki/__terp__.py b/addons/wiki/__terp__.py index b42cb542b1e..f78d78955d6 100644 --- a/addons/wiki/__terp__.py +++ b/addons/wiki/__terp__.py @@ -14,6 +14,7 @@ "demo_xml" : [], "update_xml" : [ "wiki_view.xml", + "wizard/wizard_view.xml", "security/ir.model.access.csv" ], "active": False, diff --git a/addons/wiki/wizard/__init__.py b/addons/wiki/wizard/__init__.py index 2d0a1a53130..ee734cd9600 100644 --- a/addons/wiki/wizard/__init__.py +++ b/addons/wiki/wizard/__init__.py @@ -1 +1,2 @@ -import create_menu \ No newline at end of file +import create_menu +import show_diff \ No newline at end of file diff --git a/addons/wiki/wizard/create_menu.py b/addons/wiki/wizard/create_menu.py index 2b6c4df8e64..93507afeab2 100644 --- a/addons/wiki/wizard/create_menu.py +++ b/addons/wiki/wizard/create_menu.py @@ -38,7 +38,7 @@ section_fields = { 'menu_parent_id': {'string':'Parent Menu', 'type':'many2one', 'relation':'ir.ui.menu', 'required':True}, } -def report_menu_create(self, cr, uid, data, context): +def wiki_menu_create(self, cr, uid, data, context): pool = pooler.get_pool(cr.dbname) group = pool.get('wiki.groups').browse(cr, uid, data['id']) @@ -65,7 +65,7 @@ class wizard_create_menu(wizard.interface): 'result': {'type':'form', 'arch':section_form, 'fields':section_fields, 'state':[('end','Cancel'),('create_menu','Create Menu')]} }, 'create_menu': { - 'actions': [report_menu_create], + 'actions': [wiki_menu_create], 'result': { 'type':'state', 'state':'end' diff --git a/addons/wiki/wizard/show_diff.py b/addons/wiki/wizard/show_diff.py new file mode 100644 index 00000000000..6ea9bcf814d --- /dev/null +++ b/addons/wiki/wizard/show_diff.py @@ -0,0 +1,50 @@ +# -*- encoding: utf-8 -*- +############################################################################## +# +# OpenERP, Open Source Management Solution +# Copyright (C) 2004-2008 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 . +# +############################################################################## + +from osv import fields,osv + + + +class showdiff(osv.osv_memory): + _name = 'wizard.wiki.history.show_diff' + + def _get_diff(self, cr, uid, ctx): + print 'XXXXXXXXXXXXXXXXXX : ', ctx + history = self.pool.get('wiki.wiki.history') + res = {} +# if lan(ids) == 2: +# diff = history.getDiff(cr, uid, ids[0]. ids[1]) +# res = { +# ids[0] : diff, +# ids[1] : diff, +# } + return res + + _columns = { + 'diff': fields.function(_get_diff, method=True, type='char', string='Diff'), + } + _defaults = { + 'diff': _get_diff + } +showdiff() + + \ No newline at end of file diff --git a/addons/wiki/wizard/wizard_view.xml b/addons/wiki/wizard/wizard_view.xml new file mode 100644 index 00000000000..2fa562b8aec --- /dev/null +++ b/addons/wiki/wizard/wizard_view.xml @@ -0,0 +1,25 @@ + + + + + Wiki Differance + wizard.wiki.history.show_diff + form + +
+ + + + +
+ + +
+
\ No newline at end of file From 655205d823208ca60628fba61fddbddd642bd008 Mon Sep 17 00:00:00 2001 From: Mantavya Gajjar Date: Mon, 24 Nov 2008 15:44:28 +0530 Subject: [PATCH 006/160] implement * show diff for the 2 wiki history line * make section enabled based on the wiki group bzr revid: mga@tinyerp.com-20081124101428-z89vuq3p4822m2bd --- addons/wiki/wiki.py | 4 ++-- addons/wiki/wiki_view.xml | 6 +++--- addons/wiki/wizard/create_menu.py | 2 +- addons/wiki/wizard/show_diff.py | 33 +++++++++++++++++-------------- 4 files changed, 24 insertions(+), 21 deletions(-) diff --git a/addons/wiki/wiki.py b/addons/wiki/wiki.py index 5d7d05615cb..5e1ba1b7aa6 100644 --- a/addons/wiki/wiki.py +++ b/addons/wiki/wiki.py @@ -42,11 +42,11 @@ class WikiGroup(osv.osv): 'page_ids':fields.one2many('wiki.wiki', 'group_id', 'Pages'), 'notes':fields.text("Description", select=True), 'create_date':fields.datetime("Created Date", select=True), - 'template': fields.text('Wiki Template') + 'template': fields.text('Wiki Template'), + 'section': fields.boolean("Make Section?") } WikiGroup() - class Wiki(osv.osv): _name="wiki.wiki" _description="Wiki Page" diff --git a/addons/wiki/wiki_view.xml b/addons/wiki/wiki_view.xml index 4fca7a8f7df..197bb93bbda 100644 --- a/addons/wiki/wiki_view.xml +++ b/addons/wiki/wiki_view.xml @@ -27,10 +27,11 @@ form
- + + @@ -94,8 +95,7 @@ - - + diff --git a/addons/wiki/wizard/create_menu.py b/addons/wiki/wizard/create_menu.py index 93507afeab2..f97430312bd 100644 --- a/addons/wiki/wizard/create_menu.py +++ b/addons/wiki/wizard/create_menu.py @@ -46,7 +46,7 @@ def wiki_menu_create(self, cr, uid, data, context): 'name': group.name, 'view_type':'form', 'view_mode':"tree,form", - 'context': "{'group_id':%d}" % (group.id,), + 'context': "{'group_id':%d, 'section':%d}" % (group.id, group.section), 'domain': "[('group_id','child_of',[%d])]" % (group.id,), 'res_model': 'wiki.wiki' }) diff --git a/addons/wiki/wizard/show_diff.py b/addons/wiki/wizard/show_diff.py index 6ea9bcf814d..c348055c9e9 100644 --- a/addons/wiki/wizard/show_diff.py +++ b/addons/wiki/wizard/show_diff.py @@ -22,29 +22,32 @@ from osv import fields,osv - - class showdiff(osv.osv_memory): _name = 'wizard.wiki.history.show_diff' def _get_diff(self, cr, uid, ctx): - print 'XXXXXXXXXXXXXXXXXX : ', ctx history = self.pool.get('wiki.wiki.history') - res = {} -# if lan(ids) == 2: -# diff = history.getDiff(cr, uid, ids[0]. ids[1]) -# res = { -# ids[0] : diff, -# ids[1] : diff, -# } - return res + ids = ctx.get('active_ids') + diff = "" + if len(ids) == 2: + if ids[0] > ids[1]: + diff = history.getDiff(cr, uid, ids[1], ids[0]) + else: + diff = history.getDiff(cr, uid, ids[0], ids[1]) + + elif len(ids) == 1: + old = history.browse(cr, uid, ids[0]) + nids = history.search(cr, uid, [('wiki_id','=',old.wiki_id.id)]) + nids.sort() + if ids[0] != nids[-1]: + diff = history.getDiff(cr, uid, ids[0], nids[-1]) + + return diff _columns = { - 'diff': fields.function(_get_diff, method=True, type='char', string='Diff'), + 'diff': fields.text('Diff'), } _defaults = { 'diff': _get_diff } -showdiff() - - \ No newline at end of file +showdiff() \ No newline at end of file From 80f77a429d465cc782006f752cfdb07e690a7c25 Mon Sep 17 00:00:00 2001 From: Stephane Wirtel Date: Mon, 24 Nov 2008 12:15:30 +0100 Subject: [PATCH 007/160] [REF] Clean the code for email_send bzr revid: stephane@tinyerp.com-20081124111530-ujuxdgwc25nft7mx --- addons/crm/crm.py | 54 +++++++++++++++++++++++------------------------ 1 file changed, 27 insertions(+), 27 deletions(-) diff --git a/addons/crm/crm.py b/addons/crm/crm.py index 192ee2e057e..d284da54904 100644 --- a/addons/crm/crm.py +++ b/addons/crm/crm.py @@ -594,30 +594,25 @@ class crm_case(osv.osv): if case.user_id.signature: body += '\n\n%s' % (case.user_id.signature) dest = [dest] - if not attach: - tools.email_send( - src, - dest, - 'Reminder: '+'['+str(case.id)+']'+' '+case.name, - body, - reply_to=case.section_id.reply_to, tinycrm=str(case.id) - ) - else: - attach_ids = self.pool.get('ir.attachment').search(cr, uid, - [('res_model', '=', 'crm.case'), - ('res_id', '=', case.id)]) - res = self.pool.get('ir.attachment').read(cr, uid, - attach_ids, ['datas_fname','datas']) - res = map(lambda x: (x['datas_fname'], - base64.decodestring(x['datas'])), res) - tools.email_send_attach( - src, - dest, - 'Reminder: '+'['+str(case.id)+']'+' '+case.name, - body, - reply_to=case.section_id.reply_to, - attach=res, tinycrm=str(case.id) - ) + + attach_to_send = None + + if attach: + attach_ids = self.pool.get('ir.attachment').search(cr, uid, [('res_model', '=', 'crm.case'), ('res_id', '=', case.id)]) + attach_to_send = self.pool.get('ir.attachment').read(cr, uid, attach_ids, ['datas_fname','datas']) + attach_to_send = map(lambda x: (x['datas_fname'], base64.decodestring(x['datas'])), attach_to_send) + + # Send an email + tools.email_send( + src, + dest, + "Reminder: [%s] %s" % (str(case.id), case.name, ), + body, + reply_to=case.section_id.reply_to, + tinycrm=str(case.id), + attach=attach_to_send + ) + return True def add_reply(self, cursor, user, ids, context=None): @@ -653,9 +648,14 @@ class crm_case(osv.osv): body = case.description if case.user_id.signature: body += '\n\n%s' % (case.user_id.signature) - tools.email_send(case.user_id.address_id.email, emails, - '['+str(case.id)+'] '+case.name, body, - reply_to=case.section_id.reply_to, tinycrm=str(case.id)) + tools.email_send( + case.user_id.address_id.email, + emails, + '['+str(case.id)+'] '+case.name, + body, + reply_to=case.section_id.reply_to, + tinycrm=str(case.id) + ) return True def onchange_partner_id(self, cr, uid, ids, part, email=False): From b216e06e67d53d2d1257c056915a35fc2863529c Mon Sep 17 00:00:00 2001 From: Christophe Simonis Date: Mon, 24 Nov 2008 16:42:29 +0100 Subject: [PATCH 008/160] [IMP] better get_invalid_fields function bzr revid: christophe@tinyerp.com-20081124154229-st6d2ehiyc5xip0h --- bin/osv/orm.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/bin/osv/orm.py b/bin/osv/orm.py index b056ba9dddb..292b76a400b 100644 --- a/bin/osv/orm.py +++ b/bin/osv/orm.py @@ -300,7 +300,7 @@ class orm_template(object): _description = None _inherits = {} _table = None - _invalids=[] + _invalids = set() def _field_create(self, cr, context={}): cr.execute("SELECT id FROM ir_model_data WHERE name='%s'" % ('model_'+self._name.replace('.','_'),)) @@ -653,7 +653,7 @@ class orm_template(object): raise _('The read method is not implemented on this object !') def get_invalid_fields(self,cr,uid): - return self._invalids.__str__() + return list(self._invalids) def _validate(self, cr, uid, ids, context=None): context = context or {} @@ -667,12 +667,12 @@ class orm_template(object): error_msgs.append( _("Error occured while validating the field(s) %s: %s") % (','.join(fields), translated_msg) ) - self._invalids.extend(fields) + self._invalids.update(fields) if error_msgs: cr.rollback() raise except_orm('ValidateError', '\n'.join(error_msgs)) else: - self._invalids=[] + self._invalids.clear() def default_get(self, cr, uid, fields_list, context=None): return {} From 1f68c755e120294f1131cc842b23c7f08bc1d40d Mon Sep 17 00:00:00 2001 From: Fabien Pinckaers Date: Mon, 24 Nov 2008 17:22:47 +0100 Subject: [PATCH 009/160] bugfix bzr revid: fp@tinyerp.com-20081124162247-rje8rap9dre73hxp --- bin/osv/fields.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/bin/osv/fields.py b/bin/osv/fields.py index db01b4462b8..d2d37eec55c 100644 --- a/bin/osv/fields.py +++ b/bin/osv/fields.py @@ -160,7 +160,7 @@ class char(_column): u_symb = symb else: u_symb = unicode(symb) - return u_symb.encode('utf8')[:self.size] + return u_symb[:self.size].encode('utf8') class text(_column): From 5a3a7a9f0122b1c75a84400247c4a30302825b0d Mon Sep 17 00:00:00 2001 From: qdp Date: Mon, 24 Nov 2008 17:34:24 +0100 Subject: [PATCH 010/160] *minor bugfix: removed brackets on binary filter *added company_country in variables given to pdf bzr revid: qdp@tinyerp.com-20081124163424-42sfiztqdcid26wh --- .../account_report/wizard/wizard_print_indicators_with_pdf.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/addons/account_report/wizard/wizard_print_indicators_with_pdf.py b/addons/account_report/wizard/wizard_print_indicators_with_pdf.py index 2371f912b62..5acf794579e 100644 --- a/addons/account_report/wizard/wizard_print_indicators_with_pdf.py +++ b/addons/account_report/wizard/wizard_print_indicators_with_pdf.py @@ -41,7 +41,7 @@ form = ''' ''' fields = { - 'file': {'string':'Select a PDF File', 'type':'binary','required':True,'filters':['*.pdf']}, + 'file': {'string':'Select a PDF File', 'type':'binary','required':True,'filters':'*.pdf'}, } @@ -82,6 +82,7 @@ class report_custom(report_int): obj_user=pool.get('res.users').browse(cr,uid,uid) self.list['printing_user']=obj_user.name self.list['company_name']=obj_user.company_id.name + self.list['company_country']=obj_user.company_id.partner_id.country self.list['company_vat']=obj_user.company_id.partner_id.vat self.list['printing_time']=time.strftime('%H:%M:%S') self.list['printing_date']=time.strftime('%D') From 36d4f14a2abc6af97aa8634f9c984804cec1a925 Mon Sep 17 00:00:00 2001 From: qdp Date: Mon, 24 Nov 2008 17:51:26 +0100 Subject: [PATCH 011/160] *cleaned and added a function to create analytic lines (in order to be inherited by other modules liek account_analytic_plans) bzr revid: qdp@tinyerp.com-20081124165126-rb1j9kscaa406siw --- addons/account/account.py | 21 ++++----------------- addons/account/account_move_line.py | 18 ++++++++++++++++++ 2 files changed, 22 insertions(+), 17 deletions(-) diff --git a/addons/account/account.py b/addons/account/account.py index a22b8a5c5fa..3df1dc622d1 100644 --- a/addons/account/account.py +++ b/addons/account/account.py @@ -1032,23 +1032,10 @@ class account_move(osv.osv): }, context, check=False) ok = False if ok: - obj_line=self.browse(cr, uid, ids[0]) - for move in self.browse(cr, uid, ids, context): - for obj_line in move.line_id: - #create analytic lines - if obj_line.analytic_account_id: - vals_lines={ - 'name': obj_line.name, - 'date': obj_line.date, - 'account_id': obj_line.analytic_account_id.id, - 'unit_amount':obj_line.quantity, - 'amount': obj_line.debit or obj_line.credit, - 'general_account_id': obj_line.account_id.id, - 'journal_id': obj_line.journal_id.analytic_journal_id.id, - 'ref': obj_line.ref, - 'move_id':obj_line.id - } - self.pool.get('account.analytic.line').create(cr,uid,vals_lines) + list_ids = [] + for tmp in move.line_id: + list_ids.append(tmp.id) + self.pool.get('account.move.line').create_analytic_lines(cr, uid, list_ids, context) return ok account_move() diff --git a/addons/account/account_move_line.py b/addons/account/account_move_line.py index d67073679d2..66ba78871fd 100644 --- a/addons/account/account_move_line.py +++ b/addons/account/account_move_line.py @@ -58,6 +58,24 @@ class account_move_line(osv.osv): del data[f] return data + def create_analytic_lines(self, cr, uid, ids, context={}): + for obj_line in self.browse(cr, uid, ids, context): + if obj_line.analytic_account_id: + amt = (obj_line.credit or 0.0) - (obj_line.debit or 0.0) + vals_lines={ + 'name': obj_line.name, + 'date': obj_line.date, + 'account_id': obj_line.analytic_account_id.id, + 'unit_amount':obj_line.quantity, + 'amount': amt, + 'general_account_id': obj_line.account_id.id, + 'journal_id': obj_line.journal_id.analytic_journal_id.id, + 'ref': obj_line.ref, + 'move_id':obj_line.id + } + new_id = self.pool.get('account.analytic.line').create(cr,uid,vals_lines) + return True + def _default_get(self, cr, uid, fields, context={}): # Compute simple values data = super(account_move_line, self).default_get(cr, uid, fields, context) From e130b17c9b01867760d947b06e8bdfaf0f40350a Mon Sep 17 00:00:00 2001 From: qdp Date: Mon, 24 Nov 2008 18:00:14 +0100 Subject: [PATCH 012/160] *bugfixed the analytic line creation (regarding to latest change: analytic lines are created when the move is validated) bzr revid: qdp@tinyerp.com-20081124170014-ukmrkrqhssgng1pp --- .../account_analytic_plans.py | 38 ++++--------------- 1 file changed, 7 insertions(+), 31 deletions(-) diff --git a/addons/account_analytic_plans/account_analytic_plans.py b/addons/account_analytic_plans/account_analytic_plans.py index b1e61d29cd7..e3190659e9a 100644 --- a/addons/account_analytic_plans/account_analytic_plans.py +++ b/addons/account_analytic_plans/account_analytic_plans.py @@ -280,21 +280,15 @@ class account_move_line(osv.osv): 'analytics_id':fields.many2one('account.analytic.plan.instance','Analytic Distribution'), } - def _analytic_update(self, cr, uid, ids, context): - if self.called: - self.called=False - return False - - obj_line=self.pool.get('account.analytic.line') - - for line in self.browse(cr, uid, ids, context): + def create_analytic_lines(self, cr, uid, ids, context={}): + super(account_move_line, self).create_analytic_lines(cr, uid, ids, context) + for line in self.browse(cr, uid, ids, context): if line.analytics_id: - toremove = obj_line.search(cr, uid, [('move_id','=',line.id)], context=context) + toremove = self.pool.get('account.analytic.line').search(cr, uid, [('move_id','=',line.id)], context=context) if toremove: - obj_line.unlink(cr, uid, toremove, context=context) - + obj_line.unlink(cr, uid, toremove, context=context) for line2 in line.analytics_id.account_ids: - val = (line.debit or 0.0) - (line.credit or 0.0) + val = (line.credit or 0.0) - (line.debit or 0.0) amt=val * (line2.rate/100) al_vals={ 'name': line.name, @@ -309,25 +303,7 @@ class account_move_line(osv.osv): 'ref': line.ref, } ali_id=self.pool.get('account.analytic.line').create(cr,uid,al_vals) - self.called=True - return True - - def write(self, cr, uid, ids, vals, context=None, check=True, update_check=True): - self.called=False - if ('analytics_id' in vals) and (not vals['analytics_id']): - for line in self.browse(cr, uid, ids, context): - toremove = self.pool.get('account.analytic.line').search(cr, uid, [('move_id','=',line.id)], context=context) - if toremove: - self.pool.get('account.analytic.line').unlink(cr, uid, toremove, context=context) - result = super(account_move_line, self).write(cr, uid, ids, vals, context, check, update_check) - self._analytic_update(cr, uid, ids, context) - return result - - def create(self, cr, uid, vals, context=None, check=True): - self.called=False - result = super(account_move_line, self).create(cr, uid, vals, context, check) - self._analytic_update(cr, uid, [result], context) - return result + return True account_move_line() From f2dc87ef31f7b3c0645b1c2ce94e3d064ef68afe Mon Sep 17 00:00:00 2001 From: Fabien Pinckaers Date: Tue, 25 Nov 2008 00:23:10 +0100 Subject: [PATCH 013/160] improve bzr revid: fp@tinyerp.com-20081124232310-qry5vphgm9vn4dpz --- addons/base_contact/base_contact.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/addons/base_contact/base_contact.py b/addons/base_contact/base_contact.py index 8b91e9b671c..022b6897ac7 100644 --- a/addons/base_contact/base_contact.py +++ b/addons/base_contact/base_contact.py @@ -118,7 +118,7 @@ class res_partner_job(osv.osv): 'name': fields.related('address_id','partner_id', type='many2one', relation='res.partner', string='Partner'), 'address_id':fields.many2one('res.partner.address','Address', required=True), 'contact_id':fields.many2one('res.partner.contact','Contact', required=True), - 'function_id': fields.many2one('res.partner.function','Job Title', required=True), + 'function_id': fields.many2one('res.partner.function','Job Title'), 'sequence_contact':fields.integer('Sequence (Contact)',help='order of importance of this address in the list of addresses of the linked contact'), 'sequence_partner':fields.integer('Sequence (Partner)',help='order of importance of this job title in the list of job title of the linked partner'), 'email': fields.char('E-Mail', size=240), From 1a96871e290faf1f3dd5b0706dfe7804fbfd8eab Mon Sep 17 00:00:00 2001 From: Fabien Pinckaers Date: Tue, 25 Nov 2008 07:45:57 +0100 Subject: [PATCH 014/160] imporve bzr revid: fp@tinyerp.com-20081125064557-iwd1p3bzz3koxfab --- addons/base_contact/base_contact.py | 4 ++-- addons/stock/stock.py | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/addons/base_contact/base_contact.py b/addons/base_contact/base_contact.py index 022b6897ac7..9fa43c42e43 100644 --- a/addons/base_contact/base_contact.py +++ b/addons/base_contact/base_contact.py @@ -116,8 +116,8 @@ class res_partner_job(osv.osv): _order = 'sequence_contact' _columns = { 'name': fields.related('address_id','partner_id', type='many2one', relation='res.partner', string='Partner'), - 'address_id':fields.many2one('res.partner.address','Address', required=True), - 'contact_id':fields.many2one('res.partner.contact','Contact', required=True), + 'address_id':fields.many2one('res.partner.address','Address'), + 'contact_id':fields.many2one('res.partner.contact','Contact', required=True, ondelete='cascade'), 'function_id': fields.many2one('res.partner.function','Job Title'), 'sequence_contact':fields.integer('Sequence (Contact)',help='order of importance of this address in the list of addresses of the linked contact'), 'sequence_partner':fields.integer('Sequence (Partner)',help='order of importance of this job title in the list of job title of the linked partner'), diff --git a/addons/stock/stock.py b/addons/stock/stock.py index 63ecd5a354d..9d71666b104 100644 --- a/addons/stock/stock.py +++ b/addons/stock/stock.py @@ -101,7 +101,7 @@ class stock_location(osv.osv): 'child_ids': fields.one2many('stock.location', 'location_id', 'Contains'), 'chained_location_id': fields.many2one('stock.location', 'Chained Location If Fixed'), - 'chained_location_type': fields.selection([('','None'),('customer', 'Customer'),('fixed','Fixed Location')], + 'chained_location_type': fields.selection([('none','None'),('customer', 'Customer'),('fixed','Fixed Location')], 'Chained Location Type', required=True), 'chained_auto_packing': fields.selection( [('auto','Automatic Move'), ('manual','Manual Operation'),('transparent','Automatic No Step Added')], @@ -128,7 +128,7 @@ class stock_location(osv.osv): 'active': lambda *a: 1, 'usage': lambda *a: 'internal', 'allocation_method': lambda *a: 'fifo', - 'chained_location_type': lambda *a: '', + 'chained_location_type': lambda *a: 'none', 'chained_auto_packing': lambda *a: 'manual', 'posx': lambda *a: 0, 'posy': lambda *a: 0, From aac96b549f3d59f4d1f480a3a36b2c22118084ee Mon Sep 17 00:00:00 2001 From: "hda@tinyerp.com" <> Date: Tue, 25 Nov 2008 12:37:40 +0530 Subject: [PATCH 015/160] remove prints bzr revid: hda@tinyerp.com-20081125070740-wxunzjfblfyu20bh --- bin/osv/fields.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/bin/osv/fields.py b/bin/osv/fields.py index d2d37eec55c..e2bb4a0b4ed 100644 --- a/bin/osv/fields.py +++ b/bin/osv/fields.py @@ -1,7 +1,7 @@ # -*- encoding: utf-8 -*- ############################################################################## # -# OpenERP, Open Source Management Solution +# OpenERP, Open Source Management Solution # Copyright (C) 2004-2008 Tiny SPRL (). All Rights Reserved # $Id$ # From 4f9320c9a712cad9692b8296874221c4f707f47d Mon Sep 17 00:00:00 2001 From: Stephane Wirtel Date: Tue, 25 Nov 2008 11:11:20 +0100 Subject: [PATCH 016/160] [FIX] Use triple quote to create the label bzr revid: stephane@tinyerp.com-20081125101120-7f70uvztk1w21zav --- bin/addons/base/ir/workflow/print_instance.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/bin/addons/base/ir/workflow/print_instance.py b/bin/addons/base/ir/workflow/print_instance.py index 826f753e594..c0d7847ffd1 100644 --- a/bin/addons/base/ir/workflow/print_instance.py +++ b/bin/addons/base/ir/workflow/print_instance.py @@ -38,7 +38,7 @@ def graph_get(cr, graph, wkf_id, nested=False, workitem={}): if n['subflow_id'] and nested: cr.execute('select * from wkf where id=%d', (n['subflow_id'],)) wkfinfo = cr.dictfetchone() - graph2 = pydot.Cluster('subflow'+str(n['subflow_id']), fontsize='12', label = "Subflow: "+n['name']+'\\nOSV: '+wkfinfo['osv']) + graph2 = pydot.Cluster('subflow'+str(n['subflow_id']), fontsize='12', label = """\"Subflow: %s\\nOSV: %s\"""" % ( n['name'], wkfinfo['osv']) ) (s1,s2) = graph_get(cr, graph2, n['subflow_id'], nested,workitem) graph.add_subgraph(graph2) actfrom[n['id']] = s2 From 008c0f0ee9a842b8f9b405f6e46c2ac78ae39412 Mon Sep 17 00:00:00 2001 From: Stephane Wirtel Date: Tue, 25 Nov 2008 11:35:00 +0100 Subject: [PATCH 017/160] [FIX] Use makedirs to create the directory for the file handler for the logging lp bug: https://launchpad.net/bugs/301865 fixed bzr revid: stephane@tinyerp.com-20081125103500-4txmseev1fp8m7vf --- bin/netsvc.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/bin/netsvc.py b/bin/netsvc.py index 81e73ced921..dd8a5046f74 100644 --- a/bin/netsvc.py +++ b/bin/netsvc.py @@ -28,6 +28,7 @@ import SimpleXMLRPCServer, signal, sys, xmlrpclib import SocketServer import socket import logging +import logging.handlers import os _service = {} @@ -153,6 +154,9 @@ def init_logger(): logf = config['logfile'] # test if the directories exist, else create them try: + dirname = os.path.dirname(logf) + if not os.path.isdir(dirname): + res = os.makedirs(dirname) handler = logging.handlers.TimedRotatingFileHandler(logf,'D',1,30) except: sys.stderr.write("ERROR: couldn't create the logfile directory\n") From be08323c6207f01f0d1f1c20ecc8ee14e4f7d790 Mon Sep 17 00:00:00 2001 From: Stephane Wirtel Date: Tue, 25 Nov 2008 12:25:22 +0100 Subject: [PATCH 018/160] [FIX] Remove the password for the dump and the restore of database bzr revid: stephane@tinyerp.com-20081125112522-iglichvetklo3hyv --- bin/service/web_services.py | 10 ---------- 1 file changed, 10 deletions(-) diff --git a/bin/service/web_services.py b/bin/service/web_services.py index 9128ca10a7d..2c6d2c1987c 100644 --- a/bin/service/web_services.py +++ b/bin/service/web_services.py @@ -163,11 +163,6 @@ class db(netsvc.Service): security.check_super(password) logger = netsvc.Logger() - if tools.config['db_password']: - logger.notifyChannel("web-service", netsvc.LOG_ERROR, - 'DUMP DB: %s doesn\'t work with password' % (db_name,)) - raise Exception, "Couldn't dump database with password" - cmd = ['pg_dump', '--format=c'] if tools.config['db_user']: cmd.append('--username=' + tools.config['db_user']) @@ -198,11 +193,6 @@ class db(netsvc.Service): 'RESTORE DB: %s already exists' % (db_name,)) raise Exception, "Database already exists" - if tools.config['db_password']: - logger.notifyChannel("web-service", netsvc.LOG_ERROR, - 'RESTORE DB: %s doesn\'t work with password' % (db_name,)) - raise Exception, "Couldn't restore database with password" - db = sql_db.db_connect('template1', serialize=1) db.truedb.autocommit() cr = db.cursor() From 07f8f4943d0e6d1b45e76498021f6b5ff8ed63dc Mon Sep 17 00:00:00 2001 From: Stephane Wirtel Date: Tue, 25 Nov 2008 12:43:00 +0100 Subject: [PATCH 019/160] [FIX] Use the logger for the message 'Address already in use' bzr revid: stephane@tinyerp.com-20081125114300-xb0cprmc9ked3pr5 --- bin/netsvc.py | 26 +++++++++----------------- 1 file changed, 9 insertions(+), 17 deletions(-) diff --git a/bin/netsvc.py b/bin/netsvc.py index dd8a5046f74..b84f5cecb68 100644 --- a/bin/netsvc.py +++ b/bin/netsvc.py @@ -275,24 +275,19 @@ class GenericXMLRPCRequestHandler: raise xmlrpclib.Fault(s, tb_s) -class SimpleXMLRPCRequestHandler(GenericXMLRPCRequestHandler, - SimpleXMLRPCServer.SimpleXMLRPCRequestHandler): +class SimpleXMLRPCRequestHandler(GenericXMLRPCRequestHandler, SimpleXMLRPCServer.SimpleXMLRPCRequestHandler): SimpleXMLRPCServer.SimpleXMLRPCRequestHandler.rpc_paths = get_rpc_paths() - -class SimpleThreadedXMLRPCServer(SocketServer.ThreadingMixIn, - SimpleXMLRPCServer.SimpleXMLRPCServer): +class SimpleThreadedXMLRPCServer(SocketServer.ThreadingMixIn, SimpleXMLRPCServer.SimpleXMLRPCServer): def server_bind(self): try: - self.socket.setsockopt(socket.SOL_SOCKET, - socket.SO_REUSEADDR, 1) + self.socket.setsockopt(socket.SOL_SOCKET, socket.SO_REUSEADDR, 1) SimpleXMLRPCServer.SimpleXMLRPCServer.server_bind(self) except: - sys.stderr.write("ERROR: address already in use\n") + Logger().notifyChannel('init', LOG_ERROR, 'Address already in use') sys.exit(1) - class HttpDaemon(threading.Thread): def __init__(self, interface, port, secure=False): @@ -302,22 +297,19 @@ class HttpDaemon(threading.Thread): self.secure = secure if secure: from ssl import SecureXMLRPCServer - class SecureXMLRPCRequestHandler(GenericXMLRPCRequestHandler, - SecureXMLRPCServer.SecureXMLRPCRequestHandler): - SecureXMLRPCServer.SecureXMLRPCRequestHandler.rpc_paths = get_rpc_paths() - class SecureThreadedXMLRPCServer(SocketServer.ThreadingMixIn, - SecureXMLRPCServer.SecureXMLRPCServer): + class SecureXMLRPCRequestHandler(GenericXMLRPCRequestHandler, SecureXMLRPCServer.SecureXMLRPCRequestHandler): + SecureXMLRPCServer.SecureXMLRPCRequestHandler.rpc_paths = get_rpc_paths() + + class SecureThreadedXMLRPCServer(SocketServer.ThreadingMixIn, SecureXMLRPCServer.SecureXMLRPCServer): def server_bind(self): try: - self.socket.setsockopt(socket.SOL_SOCKET, - socket.SO_REUSEADDR, 1) + self.socket.setsockopt(socket.SOL_SOCKET, socket.SO_REUSEADDR, 1) SecureXMLRPCServer.SecureXMLRPCServer.server_bind(self) except: sys.stderr.write("ERROR: address already in use\n") sys.exit(1) - self.server = SecureThreadedXMLRPCServer((interface, port), SecureXMLRPCRequestHandler, 0) else: From d0fcc9d7ec7b682fd5b8428f668e4a7fe9fb5ccc Mon Sep 17 00:00:00 2001 From: Stephane Wirtel Date: Tue, 25 Nov 2008 14:23:25 +0100 Subject: [PATCH 020/160] [FIX] Use the prefix specified by the user at the installation lp bug: https://launchpad.net/bugs/301561 fixed bzr revid: stephane@tinyerp.com-20081125132325-zhtz3nj34ejnn7vi --- setup.py | 24 ++++++++++++++---------- 1 file changed, 14 insertions(+), 10 deletions(-) diff --git a/setup.py b/setup.py index 129df517e59..3f177854dcd 100755 --- a/setup.py +++ b/setup.py @@ -35,7 +35,8 @@ import glob from stat import ST_MODE from distutils.core import setup, Command -from distutils.command.install_scripts import install_scripts +from distutils.command.install import install +#from distutils.command.install_scripts import install_scripts from distutils.file_util import copy_file if os.name == 'nt': @@ -147,15 +148,17 @@ def data_files(): check_modules() -# create startup script -start_script = \ -"#!/bin/sh\n\ -cd %s/lib/python%s/site-packages/openerp-server\n\ -exec %s ./openerp-server.py $@\n" % (sys.prefix, py_short_version, sys.executable) -# write script -f = open('openerp-server', 'w') -f.write(start_script) -f.close() + +class openerp_server_install(install): + def run(self): + # create startup script + start_script = "#!/bin/sh\ncd %s\nexec %s ./openerp-server.py $@\n" % (opj(self.install_libbase, "openerp-server"), sys.executable) + # write script + f = open('openerp-server', 'w') + f.write(start_script) + f.close() + + install.run(self) options = { "py2exe": { @@ -179,6 +182,7 @@ setup(name = name, classifiers = filter(None, classifiers.split("\n")), license = license, data_files = data_files(), + cmdclass = { 'install' : openerp_server_install }, scripts = ['openerp-server'], packages = ['openerp-server', 'openerp-server.addons', From 282147bca3dbf7b82b051070315041bf509390b5 Mon Sep 17 00:00:00 2001 From: Harshad Modi Date: Tue, 25 Nov 2008 18:57:44 +0530 Subject: [PATCH 021/160] pso's work on process data bzr revid: hmo@tinyerp.com-20081125132744-4mvhor10zzfrhly2 --- addons/account/__terp__.py | 3 +- .../process/customer_invoice_process.xml | 195 ++++++++++++++ addons/account/process/statement_process.xml | 81 +++--- .../process/supplier_invoice_process.xml | 175 ++++++++++++ addons/base_contact/__terp__.py | 5 +- .../process/base_contact_process.xml | 91 +++++++ .../process/crm_configuration_process.xml | 230 +++++++++------- addons/hr/process/hr_process.xml | 18 +- addons/hr_expense/__terp__.py | 1 + .../hr_expense/process/hr_expense_process.xml | 187 +++++++++++++ .../process/hr_holidays_process.xml | 162 ++++++++++- addons/membership/__terp__.py | 3 +- .../membership/process/membership_process.xml | 139 ++++++++++ addons/mrp/__terp__.py | 2 +- addons/mrp/process/procurement_process.xml | 226 ++++++++-------- addons/product/process/product_process.xml | 48 +--- addons/project/process/task_process.xml | 2 +- .../process/project_mrp_process.xml | 33 +-- addons/purchase/process/purchase_process.xml | 70 +++-- addons/sale/process/sale_process.xml | 251 ++++++++++-------- addons/sale_crm/process/sale_crm_process.xml | 56 +++- addons/stock/__terp__.py | 1 + addons/stock/process/stock_process.xml | 47 ++++ 23 files changed, 1529 insertions(+), 497 deletions(-) create mode 100644 addons/account/process/customer_invoice_process.xml create mode 100644 addons/account/process/supplier_invoice_process.xml create mode 100644 addons/base_contact/process/base_contact_process.xml create mode 100644 addons/hr_expense/process/hr_expense_process.xml create mode 100644 addons/membership/process/membership_process.xml create mode 100644 addons/stock/process/stock_process.xml diff --git a/addons/account/__terp__.py b/addons/account/__terp__.py index 40a4b2d1d5d..136731fbac6 100644 --- a/addons/account/__terp__.py +++ b/addons/account/__terp__.py @@ -59,7 +59,8 @@ "project/project_report.xml", "product_view.xml", "account_assert_test.xml", - "process/invoice_process.xml", + "process/customer_invoice_process.xml", + "process/supplier_invoice_process.xml", "process/statement_process.xml", ], "translations" : { diff --git a/addons/account/process/customer_invoice_process.xml b/addons/account/process/customer_invoice_process.xml new file mode 100644 index 00000000000..35878c77fd3 --- /dev/null +++ b/addons/account/process/customer_invoice_process.xml @@ -0,0 +1,195 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/addons/account/process/statement_process.xml b/addons/account/process/statement_process.xml index 3ee13ace8d5..89710174453 100644 --- a/addons/account/process/statement_process.xml +++ b/addons/account/process/statement_process.xml @@ -26,6 +26,17 @@ + + + + + + + + + + + @@ -43,47 +54,24 @@ - + - - - - - - - - - - - - + - + - - - - - - - - - - - - - - @@ -95,6 +83,15 @@ + + + + + + + + + @@ -110,28 +107,10 @@ - + - - - - - - - - - - - - - - - - - - @@ -141,9 +120,11 @@ - + + + diff --git a/addons/account/process/supplier_invoice_process.xml b/addons/account/process/supplier_invoice_process.xml new file mode 100644 index 00000000000..e43ee096ebc --- /dev/null +++ b/addons/account/process/supplier_invoice_process.xml @@ -0,0 +1,175 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/addons/base_contact/__terp__.py b/addons/base_contact/__terp__.py index b8a419e1ee9..581dfe8b26b 100644 --- a/addons/base_contact/__terp__.py +++ b/addons/base_contact/__terp__.py @@ -40,14 +40,15 @@ Pay attention that this module converts the existing addresses into "addresses + contacts". It means that some fields of the addresses will be missing (like the contact name), since these are supposed to be defined in an other object. """, - "depends" : ["base"], + "depends" : ["base", "process"], "init_xml" : [], "demo_xml" : [ "base_contact_demo.xml" ], "update_xml" : [ "security/ir.model.access.csv", - 'base_contact_view.xml' + 'base_contact_view.xml', + "process/base_contact_process.xml" ], "active": False, "installable": True diff --git a/addons/base_contact/process/base_contact_process.xml b/addons/base_contact/process/base_contact_process.xml new file mode 100644 index 00000000000..c446e91b104 --- /dev/null +++ b/addons/base_contact/process/base_contact_process.xml @@ -0,0 +1,91 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/addons/crm_configuration/process/crm_configuration_process.xml b/addons/crm_configuration/process/crm_configuration_process.xml index 84155528f92..2218610390e 100644 --- a/addons/crm_configuration/process/crm_configuration_process.xml +++ b/addons/crm_configuration/process/crm_configuration_process.xml @@ -1,106 +1,132 @@ - - - - + + + + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - - + + \ No newline at end of file diff --git a/addons/hr/process/hr_process.xml b/addons/hr/process/hr_process.xml index 1afb90f3020..5984ed7e924 100644 --- a/addons/hr/process/hr_process.xml +++ b/addons/hr/process/hr_process.xml @@ -17,9 +17,11 @@ --> + - + @@ -54,11 +56,20 @@ - + - + + + + + + + + + + @@ -76,7 +87,6 @@ - diff --git a/addons/hr_expense/__terp__.py b/addons/hr_expense/__terp__.py index 7787db5e235..1cb45d7cade 100644 --- a/addons/hr_expense/__terp__.py +++ b/addons/hr_expense/__terp__.py @@ -48,6 +48,7 @@ "hr_expense_workflow.xml", "hr_expense_view.xml", "hr_expense_report.xml", + "process/hr_expense_process.xml" ], "active": False, "installable": True diff --git a/addons/hr_expense/process/hr_expense_process.xml b/addons/hr_expense/process/hr_expense_process.xml new file mode 100644 index 00000000000..5a00f2dc646 --- /dev/null +++ b/addons/hr_expense/process/hr_expense_process.xml @@ -0,0 +1,187 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/addons/hr_holidays/process/hr_holidays_process.xml b/addons/hr_holidays/process/hr_holidays_process.xml index 4cbddc9c423..2cdb83885ab 100644 --- a/addons/hr_holidays/process/hr_holidays_process.xml +++ b/addons/hr_holidays/process/hr_holidays_process.xml @@ -2,43 +2,177 @@ - - + + + + + + + + + + + + + + + + + + + + + + - - - + + + + - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - + - + + + + + + + + + + + + + + - - - + + + - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/addons/membership/__terp__.py b/addons/membership/__terp__.py index 16172f9f2e4..8e80e24341e 100644 --- a/addons/membership/__terp__.py +++ b/addons/membership/__terp__.py @@ -36,7 +36,8 @@ ], "update_xml" : [ "security/ir.model.access.csv", - "membership_view.xml","membership_wizard.xml" + "membership_view.xml","membership_wizard.xml", + "process/membership_process.xml" ], "active" : False, "installable" : True, diff --git a/addons/membership/process/membership_process.xml b/addons/membership/process/membership_process.xml new file mode 100644 index 00000000000..5e4b9e0703b --- /dev/null +++ b/addons/membership/process/membership_process.xml @@ -0,0 +1,139 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/addons/mrp/__terp__.py b/addons/mrp/__terp__.py index 98c88413e3c..c76c82296d5 100644 --- a/addons/mrp/__terp__.py +++ b/addons/mrp/__terp__.py @@ -25,7 +25,7 @@ "author" : "Tiny", "website" : "http://tinyerp.com/module_mrp.html", "category" : "Generic Modules/Production", - "depends" : ["stock", "hr", "purchase", "product", "process"], + "depends" : ["stock", "hr", "purchase", "product"], "description": """ This is the base module to manage the manufacturing process in Tiny ERP. diff --git a/addons/mrp/process/procurement_process.xml b/addons/mrp/process/procurement_process.xml index 866ad784349..d05eb28eaef 100644 --- a/addons/mrp/process/procurement_process.xml +++ b/addons/mrp/process/procurement_process.xml @@ -15,6 +15,16 @@ Process Node --> + + + + + + + + + + @@ -25,26 +35,34 @@ - - - + + + - - + + - - - - - - - - - - + + + + + + + + + + + + + + + + + + @@ -80,40 +98,40 @@ - - - - - - - - - - - - + - - - - - - - - - - + + + + + + + + + + - - + + + + + + + + + + + + + @@ -126,7 +144,7 @@ - + @@ -152,8 +170,8 @@ - - + + @@ -164,14 +182,14 @@ - - + + - + @@ -183,6 +201,33 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + @@ -207,10 +252,10 @@ - + - + @@ -219,17 +264,7 @@ - - - - - - - - - - - + @@ -239,6 +274,15 @@ + + + + + + + + + @@ -247,22 +291,22 @@ - - + + - - - - + + + + - + - + @@ -273,19 +317,10 @@ - + - - - - - - - - - @@ -304,15 +339,6 @@ - - - - - - - - - @@ -335,34 +361,6 @@ Process Action --> - - - - - - - - - - - - - - - - - - - - - - - - - - - - @@ -404,6 +402,6 @@ - + \ No newline at end of file diff --git a/addons/product/process/product_process.xml b/addons/product/process/product_process.xml index d7e985eca7d..1264cf09f33 100644 --- a/addons/product/process/product_process.xml +++ b/addons/product/process/product_process.xml @@ -29,38 +29,16 @@ - + - - + + - - - - - - - - - - - - - - - - - - - - - - @@ -72,23 +50,5 @@ - - - - - - - - - - - - - - - - - - diff --git a/addons/project/process/task_process.xml b/addons/project/process/task_process.xml index f987ba07af3..c5179ff6e23 100644 --- a/addons/project/process/task_process.xml +++ b/addons/project/process/task_process.xml @@ -39,7 +39,7 @@ - + diff --git a/addons/project_mrp/process/project_mrp_process.xml b/addons/project_mrp/process/project_mrp_process.xml index 125d325f223..3d08bd11394 100644 --- a/addons/project_mrp/process/project_mrp_process.xml +++ b/addons/project_mrp/process/project_mrp_process.xml @@ -6,12 +6,12 @@ Process Node --> - + - - + + @@ -33,35 +33,24 @@ - - + + - - - - - - - - - - + - - - - + + + + @@ -79,7 +68,7 @@ - + diff --git a/addons/purchase/process/purchase_process.xml b/addons/purchase/process/purchase_process.xml index 23891fda515..0d17b36dc06 100644 --- a/addons/purchase/process/purchase_process.xml +++ b/addons/purchase/process/purchase_process.xml @@ -21,8 +21,8 @@ - - + + @@ -32,19 +32,30 @@ - - + + + + + + + + + + + + + - - + + @@ -54,8 +65,8 @@ - - + + @@ -65,8 +76,8 @@ - - + + @@ -77,8 +88,8 @@ - - + + @@ -88,14 +99,32 @@ - - + + - + + + + + + + + + + + + + + + + + @@ -122,6 +151,15 @@ + + + + + + + + + @@ -164,7 +202,7 @@ - + diff --git a/addons/sale/process/sale_process.xml b/addons/sale/process/sale_process.xml index 973c39ec2dc..231d1900ff7 100644 --- a/addons/sale/process/sale_process.xml +++ b/addons/sale/process/sale_process.xml @@ -1,161 +1,188 @@ - - - + - - + + - - - + - - - + + + - object.state=='draft' + - + - - - + + + - object.state in ('draft','waiting_date','manual','progress','shipping_except','invoice_except','done','cancel') + - + - - - + + + - object.state=='draft' - + + - - + + + - object.state in ('waiting_date','manual','progress') + + + + + + + + + + + + + - - + + + - object.state in ('assigned', 'confirmed') + + - - - + + + - object.state in ('done') + + - - - + + + + + - - - + + + + - - - object.order_policy=='postpaid' - + + - - - + - + - + - - + + - + - - + + - - + + - - - + + + + + + + + + + + - - + + - - + + @@ -163,103 +190,103 @@ - - + + - + - - + + - - + + - + - - + + - - - + - - - + + + - - - + + + - + - - - + + + - - - + + + - - - + + + - + - - - + + + - - - + + + - - - + + + - + - - - + + + - - - - - + + + + + - + diff --git a/addons/sale_crm/process/sale_crm_process.xml b/addons/sale_crm/process/sale_crm_process.xml index 6aaa146b250..307b1cfd618 100644 --- a/addons/sale_crm/process/sale_crm_process.xml +++ b/addons/sale_crm/process/sale_crm_process.xml @@ -2,25 +2,55 @@ - - - - - - + + + + + + + + - + - + + + + + + + + + + + + + + - - - - + + + + - + + + + + + + + + + + + \ No newline at end of file diff --git a/addons/stock/__terp__.py b/addons/stock/__terp__.py index d4a14976c2b..1937aad9428 100644 --- a/addons/stock/__terp__.py +++ b/addons/stock/__terp__.py @@ -42,6 +42,7 @@ "report_stock_view.xml", "security/stock_security.xml", "security/ir.model.access.csv", + "process/stock_process.xml" ], "active": False, "installable": True diff --git a/addons/stock/process/stock_process.xml b/addons/stock/process/stock_process.xml new file mode 100644 index 00000000000..aef4e3b89aa --- /dev/null +++ b/addons/stock/process/stock_process.xml @@ -0,0 +1,47 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file From fac5d5213a2550d6c48c4e12d6fa166062f2f4da Mon Sep 17 00:00:00 2001 From: Christophe Simonis Date: Tue, 25 Nov 2008 14:35:16 +0100 Subject: [PATCH 022/160] [FIX] document module: avoid exception when check non openerp databases lp bug: https://launchpad.net/bugs/301004 fixed bzr revid: christophe@tinyerp.com-20081125133516-78ivqrebot9pezuh --- addons/document/ftpserver/abstracted_fs.py | 26 +++++++++++++++------- 1 file changed, 18 insertions(+), 8 deletions(-) diff --git a/addons/document/ftpserver/abstracted_fs.py b/addons/document/ftpserver/abstracted_fs.py index fe624da7de4..6892a5f729d 100644 --- a/addons/document/ftpserver/abstracted_fs.py +++ b/addons/document/ftpserver/abstracted_fs.py @@ -68,15 +68,25 @@ class abstracted_fs: def db_list(self): s = netsvc.LocalService('db') result = s.list() - self.db_name_list=[] + self.db_name_list = [] for db_name in result: - db = pooler.get_db_only(db_name) - cr = db.cursor() - cr.execute("select id from ir_module_module where name like 'document%' and state='installed' ") - res=cr.fetchone() - if res and len(res): - self.db_name_list.append(db_name) - cr.close() + db, cr = None, None + try: + db = pooler.get_db_only(db_name) + cr = db.cursor() + cr.execute("SELECT 1 FROM pg_class WHERE relkind = 'r' AND relname = 'ir_module_module'") + if not cr.fetchone(): + continue + + cr.execute("select id from ir_module_module where name like 'document%' and state='installed' ") + res = cr.fetchone() + if res and len(res): + self.db_name_list.append(db_name) + finally: + if cr is not None: + cr.close() + if db is not None: + pooler.close_db(db_name) return self.db_name_list # Ok From 71885d3625495fbf197fbe0e181047d296f6804c Mon Sep 17 00:00:00 2001 From: "hda@tinyerp.com" <> Date: Tue, 25 Nov 2008 19:20:41 +0530 Subject: [PATCH 023/160] implement maintenance bzr revid: hda@tinyerp.com-20081125135041-peehjywthggx8ua9 --- bin/addons/base/__init__.py | 4 +- bin/addons/base/__terp__.py | 4 +- bin/addons/base/maintenance/__init__.py | 33 ++++++ bin/addons/base/maintenance/maintenance.py | 111 ++++++++++++++++++ .../base/maintenance/maintenance_security.xml | 14 +++ .../base/maintenance/maintenance_view.xml | 41 +++++++ bin/addons/base/security/ir.model.access.csv | 1 + 7 files changed, 205 insertions(+), 3 deletions(-) create mode 100755 bin/addons/base/maintenance/__init__.py create mode 100755 bin/addons/base/maintenance/maintenance.py create mode 100644 bin/addons/base/maintenance/maintenance_security.xml create mode 100755 bin/addons/base/maintenance/maintenance_view.xml diff --git a/bin/addons/base/__init__.py b/bin/addons/base/__init__.py index 777f0f5a371..0349891aa55 100644 --- a/bin/addons/base/__init__.py +++ b/bin/addons/base/__init__.py @@ -1,7 +1,7 @@ # -*- encoding: utf-8 -*- ############################################################################## # -# OpenERP, Open Source Management Solution +# OpenERP, Open Source Management Solution # Copyright (C) 2004-2008 Tiny SPRL (). All Rights Reserved # $Id$ # @@ -23,7 +23,7 @@ import ir import module import res - +import maintenance # vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4: diff --git a/bin/addons/base/__terp__.py b/bin/addons/base/__terp__.py index d1bd53f8252..380fb16c55c 100644 --- a/bin/addons/base/__terp__.py +++ b/bin/addons/base/__terp__.py @@ -1,7 +1,7 @@ # -*- encoding: utf-8 -*- ############################################################################## # -# OpenERP, Open Source Management Solution +# OpenERP, Open Source Management Solution # Copyright (C) 2004-2008 Tiny SPRL (). All Rights Reserved # $Id$ # @@ -32,6 +32,7 @@ "base_menu.xml", "security/base_security.xml", "res/res_security.xml", + "maintenance/maintenance_security.xml", ], "demo_xml" : [ "base_demo.xml", @@ -59,6 +60,7 @@ "res/partner/partner_data.xml", "res/ir_property_view.xml", "security/base_security.xml", + "maintenance/maintenance_view.xml", "security/ir.model.access.csv", ], "active": True, diff --git a/bin/addons/base/maintenance/__init__.py b/bin/addons/base/maintenance/__init__.py new file mode 100755 index 00000000000..876c0e1dc3c --- /dev/null +++ b/bin/addons/base/maintenance/__init__.py @@ -0,0 +1,33 @@ +# -*- encoding: utf-8 -*- +############################################################################## +# +# Copyright (c) 2004-2008 Tiny SPRL (http://tiny.be) All Rights Reserved. +# +# $Id$ +# +# WARNING: This program as such is intended to be used by professional +# programmers who take the whole responsability of assessing all potential +# consequences resulting from its eventual inadequacies and bugs +# End users who are looking for a ready-to-use solution with commercial +# garantees and support are strongly adviced to contract a Free Software +# Service Company +# +# 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 2 +# 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, write to the Free Software +# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. +############################################################################### + +import maintenance + +# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4: + diff --git a/bin/addons/base/maintenance/maintenance.py b/bin/addons/base/maintenance/maintenance.py new file mode 100755 index 00000000000..589bd18354c --- /dev/null +++ b/bin/addons/base/maintenance/maintenance.py @@ -0,0 +1,111 @@ +# -*- encoding: utf-8 -*- +############################################################################## +# +# Copyright (c) 2004-2008 TINY SPRL. (http://tiny.be) All Rights Reserved. +# +# $Id$ +# +# WARNING: This program as such is intended to be used by professional +# programmers who take the whole responsability of assessing all potential +# consequences resulting from its eventual inadequacies and bugs +# End users who are looking for a ready-to-use solution with commercial +# garantees and support are strongly adviced to contract a Free Software +# Service Company +# +# 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 2 +# 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, write to the Free Software +# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. +# +############################################################################## + +from osv import osv, fields +import pooler +import time +import math + +from tools import config +import xmlrpclib + +class maintenance_contract(osv.osv): + _name = "maintenance.contract" + _description = "Maintenance Contract" + _columns = { + 'name' : fields.char('Name', size=256), + 'contract_date' : fields.date('Date'), + 'password' : fields.char('password', size=64, invisible=True), + } + + _defaults = { + 'password' : lambda obj,cr,uid,context={} : '', + 'contract_date':lambda *a: time.strftime('%Y-%m-%d'), + } + def _test_maintenance(self, cr, uid, ids, context): + remote_db='trunk' + remote_server='localhost' + port=8069 + module_obj=self.pool.get('ir.module.module') + contract_obj=self.pool.get('maintenance.contract') + module_ids=module_obj.search(cr, uid, [('state','=','installed')]) + modules=module_obj.read(cr, uid, module_ids, ['name','installed_version']) + contract_obj=contract_obj.read(cr, uid, ids[0]) + local_url = 'http://%s:%d/xmlrpc/common'%(remote_server,port) + rpc = xmlrpclib.ServerProxy(local_url) + ruid = rpc.login(remote_db, 'admin', 'admin') + local_url = 'http://%s:%d/xmlrpc/object'%(remote_server,port) + rrpc = xmlrpclib.ServerProxy(local_url) + try: + result=rrpc.execute(remote_db, ruid, 'admin', 'maintenance.maintenance', 'check_contract' , modules,contract_obj) + except: + raise osv.except_osv(_('Maintenance Error !'),('''Module Maintenance_Editor is not installed at server : %s Database : %s'''%(remote_server,remote_db))) + if context.get('active_id',False): + if result['status']=='ko': + raise osv.except_osv(_('Maintenance Error !'),('''Maintenance Contract +----------------------------------------------------------- +You have no valid maintenance contract! If you are using +Open ERP, it is highly suggested to take maintenance contract. +The maintenance program offers you: +* Migrations on new versions, +* Bugfix guarantee, +* Monthly announces of bugs, +* Security alerts, +* Access to the customer portal. +* Check the maintenance contract (www.openerp.com)''')) + elif result['status']=='partial': + raise osv.except_osv(_('Maintenance Error !'),('''Maintenance Contract +----------------------------------------------------------- +You have a maintenance contract, But you installed modules those +are not covered by your maintenance contract: +'''+','.join(result['modules'])+''' +It means we can not offer you the garantee of maintenance on +your whole installation. +The maintenance program includes: +* Migrations on new versions, +* Bugfix guarantee, +* Monthly announces of bugs, +* Security alerts, +* Access to the customer portal. + +To include these modules in your maintenance contract, you should +extend your contract with the editor. We will review and validate +your installed modules. + +* Extend your maintenance to the modules you used. +* Check your maintenance contract''')) + else: + raise osv.except_osv(_('Valid Maintenance Contract !'),('''Your Maintenance Contract is up to date''')) + return result + +maintenance_contract() + +# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4: + diff --git a/bin/addons/base/maintenance/maintenance_security.xml b/bin/addons/base/maintenance/maintenance_security.xml new file mode 100644 index 00000000000..bb477595ddd --- /dev/null +++ b/bin/addons/base/maintenance/maintenance_security.xml @@ -0,0 +1,14 @@ + + + + + + Maintenance Manager + + + + + + + + diff --git a/bin/addons/base/maintenance/maintenance_view.xml b/bin/addons/base/maintenance/maintenance_view.xml new file mode 100755 index 00000000000..c79683de472 --- /dev/null +++ b/bin/addons/base/maintenance/maintenance_view.xml @@ -0,0 +1,41 @@ + + + + + + maintenance.contract.tree + maintenance.contract + tree + + + + + + + + + + maintenance.contract.form + maintenance.contract + form + +
+ + + +