Skip to content

Commit

Permalink
Merge remote-tracking branch 'odoo/8.0' into 8.0
Browse files Browse the repository at this point in the history
Conflicts:
	addons/web/static/src/js/view_form.js
  • Loading branch information
OCA git bot authored and OCA git bot committed Jun 26, 2015
2 parents a04d82d + aaf5231 commit a1f2b2b
Show file tree
Hide file tree
Showing 14 changed files with 51 additions and 29 deletions.
6 changes: 0 additions & 6 deletions addons/analytic_user_function/i18n/analytic_user_function.pot
Original file line number Diff line number Diff line change
Expand Up @@ -130,9 +130,3 @@ msgstr ""
#: field:account.analytic.account,user_product_ids:0
msgid "Users/Products Rel."
msgstr ""

#. module: analytic_user_function
#: view:hr_timesheet_sheet.sheet:analytic_user_function.hr_timesheet_sheet_form_inherit
msgid "on_change_account_id(account_id, user_id, unit_amount)"
msgstr ""

5 changes: 4 additions & 1 deletion addons/delivery/sale.py
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,7 @@ def delivery_set(self, cr, uid, ids, context=None):
acc_fp_obj = self.pool.get('account.fiscal.position')
self._delivery_unset(cr, uid, ids, context=context)
currency_obj = self.pool.get('res.currency')
line_ids = []
for order in self.browse(cr, uid, ids, context=context):
grid_id = carrier_obj.grid_get(cr, uid, [order.carrier_id.id], order.partner_shipping_id.id)
if not grid_id:
Expand All @@ -84,7 +85,7 @@ def delivery_set(self, cr, uid, ids, context=None):
price_unit = currency_obj.compute(cr, uid, order.company_id.currency_id.id, order.pricelist_id.currency_id.id,
price_unit, context=dict(context or {}, date=order.date_order))
#create the sale order line
line_obj.create(cr, uid, {
line_id = line_obj.create(cr, uid, {
'order_id': order.id,
'name': grid.carrier_id.name,
'product_uom_qty': 1,
Expand All @@ -94,3 +95,5 @@ def delivery_set(self, cr, uid, ids, context=None):
'tax_id': [(6, 0, taxes_ids)],
'is_delivery': True
}, context=context)
line_ids.append(line_id)
return line_ids
5 changes: 3 additions & 2 deletions addons/payment_ogone/models/ogone.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
from lxml import etree, objectify
from pprint import pformat
import time
from datetime import datetime
from urllib import urlencode
import urllib2
import urlparse
Expand All @@ -13,7 +14,7 @@
from openerp.addons.payment_ogone.controllers.main import OgoneController
from openerp.addons.payment_ogone.data import ogone
from openerp.osv import osv, fields
from openerp.tools import float_round
from openerp.tools import float_round, DEFAULT_SERVER_DATE_FORMAT
from openerp.tools.float_utils import float_compare

_logger = logging.getLogger(__name__)
Expand Down Expand Up @@ -244,7 +245,7 @@ def _ogone_form_validate(self, cr, uid, tx, data, context=None):
if status in self._ogone_valid_tx_status:
tx.write({
'state': 'done',
'date_validate': data['TRXDATE'],
'date_validate': datetime.strptime(data['TRXDATE'],'%m/%d/%y').strftime(DEFAULT_SERVER_DATE_FORMAT),
'acquirer_reference': data['PAYID'],
})
return True
Expand Down
3 changes: 2 additions & 1 deletion addons/point_of_sale/point_of_sale.py
Original file line number Diff line number Diff line change
Expand Up @@ -689,7 +689,8 @@ def _amount_all(self, cr, uid, ids, name, args, context=None):
val1 += self._amount_line_tax(cr, uid, line, context=context)
val2 += line.price_subtotal
res[order.id]['amount_tax'] = cur_obj.round(cr, uid, cur, val1)
res[order.id]['amount_total'] = cur_obj.round(cr, uid, cur, val1+val2)
amount_untaxed = cur_obj.round(cr, uid, cur, val2)
res[order.id]['amount_total'] = res[order.id]['amount_tax'] + amount_untaxed
return res

_columns = {
Expand Down
10 changes: 5 additions & 5 deletions addons/product/product.py
Original file line number Diff line number Diff line change
Expand Up @@ -946,12 +946,12 @@ def _get_image_variant(self, cr, uid, ids, name, args, context=None):

def _set_image_variant(self, cr, uid, id, name, value, args, context=None):
image = tools.image_resize_image_big(value)
res = self.write(cr, uid, [id], {'image_variant': image}, context=context)

product = self.browse(cr, uid, id, context=context)
if not product.product_tmpl_id.image:
product.write({'image_variant': None})
product.product_tmpl_id.write({'image': image})
return res
if product.product_tmpl_id.image:
product.image_variant = image
else:
product.product_tmpl_id.image = image

def _get_price_extra(self, cr, uid, ids, name, args, context=None):
result = dict.fromkeys(ids, False)
Expand Down
6 changes: 3 additions & 3 deletions addons/stock/res_config.py
Original file line number Diff line number Diff line change
Expand Up @@ -82,10 +82,10 @@ class stock_config_settings(osv.osv_memory):
'group_uom': fields.boolean("Manage different units of measure for products",
implied_group='product.group_uom',
help="""Allows you to select and maintain different units of measure for products."""),
'group_uos': fields.boolean("Invoice products in a different unit of measure than the sales order",
'group_uos': fields.boolean("Store products in a different unit of measure than the sales order",
implied_group='product.group_uos',
help='Allows you to sell units of a product, but invoice based on a different unit of measure.\n'
'For instance, you can sell pieces of meat that you invoice based on their weight.'),
help='Allows you to store units of a product, but sell and invoice based on a different unit of measure.\n'
'For instance, you can store pieces of meat that you sell and invoice based on their weight.'),
'group_stock_packaging': fields.boolean("Allow to define several packaging methods on products",
implied_group='product.group_stock_packaging',
help="""Allows you to create and manage your packaging dimensions and types you want to be maintained in your system."""),
Expand Down
10 changes: 5 additions & 5 deletions addons/web/static/src/js/view_form.js
Original file line number Diff line number Diff line change
Expand Up @@ -4391,12 +4391,12 @@ instance.web.form.One2ManyViewManager = instance.web.ViewManager.extend({
});

instance.web.form.One2ManyDataSet = instance.web.BufferedDataSet.extend({
get_context: function() {
get_context: function(extra_context) {
this.context = this.o2m.build_context();
var self = this;
_.each(arguments, function(context) {
self.context.add(context);
});
if(extra_context)
{
this.context.add(extra_context);
}
return this.context;
}
});
Expand Down
6 changes: 4 additions & 2 deletions addons/web/static/src/js/view_list.js
Original file line number Diff line number Diff line change
Expand Up @@ -2305,7 +2305,7 @@ instance.web.list.Binary = instance.web.list.Column.extend({
* @private
*/
_format: function (row_data, options) {
var text = _t("Download");
var text = _t("Download"), filename=_t('Binary file');
var value = row_data[this.id].value;
if (!value) {
return options.value_if_empty || '';
Expand All @@ -2323,11 +2323,13 @@ instance.web.list.Binary = instance.web.list.Column.extend({
if (this.filename && row_data[this.filename]) {
text = _.str.sprintf(_t("Download \"%s\""), instance.web.format_value(
row_data[this.filename].value, {type: 'char'}));
filename = row_data[this.filename].value;
}
return _.template('<a href="<%-href%>"><%-text%></a> (<%-size%>)', {
return _.template('<a download="<%-download%>" href="<%-href%>"><%-text%></a> (<%-size%>)', {
text: text,
href: download_url,
size: instance.web.binary_to_binsize(value),
download: filename,
});
}
});
Expand Down
15 changes: 15 additions & 0 deletions doc/cla/corporate/meta-it.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
France, 2015 June 25

META-IT agrees to the terms of the Odoo Corporate Contributor License
Agreement v1.0.

I declare that I am authorized and able to make this agreement and sign this
declaration.

Signed,

Robin Lucbenet robin@meta-it.fr https://github.com/n1b0r

List of contributors:

Guillaume Masson guillaume.masson@meta-it.fr
2 changes: 1 addition & 1 deletion doc/cla/individual/nicobustillos.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,4 +8,4 @@ declaration.

Signed,

Nicolas Bustillos nicolas.bustillos@poiesisconsulting.com https://github.com/nicobustillos
Nicolas Bustillos nicobustillos@users.noreply.github.com https://github.com/nicobustillos
2 changes: 1 addition & 1 deletion doc/cla/individual/npiganeau.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,4 +8,4 @@ declaration.

Signed,

Nicolas Piganeau nicolas.piganeau@ndp-systemes.fr https://github.com/npiganeau
Nicolas Piganeau npi@m4x.org https://github.com/npiganeau
4 changes: 2 additions & 2 deletions openerp/addons/base/ir/ir_ui_view.py
Original file line number Diff line number Diff line change
Expand Up @@ -203,7 +203,7 @@ def _check_xml(self, cr, uid, ids, context=None):
# Sanity checks: the view should not break anything upon rendering!
# Any exception raised below will cause a transaction rollback.
for view in self.browse(cr, uid, ids, context):
view_def = self.read_combined(cr, uid, view.id, None, context=context)
view_def = self.read_combined(cr, uid, view.id, ['arch'], context=context)
view_arch_utf8 = view_def['arch']
if view.type != 'qweb':
view_doc = etree.fromstring(view_arch_utf8)
Expand Down Expand Up @@ -527,7 +527,7 @@ def read_combined(self, cr, uid, view_id, fields=None, context=None):

# arch and model fields are always returned
if fields:
fields = list(set(fields) | set(['arch', 'model']))
fields = list({'arch', 'model'}.union(fields))

# read the view arch
[view] = self.read(cr, uid, [root_id], fields=fields, context=context)
Expand Down
1 change: 1 addition & 0 deletions openerp/addons/base/res/res_country_data.xml
Original file line number Diff line number Diff line change
Expand Up @@ -428,6 +428,7 @@
<field name="name">Finland</field>
<field name="code">fi</field>
<field name="image" type="base64" file="base/static/img/country_flags/fi.png"></field>
<field name="address_format" eval="'%(street)s\n%(street2)s\n%(zip)s %(city)s\n%(country_name)s'" />
<field name="currency_id" ref="EUR"/>
</record>
<record id="fj" model="res.country">
Expand Down
5 changes: 5 additions & 0 deletions openerp/tools/image.py
Original file line number Diff line number Diff line change
Expand Up @@ -129,9 +129,14 @@ def image_save_for_web(image, fp=None, format=None):
opt = dict(format=image.format or format)
if image.format == 'PNG':
opt.update(optimize=True)
alpha = False
if image.mode in ('RGBA', 'LA') or (image.mode == 'P' and 'transparency' in image.info):
alpha = image.convert('RGBA').split()[-1]
if image.mode != 'P':
# Floyd Steinberg dithering by default
image = image.convert('RGBA').convert('P', palette=Image.WEB, colors=256)
if alpha:
image.putalpha(alpha)
elif image.format == 'JPEG':
opt.update(optimize=True, quality=80)
if fp:
Expand Down

0 comments on commit a1f2b2b

Please sign in to comment.