Skip to content

Commit

Permalink
[MERGE] forward port branch saas-15 up to e7ccf38
Browse files Browse the repository at this point in the history
  • Loading branch information
KangOl committed Aug 8, 2018
2 parents b122526 + e7ccf38 commit 4c2bdaf
Show file tree
Hide file tree
Showing 5 changed files with 19 additions and 0 deletions.
2 changes: 2 additions & 0 deletions addons/barcodes/static/src/js/barcode_events.js
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down
3 changes: 3 additions & 0 deletions addons/payment_stripe/static/src/js/stripe.js
Original file line number Diff line number Diff line change
Expand Up @@ -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 () {
Expand Down
5 changes: 5 additions & 0 deletions addons/sale_stock/models/stock.py
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,11 @@ def write(self, vals):
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'
Expand Down
7 changes: 7 additions & 0 deletions addons/stock/models/stock_move.py
Original file line number Diff line number Diff line change
Expand Up @@ -1161,6 +1161,10 @@ def _prepare_move_split_vals(self, qty):
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
Expand Down Expand Up @@ -1190,6 +1194,9 @@ def _split(self, qty, restrict_partner_id=False):
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

Expand Down
2 changes: 2 additions & 0 deletions odoo/addons/base/ir/ir_attachment.py
Original file line number Diff line number Diff line change
Expand Up @@ -313,6 +313,8 @@ def _auto_init(self):
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()]):
Expand Down

0 comments on commit 4c2bdaf

Please sign in to comment.