[MERGE] forward port of branch saas-1 up to revid 8772 chs@openerp.com-20130910122113...
authorChristophe Simonis <chs@openerp.com>
Tue, 10 Sep 2013 12:48:03 +0000 (14:48 +0200)
committerChristophe Simonis <chs@openerp.com>
Tue, 10 Sep 2013 12:48:03 +0000 (14:48 +0200)
bzr revid: chs@openerp.com-20130910124803-wxkb8gkz1tub5qjf

24 files changed:
1  2 
addons/account/account.py
addons/account/account_invoice.py
addons/account/account_invoice_view.xml
addons/analytic/analytic.py
addons/base_calendar/base_calendar.py
addons/crm/crm.py
addons/crm/crm_lead.py
addons/email_template/email_template.py
addons/hr_expense/hr_expense.py
addons/hr_recruitment/hr_recruitment.py
addons/mail/mail_group.py
addons/mail/res_users.py
addons/membership/membership_view.xml
addons/mrp/mrp.py
addons/mrp/mrp_view.xml
addons/point_of_sale/point_of_sale.py
addons/point_of_sale/static/src/js/devices.js
addons/product/pricelist.py
addons/product/product.py
addons/product/product_view.xml
addons/project/project.py
addons/project_mrp/process/project_mrp_process.xml
addons/purchase/partner.py
addons/stock/stock.py

Simple merge
Simple merge
Simple merge
Simple merge
@@@ -160,19 -126,18 +160,19 @@@ class crm_case_section(osv.osv)
          'note': fields.text('Description'),
          'working_hours': fields.float('Working Hours', digits=(16, 2)),
          'stage_ids': fields.many2many('crm.case.stage', 'section_stage_rel', 'section_id', 'stage_id', 'Stages'),
-         'alias_id': fields.many2one('mail.alias', 'Alias', ondelete="cascade", required=True,
+         'alias_id': fields.many2one('mail.alias', 'Alias', ondelete="restrict", required=True,
                                      help="The email address associated with this team. New emails received will automatically "
                                           "create new leads assigned to the team."),
 -        'open_lead_ids': fields.one2many('crm.lead', 'section_id',
 -            string='Open Leads', readonly=True,
 -            domain=['&', ('type', '!=', 'opportunity'), ('state', 'not in', ['done', 'cancel'])]),
 -        'open_opportunity_ids': fields.one2many('crm.lead', 'section_id',
 -            string='Open Opportunities', readonly=True,
 -            domain=['&', '|', ('type', '=', 'opportunity'), ('type', '=', 'both'), ('state', 'not in', ['done', 'cancel'])]),
          'color': fields.integer('Color Index'),
          'use_leads': fields.boolean('Leads',
 -            help="This enables the management of leads in the sales team. Otherwise the sales team manages only opportunities."),
 +            help="The first contact you get with a potential customer is a lead you qualify before converting it into a real business opportunity. Check this box to manage leads in this sales team."),
 +
 +        'monthly_open_leads': fields.function(_get_opportunities_data,
 +            type="string", readonly=True, multi='_get_opportunities_data',
 +            string='Open Leads per Month'),
 +        'monthly_planned_revenue': fields.function(_get_opportunities_data,
 +            type="string", readonly=True, multi='_get_opportunities_data',
 +            string='Planned Revenue per Month')
      }
  
      def _get_stage_common(self, cr, uid, context):
Simple merge
Simple merge
Simple merge
@@@ -36,10 -34,9 +36,10 @@@ class res_users(osv.Model)
      _inherits = {'mail.alias': 'alias_id'}
  
      _columns = {
-         'alias_id': fields.many2one('mail.alias', 'Alias', ondelete="cascade", required=True,
+         'alias_id': fields.many2one('mail.alias', 'Alias', ondelete="restrict", required=True,
              help="Email address internally associated with this user. Incoming "\
                   "emails will appear in the user's notifications."),
 +        'display_groups_suggestions': fields.boolean("Display Groups Suggestions"),
      }
  
      _defaults = {
Simple merge
Simple merge
Simple merge
@@@ -505,9 -498,8 +510,8 @@@ class pos_order(osv.osv)
                  'session_id': order['pos_session_id'],
                  'lines': order['lines'],
                  'pos_reference':order['name'],
 -                'partner_id': order.get('partner_id', False)
 +                'partner_id': order['partner_id'] or False
              }, context)
              for payments in order['statement_ids']:
                  payment = payments[2]
                  self.add_payment(cr, uid, order_id, {
@@@ -25,8 -25,9 +25,8 @@@ function openerp_pos_devices(instance,m
              };    
              this.custom_payment_status = this.default_payment_status;
  
 -            this.connection = new instance.web.JsonRPC();
 -            this.connection.setup(url);
 +            this.connection = new instance.web.Session(undefined,url);
+             this.connection.session_id = _.uniqueId('posproxy');
              this.bypass_proxy = false;
              this.notifications = {};
              
  
              // The barcode readers acts as a keyboard, we catch all keyup events and try to find a 
              // barcode sequence in the typed keys, then act accordingly.
-             $('body').delegate('','keyup', function (e){
 -            this.handler = function(e){
++            $('body').delegate('','keypress', function (e){
 +                //console.log('keyup:'+String.fromCharCode(e.keyCode)+' '+e.keyCode,e);
                  //We only care about numbers
 -                if (e.which >= 48 && e.which < 58){
 +                if (e.keyCode >= 48 && e.keyCode < 58){
  
                      // The barcode reader sends keystrokes with a specific interval.
                      // We look if the typed keys fit in the interval. 
Simple merge
Simple merge
Simple merge
Simple merge
@@@ -50,8 -67,8 +50,8 @@@
              <field eval="[(6,0,[])]" name="transition_ids"/>
              <field eval="&quot;&quot;&quot;Procurement Task&quot;&quot;&quot;" name="name"/>
              <field eval="&quot;&quot;&quot;if product type is 'service' then it creates the task.&quot;&quot;&quot;" name="note"/>
 -            <field model="process.node" name="target_node_id" ref="process_node_procuretasktask0"/>
 -            <field model="process.node" name="source_node_id" ref="sale_stock.process_node_saleprocurement0"/>
 +            <field name="target_node_id" ref="process_node_procuretasktask0"/>
-             <field name="source_node_id" ref="sale_stock.process_node_saleprocurement0"/>
++            <field name="source_node_id" ref="mrp.process_node_productionorder0"/>
          </record>
  
          <record id="process_transition_createtask0" model="process.transition">
Simple merge
Simple merge