[Merge]Merge branch lp:~openerp-dev/openobject-addons/trunk-improve-addons30-psa

bzr revid: vja@tinyerp.com-20121213053404-a697ixc367ja3vqz
This commit is contained in:
Vishmita 2012-12-13 11:04:04 +05:30
commit 3f82deec47
4 changed files with 11 additions and 8 deletions

View File

@ -165,7 +165,7 @@ class account_voucher(osv.osv):
if not ids:
return []
if context is None: context = {}
return [(r['id'], (str("%.2f" % r['amount']) or '')) for r in self.read(cr, uid, ids, ['amount'], context, load='_classic_write')]
return [(r['id'], (r['number']) or '') for r in self.read(cr, uid, ids, ['number'], context, load='_classic_write')]
def fields_view_get(self, cr, uid, view_id=None, view_type=False, context=None, toolbar=False, submenu=False):
mod_obj = self.pool.get('ir.model.data')

View File

@ -165,9 +165,9 @@
</header>
<sheet>
<label for="employee_id" class="oe_edit_only"/>
<h1><field name="employee_id" on_change="onchange_employee_id(employee_id)" class="oe_inline"/>, <field name="date" class="oe_inline"/></h1>
<h1><field name="employee_id" attrs="{'readonly': [('state','=','done')]}" on_change="onchange_employee_id(employee_id)" class="oe_inline"/>, <field name="date" class="oe_inline" attrs="{'readonly': [('state', '=', 'done')]}"/></h1>
<label for="plan_id" class="oe_edit_only"/>
<h2><field name="plan_id"/></h2>
<h2><field name="plan_id" attrs="{'readonly': [('state','=','done')]}"/></h2>
<group>
<group colspan="4" attrs="{'invisible':['|', ('state','=','draft'), ('state', '=', 'wait')]}">
<field name="rating" attrs="{'readonly':[('state','&lt;&gt;','progress')]}"/>
@ -175,7 +175,7 @@
</group>
</group>
<group string="Appraisal Forms" attrs="{'invisible':[('state','=','draft')]}">
<field nolabel="1" name="survey_request_ids">
<field nolabel="1" name="survey_request_ids" attrs="{'readonly': [('state','=','done')]}">
<form string="Interview Appraisal" version="7.0">
<div class="oe_right oe_button_box">
<button name="%(survey.action_view_survey_question_message)d" string="Answer Survey" type="action" states="waiting_answer" icon="gtk-execute" context="{'survey_id': survey_id, 'response_id': [response], 'response_no':0, 'active' : response,'request' : True, 'object' : 'hr.evaluation.interview', 'cur_id' : active_id}" attrs="{'readonly':[('survey_id','=',False)]}"/>

View File

@ -64,19 +64,21 @@ class mail_notification(osv.Model):
'read': fields.boolean('Read', select=1),
'starred': fields.boolean('Starred', select=1,
help='Starred message that goes into the todo mailbox'),
'date': fields.date('Date'),
'message_id': fields.many2one('mail.message', string='Message',
ondelete='cascade', required=True, select=1),
}
_defaults = {
'read': False,
'date': lambda *a: fields.datetime.now(),
'starred': False,
}
def init(self, cr):
cr.execute('SELECT indexname FROM pg_indexes WHERE indexname = %s', ('mail_notification_partner_id_read_starred_message_id',))
cr.execute('SELECT indexname FROM pg_indexes WHERE indexname = %s', ('mail_notification_partner_id_read_starred_date_message_id',))
if not cr.fetchone():
cr.execute('CREATE INDEX mail_notification_partner_id_read_starred_message_id ON mail_notification (partner_id, read, starred, message_id)')
cr.execute('CREATE INDEX mail_notification_partner_id_read_starred_date_message_id ON mail_notification (partner_id, read, starred, date, message_id)')
def create(self, cr, uid, vals, context=None):
""" Override of create to check that we can not create a notification

View File

@ -44,6 +44,7 @@
<field name="priority">10</field>
<field name="arch" type="xml">
<tree string="Notifications">
<field name="date"/>
<field name="partner_id"/>
<field name="message_id"/>
</tree>
@ -66,11 +67,11 @@
<!-- Add followers related menu entries in Settings/Email -->
<menuitem name="Followers" id="menu_email_followers" parent="base.menu_email"
action="action_view_followers" sequence="30" groups="base.group_no_one"/> -->
action="action_view_followers" sequence="30" groups="base.group_no_one"/>
<!-- Add notifications related menu entry in Settings/Email -->
<menuitem name="Notifications" id="menu_email_notifications" parent="base.menu_email"
action="action_view_notifications" sequence="35" groups="base.group_no_one"/>
action="action_view_notifications" sequence="13" groups="base.group_no_one"/>
</data>
</openerp>