[IMP] tidying up before merging in trunk.

bzr revid: vmt@openerp.com-20110706154001-r8y7w28yve2ca0ar
This commit is contained in:
Vo Minh Thu 2011-07-06 17:40:01 +02:00
parent a1e94494ec
commit 6c7f791f5d
6 changed files with 29 additions and 38 deletions

View File

@ -2,7 +2,7 @@
##############################################################################
#
# OpenERP, Open Source Management Solution
# Copyright (C) 2004-2009 Tiny SPRL (<http://tiny.be>).
# Copyright (C) 2004-2011 OpenERP S.A. <http://www.openerp.com>
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as
@ -832,12 +832,13 @@ class ir_actions_todo(osv.osv):
ondelete='cascade'),
'sequence': fields.integer('Sequence'),
'state': fields.selection(TODO_STATES, string='State', required=True),
'name':fields.char('Name', size=64),
'type': fields.selection([('special','Special'),('normal','Normal'),('normal_recurring','Normal Recurring')], 'Type', required=True, help="Special: that have to be run again on trigger (when someone select this application to be reconfigured)\
\nNormal: that will be displayed in the config panel and disappear as soon it's done\
\nNormal Recurring: that will be always displayed in the config panel regardless of it's state"),
'groups_id':fields.many2many('res.groups', 'res_groups_action_rel', 'uid', 'gid', 'Groups'),
'note':fields.text('Text', translate=True),
'name': fields.char('Name', size=64),
'type': fields.selection([('special','Special'),('normal','Normal'),('normal_recurring','Normal Recurring')], 'Type', required=True,
help="""Special: the wizard is run whenever the system is reconfigured.
Normal: the wizard is visible in the configuration panel until it is done.
Normal Recurring: the wizard is visible in the configuration panel regardless of its state."""),
'groups_id': fields.many2many('res.groups', 'res_groups_action_rel', 'uid', 'gid', 'Groups'),
'note': fields.text('Text', translate=True),
'category_id': fields.many2one('ir.actions.todo.category','Category'),
}
_defaults={
@ -856,7 +857,7 @@ class ir_actions_todo(osv.osv):
res = self.pool.get('ir.actions.act_window').read(cr, uid, wizard.action_id.id, [], context=context)
res.update({'nodestroy': True})
# Open Specific resouce when res_id is provided in context
# Open a specific record when res_id is provided in the context
if res.get('context'):
user = self.pool.get('res.users').browse(cr, uid, uid, context=context)
ctx = eval(res['context'], {'user': user})

View File

@ -2,7 +2,7 @@
##############################################################################
#
# OpenERP, Open Source Management Solution
# Copyright (C) 2004-2010 Tiny SPRL (<http://tiny.be>).
# Copyright (C) 2004-2011 OpenERP S.A. <http://www.openerp.com>
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as

View File

@ -25,12 +25,6 @@ import os
import tools
from tools.translate import _
from tools.safe_eval import safe_eval as eval
from lxml import etree
import tempfile
import pooler
import netsvc
from report import report_sxw
class multi_company_default(osv.osv):
"""
@ -80,7 +74,7 @@ class res_company(osv.osv):
_order = 'name'
def _get_address_data(self, cr, uid, ids, field_names, arg, context=None):
"Retrieves address data of the partner related to the company"
""" Read the 'address' functional fields. """
result = {}
part_obj = self.pool.get('res.partner')
address_obj = self.pool.get('res.partner.address')
@ -95,7 +89,7 @@ class res_company(osv.osv):
return result
def _set_address_data(self, cr, uid, company_id, name, value, arg, context=None):
"Set the address data of the partner related to the company"
""" Write the 'address' functional fields. """
company = self.browse(cr, uid, company_id, context=context)
if company.partner_id:
part_obj = self.pool.get('res.partner')
@ -116,22 +110,22 @@ class res_company(osv.osv):
'rml_header1': fields.char('Report Header', size=200),
'rml_footer1': fields.char('Report Footer 1', size=200),
'rml_footer2': fields.char('Report Footer 2', size=200),
'rml_header' : fields.text('RML Header', required=True),
'rml_header2' : fields.text('RML Internal Header', required=True),
'rml_header3' : fields.text('RML Internal Header', required=True),
'logo' : fields.binary('Logo'),
'rml_header': fields.text('RML Header', required=True),
'rml_header2': fields.text('RML Internal Header', required=True),
'rml_header3': fields.text('RML Internal Header', required=True),
'logo': fields.binary('Logo'),
'currency_id': fields.many2one('res.currency', 'Currency', required=True),
'currency_ids': fields.one2many('res.currency', 'company_id', 'Currency'),
'user_ids': fields.many2many('res.users', 'res_company_users_rel', 'cid', 'user_id', 'Accepted Users'),
'account_no':fields.char('Account No.', size=64),
'street' : fields.function(_get_address_data, fnct_inv=_set_address_data, size=128, type='char', string="Street", multi='address'),
'street2' : fields.function(_get_address_data, fnct_inv=_set_address_data, size=128, type='char', string="Street2", multi='address'),
'zip' : fields.function(_get_address_data, fnct_inv=_set_address_data, size=24, type='char', string="Zip", multi='address'),
'city' : fields.function(_get_address_data, fnct_inv=_set_address_data, size=24, type='char', string="City", multi='address'),
'state_id' : fields.function(_get_address_data, fnct_inv=_set_address_data, type='many2one', domain="[('country_id', '=', country_id)]", relation='res.country.state', string="State", multi='address'),
'country_id' : fields.function(_get_address_data, fnct_inv=_set_address_data, type='many2one', relation='res.country', string="Country", multi='address'),
'email' : fields.function(_get_address_data, fnct_inv=_set_address_data, size=64, type='char', string="Email", multi='address'),
'phone' : fields.function(_get_address_data, fnct_inv=_set_address_data, size=64, type='char', string="Phone", multi='address'),
'street': fields.function(_get_address_data, fnct_inv=_set_address_data, size=128, type='char', string="Street", multi='address'),
'street2': fields.function(_get_address_data, fnct_inv=_set_address_data, size=128, type='char', string="Street2", multi='address'),
'zip': fields.function(_get_address_data, fnct_inv=_set_address_data, size=24, type='char', string="Zip", multi='address'),
'city': fields.function(_get_address_data, fnct_inv=_set_address_data, size=24, type='char', string="City", multi='address'),
'state_id': fields.function(_get_address_data, fnct_inv=_set_address_data, type='many2one', domain="[('country_id', '=', country_id)]", relation='res.country.state', string="State", multi='address'),
'country_id': fields.function(_get_address_data, fnct_inv=_set_address_data, type='many2one', relation='res.country', string="Country", multi='address'),
'email': fields.function(_get_address_data, fnct_inv=_set_address_data, size=64, type='char', string="Email", multi='address'),
'phone': fields.function(_get_address_data, fnct_inv=_set_address_data, size=64, type='char', string="Phone", multi='address'),
}
def _search(self, cr, uid, args, offset=0, limit=None, order=None,

View File

@ -77,8 +77,9 @@ class res_config_configurable(osv.osv_memory):
dont_skip_todo = bool(cr.fetchone())
if dont_skip_todo:
res = todos.browse(cr, uid, active_todos[0], context=None)
# Wizards that directly opens a form stays in Todo state even if its called,
# as next_action is not called, so, setting state as done 'manually'
# A wizard opening directly a form instead of calling
# next_action will remain in the todo state so we set it to
# done ourselves.
if res.action_id.target == 'current':
res.write({'state': 'done'})
return res

View File

@ -79,10 +79,6 @@ class res_currency(osv.osv):
return res
def name_get(self, cr, uid, ids, context=None):
if context is None:
context = {}
# We can use the following line,if we want to restrict this name_get for company setup only
# But, its better to show currencies as name(Code).
if not ids:
return []
if isinstance(ids, (int, long)):

View File

@ -240,14 +240,13 @@ class users(osv.osv):
'company_ids':fields.many2many('res.company','res_company_users_rel','user_id','cid','Companies'),
'context_lang': fields.selection(_lang_get, 'Language', required=True,
help="Sets default language for the all user interface, when UI "
"translations are available. If you want to Add new Language, you can add it from 'Load an Official Translation' wizard from 'Administration' menu."),
help="The default language used in the graphical user interface, when translations are available. To add a new language, you can use the 'Load an Official Translation' wizard available from the 'Administration' menu."),
'context_tz': fields.selection(_tz_get, 'Timezone', size=64,
help="The user's timezone, used to perform timezone conversions "
"between the server and the client."),
'view': fields.function(_get_interface_type, method=True, type='selection', fnct_inv=_set_interface_type,
selection=[('simple','Simplified'),('extended','Extended')],
string='Interface', help="If you use OpenERP for the first time we strongly advise you to select the simplified interface, which has less features but is easier. You can always switch later from the users preferences."),
string='Interface', help="OpenERP offers a simplified and an extended user interface. If you use OpenERP for the first time we strongly advise you to select the simplified interface, which has less features but is easier to use. You can switch to the other interface from the User/Preferences menu at any time."),
'user_email': fields.function(_email_get, method=True, fnct_inv=_email_set, string='Email', type="char", size=240),
'menu_tips': fields.boolean('Menu Tips', help="Check out this box if you want to always display tips on each menu action"),
'date': fields.datetime('Last Connection', readonly=True),