Merge branch 'upstream/saas-5' into saas-5 saas-5
authorAlicia FLOREZ <alic.florez@gmail.com>
Fri, 27 Jun 2014 14:57:38 +0000 (16:57 +0200)
committerAlicia FLOREZ <alic.florez@gmail.com>
Fri, 27 Jun 2014 14:57:38 +0000 (16:57 +0200)
Conflicts:
addons/website_sale/static/src/js/website.tour.sale.js

1  2 
addons/gamification/models/challenge.py
addons/product/product.py
addons/website_mail_group/views/website_mail_group.xml
addons/website_sale/static/src/js/website.tour.sale.js

@@@ -58,7 -58,7 +58,7 @@@ def start_end_date_for_period(period, d
          end_date = default_end_date
  
      if start_date and end_date:
-         return (start_date.strftime(DF), end_date.strftime(DF))
+         return (datetime.strftime(start_date, DF), datetime.strftime(end_date, DF))
      else:
          return (start_date, end_date)
  
@@@ -380,6 -380,10 +380,6 @@@ class gamification_challenge(osv.Model)
  
      ##### Automatic actions #####
  
 -    def generate_goals_from_challenge(self, cr, uid, ids, context=None):
 -        _logger.warning("Deprecated, use private method _generate_goals_from_challenge(...) instead.")
 -        return self._generate_goals_from_challenge(cr, uid, ids, context=context)
 -
      def _generate_goals_from_challenge(self, cr, uid, ids, context=None):
          """Generate the goals for each line and user.
  
@@@ -538,10 -538,7 +538,10 @@@ class product_template(osv.osv)
              help="Small-sized image of the product. It is automatically "\
                   "resized as a 64x64px image, with aspect ratio preserved. "\
                   "Use this field anywhere a small image is required."),
 -
 +        'packaging_ids': fields.one2many(
 +            'product.packaging', 'product_tmpl_id', 'Logistical Units',
 +            help="Gives the different ways to package the same product. This has no impact on "
 +                 "the picking order and is mainly used if you use the EDI module."),
          'seller_ids': fields.one2many('product.supplierinfo', 'product_tmpl_id', 'Supplier'),
          'seller_delay': fields.related('seller_ids','delay', type='integer', string='Supplier Lead Time',
              help="This is the average delay in days between the purchase order confirmation and the reception of goods for this product and for the default supplier. It is used by the scheduler to order requests based on reordering delays."),
          if not context or "create_product_product" not in context:
              self.create_variant_ids(cr, uid, [product_template_id], context=context)
          self._set_standard_price(cr, uid, product_template_id, vals.get('standard_price', 0.0), context=context)
+         # TODO: this is needed to set given values to first variant after creation
+         # these fields should be moved to product as lead to confusion
+         related_vals = {}
+         if vals.get('ean13'):
+             related_vals['ean13'] = vals['ean13']
+         if vals.get('default_code'):
+             related_vals['default_code'] = vals['default_code']
+         if related_vals:
+             self.write(cr, uid, product_template_id, related_vals, context=context)
          return product_template_id
  
      def write(self, cr, uid, ids, vals, context=None):
@@@ -885,6 -893,7 +896,6 @@@ class product_product(osv.osv)
          'active': fields.boolean('Active', help="If unchecked, it will allow you to hide the product without removing it."),
          'product_tmpl_id': fields.many2one('product.template', 'Product Template', required=True, ondelete="cascade", select=True),
          'ean13': fields.char('EAN13 Barcode', size=13, help="International Article Number used for product identification."),
 -        'packaging': fields.one2many('product.packaging', 'product_id', 'Packaging', help="Gives the different ways to package the same product. This has no impact on the picking order and is mainly used if you use the EDI module."),
          'name_template': fields.related('product_tmpl_id', 'name', string="Template Name", type='char', store={
              'product.template': (_get_name_template_ids, ['name'], 10),
              'product.product': (lambda self, cr, uid, ids, c=None: ids, [], 10),
@@@ -1080,7 -1089,7 +1091,7 @@@ class product_packaging(osv.osv)
          'ul_container': fields.many2one('product.ul', 'Pallet Logistic Unit'),
          'rows' : fields.integer('Number of Layers', required=True,
              help='The number of layers on a pallet or box'),
 -        'product_id' : fields.many2one('product.product', 'Product', select=1, ondelete='cascade', required=True),
 +        'product_tmpl_id' : fields.many2one('product.template', 'Product', select=1, ondelete='cascade', required=True),
          'ean' : fields.char('EAN', size=14, help="The EAN code of the package unit."),
          'code' : fields.char('Code', help="The code of the transport unit."),
          'weight': fields.float('Total Package Weight',
@@@ -2,8 -2,8 +2,8 @@@
  <openerp>
  <data>
  
 -<template id="footer_mailing_list" inherit_id="website.layout" name="Footer Mailing List Link">
 -    <xpath expr="//footer//div[@name='info']/ul" position="inside">
 +<template id="footer_mailing_list" inherit_id="website.footer_default" name="Footer Mailing List Link">
 +    <xpath expr="//div[@id='info']/ul" position="inside">
          <li><a t-attf-href="/groups">Mailing List</a></li>
      </xpath>
  </template>
@@@ -45,7 -45,7 +45,7 @@@
                  </div>
                  <div class="col-md-2">
                      <i class='fa fa-user'/> <t t-esc="len(group.message_follower_ids)"/> participants<br />
-                     <i class='fa fa-envelope-o'/> <t t-esc="len(group.message_ids)"/> messages
+                     <i class='fa fa-envelope-o'/> <t t-raw="group_data[group.id]['monthly_message_nbr']"/> messages / month
                  </div>
                  <div class="col-md-3">
                      <t t-call="website_mail.follow"><t t-set="object" t-value="group"/></t>
                  element:   "#customize-menu a:contains(Product Attribute's Filters)",
              },
              {
-                 title:     "select product attribute memory 16 Go",
-                 element:   'form.js_attributes label:contains(16 Go) input:not(:checked)',
+                 title:     "select product attribute memory 16 GB",
+                 element:   'form.js_attributes label:contains(16 GB) input:not(:checked)',
              },
              {
                  title:     "check the selection",
-                 waitFor:   'form.js_attributes label:contains(16 Go) input:checked',
+                 waitFor:   'form.js_attributes label:contains(16 GB) input:checked',
              },
              {
                  title:     "select ipod",
@@@ -32,7 -32,7 +32,7 @@@
              },
              {
                  title:     "finish",
 -                waitFor:   'label:contains(32 GB) input',
 +                waitFor:   'form[action="/shop/cart/update"] label:contains(32 Go) input',
              }
          ]
      });
                  element:   '.oe_product_cart a:contains("iPod")',
              },
              {
-                 title:     "select ipod 32Go",
+                 title:     "select ipod 32GB",
                  waitFor:   '#product_detail',
-                 element:   'label:contains(32 Go) input',
+                 element:   'label:contains(32 GB) input',
              },
              {
                  title:     "click on add to cart",
-                 waitFor:   'label:contains(32 Go) input[checked]',
+                 waitFor:   'label:contains(32 GB) input[checked]',
                  element:   'form[action="/shop/cart/update"] .btn',
              },
              {
              {
                  title:     "add one more iPod",
                  waitFor:   '.my_cart_quantity:contains(2)',
-                 element:   '#cart_products tr:contains("32 Go") a.js_add_cart_json:eq(1)',
+                 element:   '#cart_products tr:contains("32 GB") a.js_add_cart_json:eq(1)',
              },
              {
                  title:     "remove Headphones",
-                 waitFor:   '#cart_products tr:contains("32 Go") input.js_quantity[value=2]',
+                 waitFor:   '#cart_products tr:contains("32 GB") input.js_quantity[value=2]',
                  element:   '#cart_products tr:contains("Apple In-Ear Headphones") a.js_add_cart_json:first',
              },
              {