[MERGE] fixing usability

bzr revid: hmo@tinyerp.com-20110426073805-x9e01349of6wu7du
This commit is contained in:
Harry (OpenERP) 2011-04-26 13:08:05 +05:30
commit 14cd38eaef
7 changed files with 18 additions and 17 deletions

View File

@ -196,13 +196,10 @@ class view_sc(osv.osv):
def get_sc(self, cr, uid, user_id, model='ir.ui.menu', context=None):
ids = self.search(cr, uid, [('user_id','=',user_id),('resource','=',model)], context=context)
results = self.read(cr, uid, ids, ['res_id'], context=context)
name_map = dict(self.pool.get(model).name_get(cr, uid, [x['res_id'] for x in results], context=context))
results = self.read(cr, uid, ids, ['res_id','name'], context=context)
available_menus = self.pool.get(model).search(cr, uid, [], context=context)
# Make sure to return only shortcuts pointing to exisintg menu items.
filtered_results = filter(lambda result: result['res_id'] in name_map, results)
for result in filtered_results:
result.update(name=name_map[result['res_id']])
return filtered_results
return filter(lambda result: result['res_id'] in available_menus, results)
_order = 'sequence,name'
_defaults = {

View File

@ -37,9 +37,10 @@
<field name="check_opw"/>
</group>
<group col="2" colspan="3">
<button name="check_validity" string="Validate" type="object"
<button name="check_validity" icon="camera_test.png
" string="Validate" type="object"
attrs="{'invisible':[('state','in',['valid', 'terminated', 'canceled'])]}"/>
<button name="check_validity" string="Refresh Validation Dates" type="object"
<button name="check_validity" icon="camera_test.png" string="Refresh Validation Dates" type="object"
attrs="{'invisible':[('state','in',['unvalidated'])]}"/>
</group>
</group>

View File

@ -25,7 +25,7 @@
<group colspan="2" col="2">
<field name="phone"/>
<field name="fax"/>
<field name="email"/>
<field name="email" widget="email"/>
</group>
</form>
</field>

View File

@ -112,15 +112,15 @@ class res_partner(osv.osv):
_columns = {
'name': fields.char('Name', size=128, required=True, select=True),
'date': fields.date('Date', select=1),
'title': fields.many2one('res.partner.title','Partner Form'),
'title': fields.many2one('res.partner.title','Partner Firm'),
'parent_id': fields.many2one('res.partner','Parent Partner'),
'child_ids': fields.one2many('res.partner', 'parent_id', 'Partner Ref.'),
'ref': fields.char('Reference', size=64, select=1),
'lang': fields.selection(_lang_get, 'Language', size=5, help="If the selected language is loaded in the system, all documents related to this partner will be printed in this language. If not, it will be english."),
'lang': fields.selection(_lang_get, 'Language', help="If the selected language is loaded in the system, all documents related to this partner will be printed in this language. If not, it will be english."),
'user_id': fields.many2one('res.users', 'Salesman', help='The internal user that is in charge of communicating with this partner if any.'),
'vat': fields.char('VAT',size=32 ,help="Value Added Tax number. Check the box if the partner is subjected to the VAT. Used by the VAT legal statement."),
'bank_ids': fields.one2many('res.partner.bank', 'partner_id', 'Banks'),
'website': fields.char('Website',size=64, help="Website of Partner"),
'website': fields.char('Website',size=64, help="Website of Partner."),
'comment': fields.text('Notes'),
'address': fields.one2many('res.partner.address', 'partner_id', 'Contacts'),
'category_id': fields.many2many('res.partner.category', 'res_partner_category_rel', 'partner_id', 'category_id', 'Categories'),

View File

@ -1,11 +1,11 @@
<?xml version="1.0" encoding="ISO-8859-1"?>
<addresses>
<address type="fields" name="id">
<company-title type="field" name="title"/>
<company-title type="field" name="title.name"/>
<company-name type="field" name="name"/>
<contact type="zoom" name="address">
<type type="field" name="type"/>
<title type="field" name="title"/>
<title type="field" name="title.name"/>
<name type="field" name="name"/>
<street type="field" name="street"/>
<street2 type="field" name="street2"/>

View File

@ -49,12 +49,12 @@ class res_currency(osv.osv):
_columns = {
# Note: 'code' column was removed as of v6.0, the 'name' should now hold the ISO code.
'name': fields.char('Currency', size=32, required=True, help="Currency Code (ISO 4217)"),
'symbol': fields.char('Symbol', size=3, help="Currency sign, to be used when printing amounts"),
'symbol': fields.char('Symbol', size=3, help="Currency sign, to be used when printing amounts."),
'rate': fields.function(_current_rate, method=True, string='Current Rate', digits=(12,6),
help='The rate of the currency to the currency of rate 1'),
help='The rate of the currency to the currency of rate 1.'),
'rate_ids': fields.one2many('res.currency.rate', 'currency_id', 'Rates'),
'accuracy': fields.integer('Computational Accuracy'),
'rounding': fields.float('Rounding factor', digits=(12,6)),
'rounding': fields.float('Rounding Factor', digits=(12,6)),
'active': fields.boolean('Active'),
'company_id':fields.many2one('res.company', 'Company'),
'date': fields.date('Date'),

View File

@ -12,6 +12,9 @@
<record model="ir.ui.menu" id="menu_base_config">
<field eval="[(6,0,[ref('group_system'), ref('group_partner_manager')])]" name="groups_id"/>
</record>
<record model="ir.ui.menu" id="menu_base_partner">
<field eval="[(6,0,[ref('group_partner_manager')])]" name="groups_id"/>
</record>
<!-- Record Rule For Company -->