From 17ac0408cd3c9dc2d14e76642e82e1fea4df907f Mon Sep 17 00:00:00 2001 From: Priyesh Date: Wed, 22 Oct 2008 19:05:41 +0530 Subject: [PATCH 01/12] process files bzr revid: solanki.priyesh@gmail.com-20081022133541-0nyssffgvka9pco3 --- addons/.project | 17 +++ addons/crm_configuration/__terp__.py | 4 +- .../process/crm_configuration_process.xml | 113 ++++++++++++++++++ addons/document/__terp__.py | 3 +- addons/document/process/document_process.xml | 25 ++++ addons/hr/__terp__.py | 3 +- addons/hr/process/hr_process.xml | 84 +++++++++++++ addons/hr_holidays/__terp__.py | 2 +- .../process/hr_holidays_process.xml | 45 +++++++ addons/hr_timesheet_project/__terp__.py | 2 +- addons/sale_crm/__terp__.py | 6 +- addons/sale_crm/process/sale_crm_process.xml | 26 ++++ 12 files changed, 322 insertions(+), 8 deletions(-) create mode 100644 addons/.project create mode 100644 addons/crm_configuration/process/crm_configuration_process.xml create mode 100644 addons/document/process/document_process.xml create mode 100644 addons/hr/process/hr_process.xml create mode 100644 addons/hr_holidays/process/hr_holidays_process.xml create mode 100644 addons/sale_crm/process/sale_crm_process.xml diff --git a/addons/.project b/addons/.project new file mode 100644 index 00000000000..8fc3cc934ff --- /dev/null +++ b/addons/.project @@ -0,0 +1,17 @@ + + + pso-newaddons + + + + + + org.python.pydev.PyDevBuilder + + + + + + org.python.pydev.pythonNature + + diff --git a/addons/crm_configuration/__terp__.py b/addons/crm_configuration/__terp__.py index 1e5653dba61..0f6ccf2cabf 100644 --- a/addons/crm_configuration/__terp__.py +++ b/addons/crm_configuration/__terp__.py @@ -9,7 +9,7 @@ people to intelligently and efficiently manage tasks, issues, and requests. It manages key tasks such as communication, identification, prioritization, assignment, resolution and notification.""", - "depends" : ["crm","report_crm", "process"], + "depends" : ["crm","report_crm", "process", "account"], "init_xml" : [ "crm_config_view.xml", "crm_bugs_view.xml", @@ -40,7 +40,7 @@ "crm_helpdesk_menu.xml", "crm_lead_menu.xml", "crm_meeting_menu.xml", "security/ir.model.access.csv", -# "process/crm_configuration_process.xml", + "process/crm_configuration_process.xml", ], "active": False, "installable": True diff --git a/addons/crm_configuration/process/crm_configuration_process.xml b/addons/crm_configuration/process/crm_configuration_process.xml new file mode 100644 index 00000000000..b7fa5202017 --- /dev/null +++ b/addons/crm_configuration/process/crm_configuration_process.xml @@ -0,0 +1,113 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/addons/document/__terp__.py b/addons/document/__terp__.py index 94abf642361..aafdbebdb1a 100644 --- a/addons/document/__terp__.py +++ b/addons/document/__terp__.py @@ -12,12 +12,13 @@ * User Authentification * Document Indexation """, - "depends" : ["base", "process"], + "depends" : ["base", "process", "hr"], "init_xml" : ["document_data.xml"], "update_xml" : [ "document_view.xml", "security/document_security.xml", "security/ir.model.access.csv", + "process/document_process.xml" ], "demo_xml" : ["document_demo.xml"], "active": False, diff --git a/addons/document/process/document_process.xml b/addons/document/process/document_process.xml new file mode 100644 index 00000000000..3c37c793ab4 --- /dev/null +++ b/addons/document/process/document_process.xml @@ -0,0 +1,25 @@ + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/addons/hr/__terp__.py b/addons/hr/__terp__.py index 7da1af96772..1e5c9ff7e12 100644 --- a/addons/hr/__terp__.py +++ b/addons/hr/__terp__.py @@ -40,7 +40,7 @@ Different reports are also provided, mainly for attendance statistics. """, - "depends" : ["base", "process"], + "depends" : ["base", "crm_configuration", "process"], "init_xml" : [], "demo_xml" : [ "hr_demo.xml", @@ -52,6 +52,7 @@ "hr_view.xml", "hr_wizard.xml", "hr_department_view.xml", + "process/hr_process.xml" ], "active": False, "installable": True diff --git a/addons/hr/process/hr_process.xml b/addons/hr/process/hr_process.xml new file mode 100644 index 00000000000..bfb0ad21f2a --- /dev/null +++ b/addons/hr/process/hr_process.xml @@ -0,0 +1,84 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/addons/hr_holidays/__terp__.py b/addons/hr_holidays/__terp__.py index 6f3188d6acf..982b5624c19 100644 --- a/addons/hr_holidays/__terp__.py +++ b/addons/hr_holidays/__terp__.py @@ -32,7 +32,7 @@ "hr_view.xml", "hr_holidays_report.xml", "hr_holidays_wizard.xml", -# "process/hr_holidays_process.xml" + "process/hr_holidays_process.xml" ], # "demo_xml" : ["hr_bel_holidays_2008.xml",], "demo_xml" : [], diff --git a/addons/hr_holidays/process/hr_holidays_process.xml b/addons/hr_holidays/process/hr_holidays_process.xml new file mode 100644 index 00000000000..4cbddc9c423 --- /dev/null +++ b/addons/hr_holidays/process/hr_holidays_process.xml @@ -0,0 +1,45 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/addons/hr_timesheet_project/__terp__.py b/addons/hr_timesheet_project/__terp__.py index 0e41dbc8420..e3c24de5ea0 100644 --- a/addons/hr_timesheet_project/__terp__.py +++ b/addons/hr_timesheet_project/__terp__.py @@ -35,7 +35,7 @@ "website" : "http://tinyerp.com/module_hr.html", "depends" : ["project", "hr_timesheet_sheet"], "update_xml" : ["hr_timesheet_project_view.xml", -# "process/hr_timesheet_project_process.xml", + "process/hr_timesheet_project_process.xml", ], "active": False, "installable": True diff --git a/addons/sale_crm/__terp__.py b/addons/sale_crm/__terp__.py index abb4374837d..c66bd1f2e6e 100644 --- a/addons/sale_crm/__terp__.py +++ b/addons/sale_crm/__terp__.py @@ -4,7 +4,7 @@ "version" : "1.0", "author" : "Tiny", "website" : "http://tinyerp.com/module_sale.html", - "depends" : ["sale", "crm", "product", "account"], + "depends" : ["sale", "crm_configuration", "product", "account"], "category" : "Generic Modules/Sales & Purchases", "description": """ This module adds a shortcut on one or several cases in the CRM. @@ -18,7 +18,9 @@ """, "init_xml" : [], "demo_xml" : [], - "update_xml" : ["sale_crm_wizard.xml"], + "update_xml" : ["sale_crm_wizard.xml", + "process/sale_crm_process.xml" + ], "active": False, "installable": True } diff --git a/addons/sale_crm/process/sale_crm_process.xml b/addons/sale_crm/process/sale_crm_process.xml new file mode 100644 index 00000000000..6aaa146b250 --- /dev/null +++ b/addons/sale_crm/process/sale_crm_process.xml @@ -0,0 +1,26 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file From d8ea3c99d9bb33606c24b943e5df6bdd0f7f84b5 Mon Sep 17 00:00:00 2001 From: "hda@tinyerp.com" <> Date: Fri, 24 Oct 2008 16:11:31 +0530 Subject: [PATCH 03/12] Added fearutes tab in module bzr revid: hda@tinyerp.com-20081024104131-zirn6p2mu806a1o6 --- bin/addons/base/module/module.py | 63 ++++++++++++++++++++++++++ bin/addons/base/module/module_view.xml | 33 +++++++++----- 2 files changed, 85 insertions(+), 11 deletions(-) diff --git a/bin/addons/base/module/module.py b/bin/addons/base/module/module.py index 836a6a3ed7d..ff821818144 100644 --- a/bin/addons/base/module/module.py +++ b/bin/addons/base/module/module.py @@ -219,6 +219,65 @@ class module(osv.osv): res[m.id] = '' return res + def _get_menus(self, cr, uid, ids, field_name=None, arg=None, context={}): + res = {} + model_data_obj = self.pool.get('ir.model.data') + menu_obj = self.pool.get('ir.ui.menu') + for m in self.browse(cr, uid, ids): + if m.state == 'installed': + menu_txt = '' + menus_id = model_data_obj.search(cr,uid,[('module','=',m.name),('model','=','ir.ui.menu')]) + for data_id in model_data_obj.browse(cr,uid,menus_id): + menu_txt += menu_obj.browse(cr,uid,data_id.res_id).complete_name + '\n' + res[m.id] = menu_txt + else: + res[m.id] = '' + return res + + def _get_reports(self, cr, uid, ids, field_name=None, arg=None, context={}): + res = {} + model_data_obj = self.pool.get('ir.model.data') + report_obj = self.pool.get('ir.actions.report.xml') + for m in self.browse(cr, uid, ids): + if m.state == 'installed': + report_txt = '' + report_id = model_data_obj.search(cr,uid,[('module','=',m.name),('model','=','ir.actions.report.xml')]) + for data_id in model_data_obj.browse(cr,uid,report_id): + report_txt += report_obj.browse(cr,uid,data_id.res_id).name + '\n' + res[m.id] = report_txt + else: + res[m.id] = '' + return res + + def _get_views(self, cr, uid, ids, field_name=None, arg=None, context={}): + res = {} + model_data_obj = self.pool.get('ir.model.data') + view_obj = self.pool.get('ir.ui.view') + for m in self.browse(cr, uid, ids): + if m.state == 'installed': + view_txt = '' + view_id = model_data_obj.search(cr,uid,[('module','=',m.name),('model','=','ir.ui.view')]) + for data_id in model_data_obj.browse(cr,uid,view_id): + view_txt += view_obj.browse(cr,uid,data_id.res_id).name + '\n' + res[m.id] = view_txt + else: + res[m.id] = '' + return res + + def _get_objects(self, cr, uid, ids, field_name=None, arg=None, context={}): + res = {} + model_data_obj=self.pool.get('ir.model.data') + for m in self.browse(cr, uid, ids): + if m.state=='installed': + cr.execute('''select distinct model from ir_model_data where module = '%s' '''%(m.name)) + objects = cr.fetchall() + obj_lst=map(lambda x:x[0],objects) + res[m.id] = '\n'.join(obj_lst) + else: + res[m.id] = '' + return res + + _columns = { 'name': fields.char("Name", size=128, readonly=True, required=True), 'category_id': fields.many2one('ir.module.category', 'Category', readonly=True), @@ -245,6 +304,10 @@ class module(osv.osv): 'license': fields.selection([('GPL-2', 'GPL-2'),('GPL-3', 'GPL-3'), ('Other proprietary', 'Other proprietary')], string='License', readonly=True), + 'menus_by_module': fields.function(_get_menus, method=True, string='Menus', type='text'), + 'reports_by_module': fields.function(_get_reports, method=True, string='Reports', type='text'), + 'views_by_module': fields.function(_get_views, method=True, string='Views', type='text'), + 'objects_by_module': fields.function(_get_objects, method=True, string='Objects', type='text'), } _defaults = { diff --git a/bin/addons/base/module/module_view.xml b/bin/addons/base/module/module_view.xml index dfec0514bd7..38e4da4f9aa 100644 --- a/bin/addons/base/module/module_view.xml +++ b/bin/addons/base/module/module_view.xml @@ -1,9 +1,9 @@ - + - + ir.module.category.form ir.module.category @@ -16,7 +16,7 @@ - + ir.module.category.tree ir.module.category @@ -36,9 +36,9 @@ [('parent_id','=',False)] - + - + Modules ir.module.module @@ -53,10 +53,10 @@ - - + + - + ir.module.module.form ir.module.module @@ -95,6 +95,17 @@ + + + + + + + + + + + @@ -123,7 +134,7 @@ - + Installed modules ir.module.module @@ -148,7 +159,7 @@ [('state','in', ['to upgrade', 'to remove', 'to install'])] - + ir.module.repository.form ir.module.repository @@ -183,7 +194,7 @@ tree,form {'active_test': False} - + From 6b87952e2314ab44428cdda04eb17b0ead4c5e7d Mon Sep 17 00:00:00 2001 From: Fabien Pinckaers Date: Fri, 24 Oct 2008 16:47:33 +0200 Subject: [PATCH 04/12] bugfix bzr revid: fp@tinyerp.com-20081024144733-qxsdkum4c8arcb5a --- bin/addons/base/ir/ir.xml | 2 -- bin/addons/base/res/partner/partner_view.xml | 5 +++++ bin/addons/base/res/res_currency.py | 6 ++++-- bin/osv/orm.py | 3 +-- 4 files changed, 10 insertions(+), 6 deletions(-) diff --git a/bin/addons/base/ir/ir.xml b/bin/addons/base/ir/ir.xml index f4130da55a4..aa45e0fcd6d 100644 --- a/bin/addons/base/ir/ir.xml +++ b/bin/addons/base/ir/ir.xml @@ -663,7 +663,6 @@ - @@ -742,7 +741,6 @@ - diff --git a/bin/addons/base/res/partner/partner_view.xml b/bin/addons/base/res/partner/partner_view.xml index f53362107cd..1146d019426 100644 --- a/bin/addons/base/res/partner/partner_view.xml +++ b/bin/addons/base/res/partner/partner_view.xml @@ -527,5 +527,10 @@ + + diff --git a/bin/addons/base/res/res_currency.py b/bin/addons/base/res/res_currency.py index 909d8b1785b..0eb1befb599 100644 --- a/bin/addons/base/res/res_currency.py +++ b/bin/addons/base/res/res_currency.py @@ -79,7 +79,7 @@ class res_currency(osv.osv): def is_zero(self, cr, uid, currency, amount): return abs(self.round(cr, uid, currency, amount)) < currency.rounding - def compute(self, cr, uid, from_currency_id, to_currency_id, from_amount, round=True, context={}, account=None): + def compute(self, cr, uid, from_currency_id, to_currency_id, from_amount, round=True, context={}, account=None, account_invert=False): if not from_currency_id: from_currency_id = to_currency_id xc=self.browse(cr, uid, [from_currency_id,to_currency_id], context=context) @@ -100,8 +100,10 @@ class res_currency(osv.osv): cr.execute('select sum(debit-credit),sum(amount_currency) from account_move_line l ' \ 'where l.currency_id=%d and l.account_id=%d and '+q, (account.currency_id.id,account.id,)) tot1,tot2 = cr.fetchone() - if tot2: + if tot2 and not account_invert: rate = float(tot1)/float(tot2) + elif tot1 and account_invert: + rate = float(tot2)/float(tot1) if to_currency_id==from_currency_id: if round: return self.round(cr, uid, to_currency, from_amount) diff --git a/bin/osv/orm.py b/bin/osv/orm.py index 56a97a285bc..5480dab817c 100644 --- a/bin/osv/orm.py +++ b/bin/osv/orm.py @@ -1542,6 +1542,7 @@ class orm(orm_template): def __init__(self, cr): super(orm, self).__init__(cr) + self._columns = self._columns.copy() f = filter(lambda a: isinstance(self._columns[a], fields.function) and self._columns[a].store, self._columns) if f: list_store = [] @@ -1587,8 +1588,6 @@ class orm(orm_template): 'translate': (field['translate']), #'select': int(field['select_level']) } - #if field['relation']: - # attrs['relation'] = field['relation'] if field['ttype'] == 'selection': self._columns[field['name']] = getattr(fields, field['ttype'])(eval(field['selection']), **attrs) elif field['ttype'] == 'many2one': From be2fe6fe1e93d1d5217b978798c8db8ac0075066 Mon Sep 17 00:00:00 2001 From: Christophe Simonis Date: Fri, 24 Oct 2008 17:07:43 +0200 Subject: [PATCH 05/12] fix bug with language update when upgrading a module + PEP8 bzr revid: christophe@tinyerp.com-20081024150743-4u8iolu21xhi0a2r --- bin/addons/base/module/module.py | 8 ++++---- .../module/wizard/wizard_module_upgrade.py | 19 ++++++------------- 2 files changed, 10 insertions(+), 17 deletions(-) diff --git a/bin/addons/base/module/module.py b/bin/addons/base/module/module.py index ff821818144..c581ee1620d 100644 --- a/bin/addons/base/module/module.py +++ b/bin/addons/base/module/module.py @@ -604,9 +604,9 @@ class module(osv.osv): if not filter_lang: pool = pooler.get_pool(cr.dbname) - lang_obj=pool.get('res.lang') - lang_ids=lang_obj.search(cr, uid, [('translatable', '=', True)]) - filter_lang= [lang.code for lang in lang_obj.browse(cr, uid, lang_ids)] + lang_obj = pool.get('res.lang') + lang_ids = lang_obj.search(cr, uid, [('translatable', '=', True)]) + filter_lang = [lang.code for lang in lang_obj.browse(cr, uid, lang_ids)] elif not isinstance(filter_lang, (list, tuple)): filter_lang = [filter_lang] @@ -617,7 +617,7 @@ class module(osv.osv): for lang in filter_lang: f = os.path.join(tools.config['addons_path'], mod.name, 'i18n', lang + '.po') if os.path.exists(f): - logger.notifyChannel("init", netsvc.LOG_INFO, 'addons %s: loading translation file for language %s' % (mod.name, lang)) + logger.notifyChannel("init", netsvc.LOG_INFO, 'addon %s: loading translation file for language %s' % (mod.name, lang)) tools.trans_load(cr.dbname, f, lang, verbose=False) module() diff --git a/bin/addons/base/module/wizard/wizard_module_upgrade.py b/bin/addons/base/module/wizard/wizard_module_upgrade.py index 15a0195b151..2839048a050 100644 --- a/bin/addons/base/module/wizard/wizard_module_upgrade.py +++ b/bin/addons/base/module/wizard/wizard_module_upgrade.py @@ -87,26 +87,19 @@ class wizard_info_get(wizard.interface): db, pool = pooler.get_db_and_pool(cr.dbname) cr = db.cursor() mod_obj = pool.get('ir.module.module') - ids = mod_obj.search(cr, uid, [ - ('state', 'in', ['to upgrade', 'to remove', 'to install'])]) - unmet_packages=[] + ids = mod_obj.search(cr, uid, [('state', 'in', ['to upgrade', 'to remove', 'to install'])]) + unmet_packages = [] mod_dep_obj = pool.get('ir.module.module.dependency') - for mod in mod_obj.browse(cr,uid,ids): - depends_mod_ids=mod_dep_obj.search(cr,uid,[('module_id','=',mod.id)]) - for dep_mod in mod_dep_obj.browse(cr,uid,depends_mod_ids): + for mod in mod_obj.browse(cr, uid, ids): + depends_mod_ids = mod_dep_obj.search(cr, uid, [('module_id', '=', mod.id)]) + for dep_mod in mod_dep_obj.browse(cr, uid, depends_mod_ids): if dep_mod.state in ('unknown','uninstalled'): unmet_packages.append(dep_mod.name) if len(unmet_packages): - raise wizard.except_wizard('Unmet dependency !','Following modules are uninstalled or unknown. \n\n'+'\n'.join(unmet_packages)) + raise wizard.except_wizard('Unmet dependency !', 'Following modules are uninstalled or unknown. \n\n'+'\n'.join(unmet_packages)) mod_obj.download(cr, uid, ids, context=context) cr.commit() db, pool = pooler.restart_pool(cr.dbname, update_module=True) - - # Update translations for all installed languages - cr = db.cursor() - modobj = pool.get('ir.module.module') - mids = modobj.search(cr, uid, [('state', '=', 'installed')]) - modobj.update_translations(cr, uid, mids, None) return {} def _config(self, cr, uid, data, context=None): From d5e50a5159409c248d00233708b75e932054fc6b Mon Sep 17 00:00:00 2001 From: Fabien Pinckaers Date: Sat, 25 Oct 2008 10:53:56 +0200 Subject: [PATCH 06/12] improvement bzr revid: fp@tinyerp.com-20081025085356-9ezz9r2qj6q52a3r --- bin/addons/base/module/module.py | 2 +- bin/osv/fields.py | 8 +++++++- bin/osv/orm.py | 1 + 3 files changed, 9 insertions(+), 2 deletions(-) diff --git a/bin/addons/base/module/module.py b/bin/addons/base/module/module.py index c581ee1620d..e3793a298d6 100644 --- a/bin/addons/base/module/module.py +++ b/bin/addons/base/module/module.py @@ -373,7 +373,7 @@ class module(osv.osv): m.state not in ('uninstalled','uninstallable','to remove')''', (module.name,)) res = cr.fetchall() if res: - raise orm.except_orm(_('Error'), _('The module you are trying to remove depends on installed modules :\n %s') % '\n'.join(map(lambda x: '\t%s: %s' % (x[0], x[1]), res))) + raise orm.except_orm(_('Error'), _('Some installed modules depends on the module you plan to desinstall :\n %s') % '\n'.join(map(lambda x: '\t%s: %s' % (x[0], x[1]), res))) self.write(cr, uid, ids, {'state': 'to remove'}) return True diff --git a/bin/osv/fields.py b/bin/osv/fields.py index 38f6f569bd9..e03f76b3541 100644 --- a/bin/osv/fields.py +++ b/bin/osv/fields.py @@ -124,6 +124,12 @@ class boolean(_column): _symbol_set = (_symbol_c, _symbol_f) +class integer_big(_column): + _type = 'integer_big' + _symbol_c = '%d' + _symbol_f = lambda x: int(x or 0) + _symbol_set = (_symbol_c, _symbol_f) + class integer(_column): _type = 'integer' _symbol_c = '%d' @@ -675,7 +681,7 @@ class related(function): where += " %s.%s %s '%%%s%%' and" % (obj_child._table, self._arg[i], context[0][1], context[0][2]) if field_detail[1] in ('date'): where += " %s.%s %s '%s' and" % (obj_child._table, self._arg[i], context[0][1], context[0][2]) - if field_detail[1] in ['integer', 'long', 'float']: + if field_detail[1] in ['integer', 'long', 'float','integer_big']: where += " %s.%s %s '%d' and" % (obj_child._table, self._arg[i], context[0][1], context[0][2]) query += where.rstrip('and') cr.execute(query) diff --git a/bin/osv/orm.py b/bin/osv/orm.py index 5480dab817c..f65c9183b20 100644 --- a/bin/osv/orm.py +++ b/bin/osv/orm.py @@ -244,6 +244,7 @@ def get_pg_type(f): type_dict = { fields.boolean: 'bool', fields.integer: 'int4', + fields.integer_big: 'int8', fields.text: 'text', fields.date: 'date', fields.time: 'time', From bb73b0aa2256a4f557c8a58d6c6490508b47ab11 Mon Sep 17 00:00:00 2001 From: Fabien Pinckaers Date: Sat, 25 Oct 2008 12:11:07 +0200 Subject: [PATCH 07/12] improve_view bzr revid: fp@tinyerp.com-20081025101107-0g1yshfqaxoiu5an --- addons/warning/warning.py | 18 ++++++------- addons/warning/warning_view.xml | 46 ++++++++++++++++++--------------- 2 files changed, 34 insertions(+), 30 deletions(-) diff --git a/addons/warning/warning.py b/addons/warning/warning.py index be2c3f74ca1..fb7a91de9ec 100644 --- a/addons/warning/warning.py +++ b/addons/warning/warning.py @@ -35,13 +35,13 @@ class res_partner(osv.osv): _inherit = 'res.partner' _columns = { 'sale_warn' : fields.boolean('Sale Order'), - 'sale_warn_msg' : fields.char('Message for Sale Order', size=64), + 'sale_warn_msg' : fields.text('Message for Sale Order'), 'purchase_warn' : fields.boolean('Purchase Order'), - 'purchase_warn_msg' : fields.char('Message for Purchase Order', size=64), + 'purchase_warn_msg' : fields.text('Message for Purchase Order'), 'picking_warn' : fields.boolean('Stock Picking'), - 'picking_warn_msg' : fields.char('Message for Stock Picking', size=64), + 'picking_warn_msg' : fields.text('Message for Stock Picking'), 'invoice_warn' : fields.boolean('Invoice'), - 'invoice_warn_msg' : fields.char('Message for Invoice', size=64), + 'invoice_warn_msg' : fields.text('Message for Invoice'), } res_partner() @@ -131,11 +131,11 @@ stock_picking() class product_product(osv.osv): _inherit = 'product.product' _columns = { - 'sale_line_warn' : fields.boolean('Sale Order Line'), - 'sale_line_warn_msg' : fields.char('Message for Sale Order Line', size=64), - 'purchase_line_warn' : fields.boolean('Purchase Order Line'), - 'purchase_line_warn_msg' : fields.char('Message for Purchase Order Line', size=64), - } + 'sale_line_warn' : fields.boolean('Sale Order Line'), + 'sale_line_warn_msg' : fields.text('Message for Sale Order Line'), + 'purchase_line_warn' : fields.boolean('Purchase Order Line'), + 'purchase_line_warn_msg' : fields.text('Message for Purchase Order Line'), + } product_product() class sale_order_line(osv.osv): diff --git a/addons/warning/warning_view.xml b/addons/warning/warning_view.xml index 769ddc8d5d2..2adba29c996 100644 --- a/addons/warning/warning_view.xml +++ b/addons/warning/warning_view.xml @@ -1,30 +1,32 @@ - + res.partner.warning.form.inherit res.partner form - - - - - - - - - - - - + + + + + + + + + + + + + + + - - + product.warning.form.inherit product.product @@ -32,15 +34,17 @@ - - - - - + + + + + + + - + From 9c2a0f9007bcaffcf4c44a4c0935f95a3a9956c8 Mon Sep 17 00:00:00 2001 From: Fabien Pinckaers Date: Mon, 27 Oct 2008 08:23:22 +0100 Subject: [PATCH 08/12] bugfix bzr revid: fp@tinyerp.com-20081027072322-p9w06dejvb1c83xq --- addons/stock/stock.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/addons/stock/stock.py b/addons/stock/stock.py index 5718c344e4d..3cc80113a17 100644 --- a/addons/stock/stock.py +++ b/addons/stock/stock.py @@ -612,6 +612,9 @@ class stock_picking(osv.osv): continue payment_term_id = False partner = picking.address_id and picking.address_id.partner_id + raise osv.except_osv(_('Error, no partner !'), + _('Please put a partner on the picking list if you want to generate invoice.')) + if type in ('out_invoice', 'out_refund'): account_id = partner.property_account_receivable.id if picking.sale_id and picking.sale_id.payment_term: From a2ed84fe237f0abcc2441150475e74440ba806e8 Mon Sep 17 00:00:00 2001 From: Fabien Pinckaers Date: Mon, 27 Oct 2008 10:27:57 +0100 Subject: [PATCH 09/12] bugfix_paid_invoices bzr revid: fp@tinyerp.com-20081027092757-u1cehp9yc9tpvhb4 --- addons/account/invoice.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/addons/account/invoice.py b/addons/account/invoice.py index 8e236c6879c..ed9a62703df 100644 --- a/addons/account/invoice.py +++ b/addons/account/invoice.py @@ -194,7 +194,7 @@ class account_invoice(osv.osv): 'journal_id': fields.many2one('account.journal', 'Journal', required=True,readonly=True, states={'draft':[('readonly',False)]}), 'company_id': fields.many2one('res.company', 'Company', required=True), 'check_total': fields.float('Total', digits=(16,2), states={'open':[('readonly',True)],'close':[('readonly',True)]}), - 'reconciled': fields.function(_reconciled, method=True, string='Paid/Reconciled', type='boolean', help="The account moves of the invoice have been reconciled with account moves of the payment(s)."), + 'reconciled': fields.function(_reconciled, method=True, string='Paid/Reconciled', type='boolean', store=True, help="The account moves of the invoice have been reconciled with account moves of the payment(s)."), 'partner_bank': fields.many2one('res.partner.bank', 'Bank Account', help='The bank account to pay to or to be paid from'), 'move_lines':fields.function(_get_lines , method=True,type='many2many' , relation='account.move.line',string='Move Lines'), From 632cb94c244f9e63cc76aea7309de4041583b0d8 Mon Sep 17 00:00:00 2001 From: Fabien Pinckaers Date: Mon, 27 Oct 2008 10:48:02 +0100 Subject: [PATCH 10/12] tooltip_analytic bzr revid: fp@tinyerp.com-20081027094802-xt9dt17h9m08yc3k --- .../account_analytic_analysis.py | 32 +++++++++---------- addons/project/project_view.xml | 5 ++- 2 files changed, 18 insertions(+), 19 deletions(-) diff --git a/addons/account_analytic_analysis/account_analytic_analysis.py b/addons/account_analytic_analysis/account_analytic_analysis.py index 15db30b6a4b..e460c2872b4 100644 --- a/addons/account_analytic_analysis/account_analytic_analysis.py +++ b/addons/account_analytic_analysis/account_analytic_analysis.py @@ -407,22 +407,22 @@ class account_analytic_account(osv.osv): return res _columns ={ - 'ca_invoiced': fields.function(_ca_invoiced_calc, method=True, type='float', string='Invoiced amount'), - 'total_cost': fields.function(_total_cost_calc, method=True, type='float', string='Total cost'), - 'ca_to_invoice': fields.function(_ca_to_invoice_calc, method=True, type='float', string='Uninvoiced amount'), - 'ca_theorical': fields.function(_ca_theorical_calc, method=True, type='float', string='Theorical revenue'), - 'hours_quantity': fields.function(_hours_quantity_calc, method=True, type='float', string='Hours tot'), - 'last_invoice_date': fields.function(_last_invoice_date_calc, method=True, type='date', string='Last invoice date'), - 'last_worked_invoiced_date': fields.function(_last_worked_invoiced_date_calc, method=True, type='date', string='Last invoiced worked date'), - 'last_worked_date': fields.function(_last_worked_date_calc, method=True, type='date', string='Last worked date'), - 'hours_qtt_non_invoiced': fields.function(_hours_qtt_non_invoiced_calc, method=True, type='float', string='Uninvoiced hours'), - 'hours_qtt_invoiced': fields.function(_hours_qtt_invoiced_calc, method=True, type='float', string='Invoiced hours'), - 'remaining_hours': fields.function(_remaining_hours_calc, method=True, type='float', string='Remaining hours'), - 'remaining_ca': fields.function(_remaining_ca_calc, method=True, type='float', string='Remaining revenue'), - 'revenue_per_hour': fields.function(_revenue_per_hour_calc, method=True, type='float', string='Revenue per hours (real)'), - 'real_margin': fields.function(_real_margin_calc, method=True, type='float', string='Real margin'), - 'theorical_margin': fields.function(_theorical_margin_calc, method=True, type='float', string='Theorical margin'), - 'real_margin_rate': fields.function(_real_margin_rate_calc, method=True, type='float', string='Real margin rate (%)'), + 'ca_invoiced': fields.function(_ca_invoiced_calc, method=True, type='float', string='Invoiced Amount', help="Total customer invoiced amount for this account."), + 'total_cost': fields.function(_total_cost_calc, method=True, type='float', string='Total Costs', help="Total of costs for this account. It includes real costs (from invoices) and indirect costs, like time spent on timesheets."), + 'ca_to_invoice': fields.function(_ca_to_invoice_calc, method=True, type='float', string='Uninvoiced Amount', help="If invoice from analytic account, the remaining amount you can invoice to the customer based on the total costs."), + 'ca_theorical': fields.function(_ca_theorical_calc, method=True, type='float', string='Theorical Revenue', help="Based on the costs you had on the project, what would have been the revenue of all these costs have been invoiced at the normal sale price provided by the pricelist."), + 'hours_quantity': fields.function(_hours_quantity_calc, method=True, type='float', string='Hours Tot', help="Number of hours on spent on the analytic account (from timesheet). It computes on all journal of type 'general'."), + 'last_invoice_date': fields.function(_last_invoice_date_calc, method=True, type='date', string='Last Invoice Date', help="Date of the last invoice created for this analytic account."), + 'last_worked_invoiced_date': fields.function(_last_worked_invoiced_date_calc, method=True, type='date', string='Last Invoiced Worked Date', help="If invoice from the costs, this is the date of the latest work or cost that have been invoiced."), + 'last_worked_date': fields.function(_last_worked_date_calc, method=True, type='date', string='Last Worked Date', help="Date of the latest work done on this account."), + 'hours_qtt_non_invoiced': fields.function(_hours_qtt_non_invoiced_calc, method=True, type='float', string='Uninvoiced Hours', help="Number of hours (from journal of type 'general') that can be invoiced if you invoice based on analytic account."), + 'hours_qtt_invoiced': fields.function(_hours_qtt_invoiced_calc, method=True, type='float', string='Invoiced Hours', help="Number of hours that already have invoiced. If you don't invoice based on costs, it's the number of hours spent. If you invoice based on hours, it's the hours that have been invoiced."), + 'remaining_hours': fields.function(_remaining_hours_calc, method=True, type='float', string='Remaining Hours', help="Computed using the forumla: Maximum Quantity - Hours Tot."), + 'remaining_ca': fields.function(_remaining_ca_calc, method=True, type='float', string='Remaining Revenue', help="If you invoice based on costs, this is the revenue you will invoice to the customer when you will launch the invoicing wizard."), + 'revenue_per_hour': fields.function(_revenue_per_hour_calc, method=True, type='float', string='Revenue per Hours (real)', help="Computed using the formula: Invoiced Amount / Hours Tot."), + 'real_margin': fields.function(_real_margin_calc, method=True, type='float', string='Real Margin', help="Computed using the formula: Invoiced Amount - Total Costs."), + 'theorical_margin': fields.function(_theorical_margin_calc, method=True, type='float', string='Theorical Margin', help="Computed using the formula: (Theorical Revenue / Total Costs) * 100."), + 'real_margin_rate': fields.function(_real_margin_rate_calc, method=True, type='float', string='Real Margin Rate (%)', help="Computes using the formula: (Invoiced Amount / Total Costs) * 100."), 'month_ids': fields.function(_month, method=True, type='many2many', relation='account_analytic_analysis.summary.month', string='Month'), 'user_ids': fields.function(_user, method=True, type="many2many", relation='account_analytic_analysis.summary.user', string='User'), } diff --git a/addons/project/project_view.xml b/addons/project/project_view.xml index 12f9a17491f..e25836c21c9 100644 --- a/addons/project/project_view.xml +++ b/addons/project/project_view.xml @@ -119,14 +119,13 @@ - Template projects + Template of Projects project.project form [('state','=','template')] - - + New Project From 2a3886ad8db740696f4188264a37d07fa1862404 Mon Sep 17 00:00:00 2001 From: Fabien Pinckaers Date: Mon, 27 Oct 2008 10:59:15 +0100 Subject: [PATCH 11/12] bugfix bzr revid: fp@tinyerp.com-20081027095915-09h3vgie0as5pqn6 --- .../account_analytic_analysis_view.xml | 2 +- addons/project/project_view.xml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/addons/account_analytic_analysis/account_analytic_analysis_view.xml b/addons/account_analytic_analysis/account_analytic_analysis_view.xml index fb4a3d774d2..748b4b53201 100644 --- a/addons/account_analytic_analysis/account_analytic_analysis_view.xml +++ b/addons/account_analytic_analysis/account_analytic_analysis_view.xml @@ -46,7 +46,7 @@ - + diff --git a/addons/project/project_view.xml b/addons/project/project_view.xml index e25836c21c9..edbabad208d 100644 --- a/addons/project/project_view.xml +++ b/addons/project/project_view.xml @@ -125,7 +125,7 @@ [('state','=','template')] - + New Project From b53ac077ce17b1b9000378292c3761f20a418ec7 Mon Sep 17 00:00:00 2001 From: Fabien Pinckaers Date: Mon, 27 Oct 2008 11:03:15 +0100 Subject: [PATCH 12/12] bugfix bzr revid: fp@tinyerp.com-20081027100315-ci2dsyssngiy2k0z --- .../account_analytic_analysis_menu.xml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/addons/account_analytic_analysis/account_analytic_analysis_menu.xml b/addons/account_analytic_analysis/account_analytic_analysis_menu.xml index 77eedf9f8f6..fc953b9d74c 100644 --- a/addons/account_analytic_analysis/account_analytic_analysis_menu.xml +++ b/addons/account_analytic_analysis/account_analytic_analysis_menu.xml @@ -74,7 +74,7 @@ [('state','=','draft')] - + Open Analytic Accounts @@ -85,7 +85,7 @@ [('state','=','open')] - + Pending Analytic Accounts @@ -96,7 +96,7 @@ [('state','=','pending')] - + Simplified View Analytic Accounts @@ -107,7 +107,7 @@ [] - +