[MERGE] Forward-port of 7.0 bugfixes up to 63ea0df73ffd6bf659b2ef29cdc3d3387bec92ac
authorDenis Ledoux <dle@odoo.com>
Mon, 16 Jun 2014 15:37:10 +0000 (17:37 +0200)
committerDenis Ledoux <dle@odoo.com>
Mon, 16 Jun 2014 15:37:10 +0000 (17:37 +0200)
1  2 
addons/account/account_invoice.py
addons/event/report/report_event_registration.py
addons/hr/hr.py
addons/hr/hr_view.xml
addons/hr_holidays/hr_holidays.py
addons/mail/mail_message.py
addons/web/static/src/js/formats.js
addons/web/static/src/js/view_list_editable.js
openerp/osv/fields.py
openerp/osv/orm.py

Simple merge
@@@ -31,8 -36,8 +31,8 @@@ class report_event_registration(osv.osv
          'event_id': fields.many2one('event.event', 'Event', required=True),
          'draft_state': fields.integer(' # No of Draft Registrations', size=20),
          'confirm_state': fields.integer(' # No of Confirmed Registrations', size=20),
 -        'register_max': fields.integer('Maximum Registrations'),
 +        'seats_max': fields.integer('Max Seats'),
-         'nbevent': fields.integer('Number Of Events'),
+         'nbevent': fields.integer('Number of Registrations'),
          'event_type': fields.many2one('event.type', 'Event Type'),
          'registration_state': fields.selection([('draft', 'Draft'), ('confirm', 'Confirmed'), ('done', 'Attended'), ('cancel', 'Cancelled')], 'Registration State', readonly=True, required=True),
          'event_state': fields.selection([('draft', 'Draft'), ('confirm', 'Confirmed'), ('done', 'Done'), ('cancel', 'Cancelled')], 'Event State', readonly=True, required=True),
                  r.user_id AS user_id_registration,
                  r.name AS name_registration,
                  e.company_id AS company_id,
 -                e.main_speaker_id AS speaker_id,
 -                to_char(e.date_begin, 'YYYY-MM-DD') AS event_date,
 -                to_char(e.date_begin, 'YYYY') AS year,
 -                to_char(e.date_begin, 'MM') AS month,
 +                e.date_begin AS event_date,
-                 count(e.id) AS nbevent,
+                 count(r.id) AS nbevent,
                  CASE WHEN r.state IN ('draft') THEN r.nb_register ELSE 0 END AS draft_state,
                  CASE WHEN r.state IN ('open','done') THEN r.nb_register ELSE 0 END AS confirm_state,
                  e.type AS event_type,
diff --cc addons/hr/hr.py
Simple merge
                              <page string="Public Information">
                                  <group>
                                      <group string="Contact Information">
-                                         <field name="address_id" on_change="onchange_address_id(address_id)" context="{'show_address': 1}" options='{"always_reload": True, "highlight_first_line": True}'/>
+                                         <field name="address_id" on_change="onchange_address_id(address_id)"
+                                             context="{'show_address': 1, 'default_customer': False}"
+                                             options='{"always_reload": True, "highlight_first_line": True}'/>
 -                                        <field name="work_email" widget="email"/>
 -                                        <field name="work_phone"/>
                                          <field name="mobile_phone"/>
                                          <field name="work_location"/>
                                      </group>
Simple merge
@@@ -965,24 -868,29 +965,26 @@@ class mail_message(osv.Model)
          """
          notification_obj = self.pool.get('mail.notification')
          message = self.browse(cr, uid, newid, context=context)
 -
          partners_to_notify = set([])
 -        # message has no subtype_id: pure log message -> no partners, no one notified
 -        if not message.subtype_id:
 -            return True
  
 -        # all followers of the mail.message document have to be added as partners and notified
 -        if message.model and message.res_id:
 +        # all followers of the mail.message document have to be added as partners and notified if a subtype is defined (otherwise: log message)
 +        if message.subtype_id and message.model and message.res_id:
              fol_obj = self.pool.get("mail.followers")
              # browse as SUPERUSER because rules could restrict the search results
 -            fol_ids = fol_obj.search(cr, SUPERUSER_ID, [
 -                ('res_model', '=', message.model),
 -                ('res_id', '=', message.res_id),
 +            fol_ids = fol_obj.search(
 +                cr, SUPERUSER_ID, [
 +                    ('res_model', '=', message.model),
 +                    ('res_id', '=', message.res_id),
-                     ('subtype_ids', 'in', message.subtype_id.id)
                  ], context=context)
-             partners_to_notify |= set(fo.partner_id.id for fo in fol_obj.browse(cr, SUPERUSER_ID, fol_ids, context=context))
+             partners_to_notify |= set(
+                 fo.partner_id for fo in fol_obj.browse(cr, SUPERUSER_ID, fol_ids, context=context)
+                 if message.subtype_id.id in [st.id for st in fo.subtype_ids]
+             )
          # remove me from notified partners, unless the message is written on my own wall
 -        if message.author_id and message.model == "res.partner" and message.res_id == message.author_id.id:
 -            partners_to_notify |= set([message.author_id])
 +        if message.subtype_id and message.author_id and message.model == "res.partner" and message.res_id == message.author_id.id:
 +            partners_to_notify |= set([message.author_id.id])
          elif message.author_id:
 -            partners_to_notify -= set([message.author_id])
 +            partners_to_notify -= set([message.author_id.id])
  
          # all partner_ids of the mail.message have to be notified regardless of the above (even the author if explicitly added!)
          if message.partner_ids:
Simple merge
Simple merge
Simple merge