[MERGE] forward port branch saas-15 up to e7ccf38c48
This commit is contained in:
@@ -143,6 +143,8 @@ var BarcodeEvents = core.Class.extend(mixins.PropertiesMixin, {
|
||||
e.key === "ArrowUp" || e.key === "ArrowDown" ||
|
||||
e.key === "Escape" || e.key === "Tab" ||
|
||||
e.key === "Backspace" || e.key === "Delete" ||
|
||||
e.key === "Home" || e.key === "End" ||
|
||||
e.key === "PageUp" || e.key === "PageDown" ||
|
||||
e.key === "Unidentified" || /F\d\d?/.test(e.key)) {
|
||||
return true;
|
||||
} else {
|
||||
|
||||
@@ -147,7 +147,10 @@ odoo.define('payment_stripe.stripe', function(require) {
|
||||
access_token: access_token,
|
||||
acquirer_id: acquirer_id
|
||||
}).then(function (data) {
|
||||
var $pay_stripe = $('#pay_stripe').detach();
|
||||
try { provider_form.innerHTML = data; } catch (e) {};
|
||||
// Restore 'Pay Now' button HTML since data might have changed it.
|
||||
$(provider_form).find('#pay_stripe').replaceWith($pay_stripe);
|
||||
});
|
||||
}
|
||||
create_tx.done(function () {
|
||||
|
||||
@@ -43,6 +43,11 @@ class StockMove(models.Model):
|
||||
line.qty_delivered = line._get_delivered_qty()
|
||||
return res
|
||||
|
||||
def _prepare_move_split_vals(self, defaults):
|
||||
defaults = super(StockMove, self)._prepare_move_split_vals(defaults)
|
||||
defaults['to_refund_so'] = self.to_refund_so
|
||||
return defaults
|
||||
|
||||
|
||||
class ProcurementGroup(models.Model):
|
||||
_inherit = 'procurement.group'
|
||||
|
||||
@@ -1161,6 +1161,10 @@ class StockMove(models.Model):
|
||||
vals['product_uom'] = self.env.context['force_split_uom_id']
|
||||
return vals
|
||||
|
||||
def _prepare_move_split_vals(self, defaults):
|
||||
# hook to add values in default vals in other modules
|
||||
return defaults
|
||||
|
||||
def _split(self, qty, restrict_partner_id=False):
|
||||
""" Splits qty from move move into a new move
|
||||
|
||||
@@ -1190,6 +1194,9 @@ class StockMove(models.Model):
|
||||
else:
|
||||
defaults = self.with_context(force_split_uom_id=self.product_id.uom_id.id)._prepare_move_split_vals(qty)
|
||||
|
||||
|
||||
defaults = self._prepare_move_split_vals(defaults)
|
||||
|
||||
if restrict_partner_id:
|
||||
defaults['restrict_partner_id'] = restrict_partner_id
|
||||
|
||||
|
||||
@@ -313,6 +313,8 @@ class IrAttachment(models.Model):
|
||||
def _check_serving_attachments(self):
|
||||
# restrict writing on attachments that could be served by the
|
||||
# ir.http's dispatch exception handling
|
||||
if self.env.user._is_superuser():
|
||||
return
|
||||
if self.type == 'binary' and self.url:
|
||||
has_group = self.env.user.has_group
|
||||
if not any([has_group(g) for g in self.get_serving_groups()]):
|
||||
|
||||
Reference in New Issue
Block a user