[FIX] user preferences: fix company_id on_change warning and move to correct view

bzr revid: odo@openerp.com-20101028162852-kwqgwe24ga490xuk
This commit is contained in:
Olivier Dony
2010-10-28 18:28:52 +02:00
parent 950987e2fb
commit da52ec0579
2 changed files with 6 additions and 5 deletions
+2 -2
View File
@@ -79,7 +79,8 @@
<notebook colspan="4">
<page string="Current Activity">
<field name="company_id" widget="selection" readonly="0"
context="{'user_id': self, 'user_preference': 1}" groups="base.group_multi_company"/>
context="{'user_id': self, 'user_preference': 1}" groups="base.group_multi_company"
on_change="on_change_company_id(company_id)" />
<field name="view" readonly="0"/>
<label string="" colspan="2"/>
<separator string="Default Filters" colspan="4"/>
@@ -118,7 +119,6 @@
<separator string="Contact" colspan="2"/>
<field name="company_id" required="1"
context="{'user_id': self, 'user_preference': 1}"
on_change="on_change_company_id(company_id)"
groups="base.group_multi_company"
/>
<field name="address_id"/>
+4 -3
View File
@@ -234,9 +234,10 @@ class users(osv.osv):
def on_change_company_id(self, cr, uid, ids, company_id):
return {
'value': {
'warning' : _("Please keep in mind that data currently displayed may not be relevant after switching to another company. If you have unsaved changes, please make sure to save and close the forms before switching to a different company (you can click on Cancel now)"),
}
'warning' : {
'title': _("Company Switch Warning"),
'message': _("Please keep in mind that documents currently displayed may not be relevant after switching to another company. If you have unsaved changes, please make sure to save and close all forms before switching to a different company. (You can click on Cancel in the User Preferences now)"),
}
}
def read(self,cr, uid, ids, fields=None, context=None, load='_classic_read'):