[MERGE] forward port branch saas-15 up to bda926034a

This commit is contained in:
Christophe Simonis
2018-06-26 14:58:48 +02:00
7 changed files with 15 additions and 8 deletions
+3 -2
View File
@@ -319,10 +319,11 @@ class PosConfig(models.Model):
def name_get(self):
result = []
for config in self:
if (not config.session_ids) or (config.session_ids[0].state == 'closed'):
last_session = self.env['pos.session'].search([('config_id', '=', config.id)], limit=1)
if (not last_session) or (last_session.state == 'closed'):
result.append((config.id, config.name + ' (' + _('not used') + ')'))
continue
result.append((config.id, config.name + ' (' + config.session_ids[0].user_id.name + ')'))
result.append((config.id, config.name + ' (' + last_session.user_id.name + ')'))
return result
@api.model
@@ -31,8 +31,10 @@ var Printer = core.Class.extend(mixins.PropertiesMixin,{
self.connection.rpc('/hw_proxy/print_xml_receipt', {receipt: r}, options)
.then(function(){
send_printing_job();
},function(){
},function(error, event){
self.receipt_queue.unshift(r);
console.log('There was an error while trying to print the order:');
console.log(error);
});
}
}
@@ -56,7 +58,7 @@ models.load_models({
for(var i = 0; i < printers.length; i++){
if(active_printers[printers[i].id]){
var url = printers[i].proxy_ip;
var url = printers[i].proxy_ip || '';
if(url.indexOf('//') < 0){
url = 'http://'+url;
}
@@ -44,6 +44,8 @@ tour.register('sale_tour', {
in_modal: false,
run: function (actions) {
actions.auto();
// There might be a modal because of the view:
// sale.order.form.editable.list, enabled by some groups
if ($(".modal-footer .btn-primary").length) {
actions.auto(".modal-footer .btn-primary");
}
+1 -1
View File
@@ -780,7 +780,7 @@ class StockMove(models.Model):
group_id = False
return {
'company_id': self.company_id,
'date_planned': self.date,
'date_planned': self.date_expected,
'move_dest_ids': self,
'group_id': group_id,
'route_ids': self.route_ids,
+2
View File
@@ -146,11 +146,13 @@ class ProductProduct(models.Model):
'account_id': debit_account_id,
'debit': abs(diff * qty_available),
'credit': 0,
'product_id': product.id,
}), (0, 0, {
'name': _('Standard Price changed - %s') % (product.display_name),
'account_id': credit_account_id,
'debit': 0,
'credit': abs(diff * qty_available),
'product_id': product.id,
})],
}
move = AccountMove.create(move_vals)
@@ -9,7 +9,7 @@ require('website_sale.website_sale');
$('.oe_website_sale #add_to_cart, .oe_website_sale #products_grid .a-submit')
.off('click')
.removeClass('a-submit')
.click(function (event) {
.click(_.debounce(function (event) {
var $form = $(this).closest('form');
var quantity = parseFloat($form.find('input[name="add_qty"]').val() || 1);
var product_id = parseInt($form.find('input[type="hidden"][name="product_id"], input[type="radio"][name="product_id"]:checked').first().val(),10);
@@ -96,6 +96,6 @@ $('.oe_website_sale #add_to_cart, .oe_website_sale #products_grid .a-submit')
});
});
return false;
});
}, 200, true));
});
+1 -1
View File
@@ -189,7 +189,7 @@ class Property(models.Model):
if not values:
return
if not default_value:
if default_value is None:
domain = self._get_domain(name, model)
if domain is None:
raise Exception()