[MERGE] forward port branch 10.0 up to 60592561d7

This commit is contained in:
Christophe Simonis
2019-04-04 18:33:42 +02:00
8 changed files with 41 additions and 17 deletions
@@ -133,7 +133,7 @@
<field name="salvage_value" widget="monetary" options="{'currency_field': 'currency_id'}" attrs="{'invisible': [('type','=','sale')]}"/>
<field name="value_residual" widget="monetary" options="{'currency_field': 'currency_id'}"/>
<field name="partner_id" string="Vendor" domain="[('supplier', '=', True)]"/>
<field name="invoice_id" string="Invoice" options="{'no_create': True}"/>
<field name="invoice_id" string="Invoice" attrs="{'readonly': [('state', '!=', 'draft')]}" options="{'no_create': True}"/>
</group>
</group>
<notebook colspan="4">
+1 -1
View File
@@ -253,7 +253,7 @@
<field name="type_tax_use">sale</field>
<field name="refund_account_id" ref="chart22030200"/>
<field name="account_id" ref="chart22030200"/>
<field name="tag_ids" eval="[ref('l10n_pl.tag_pl_08'), ref('l10n_pl.tag_pl_29')]"/>
<field name="tag_ids" eval="[(6,0,[ref('l10n_pl.tag_pl_08'), ref('l10n_pl.tag_pl_29')])]"/>
</record>
<record id="vs_kraj_5" model="account.tax.template">
@@ -1193,6 +1193,13 @@ msgstr ""
msgid "Group Journal Items"
msgstr ""
#. module: point_of_sale
#. openerp-web
#: code:addons/point_of_sale/static/src/js/models.js:135
#, python-format
msgid "HTTPS connection to IoT Box failed"
msgstr ""
#. module: point_of_sale
#. openerp-web
#: code:addons/point_of_sale/static/src/xml/pos.xml:1327
@@ -1496,6 +1503,13 @@ msgstr ""
msgid "Make Payment"
msgstr ""
#. module: point_of_sale
#. openerp-web
#: code:addons/point_of_sale/static/src/js/models.js:137
#, python-format
msgid "Make sure you are using IoT Box v18.12 or higher. Navigate to %s to accept the certificate of your IoT Box."
msgstr ""
#. module: point_of_sale
#: model:ir.ui.view,arch_db:point_of_sale.view_sale_config_settings_form_pos
msgid "Manage loyalty program with points and rewards for customers"
@@ -630,9 +630,6 @@ var Chrome = PosBaseWidget.extend({
if(err.message === 'XmlHttpRequestError '){
title = 'Network Failure (XmlHttpRequestError)';
body = 'The Point of Sale could not be loaded due to a network problem.\n Please check your internet connection.';
}else if(err.message === 'TLSError'){
title = 'Https connection to IoT Box failed';
body = 'Make sure you are using IoT Box v18.10 or higher.\n\n Navigate to ' + err.url + ' to accept the certificate of your IoT Box.';
}else if(err.code === 200){
title = err.data.message;
body = err.data.debug;
+10 -5
View File
@@ -129,11 +129,16 @@ exports.PosModel = Backbone.Model.extend({
done.resolve();
},
function(statusText, url){
if (statusText == 'error' && window.location.protocol == 'https:') {
var error = {message: 'TLSError', url: url};
self.chrome.loading_error(error);
} else {
done.resolve();
var show_loading_error = (self.gui.current_screen === null);
done.resolve();
if (show_loading_error && statusText == 'error' && window.location.protocol == 'https:') {
self.gui.show_popup('alert', {
title: _t('HTTPS connection to IoT Box failed'),
body: _.str.sprintf(
_t('Make sure you are using IoT Box v18.12 or higher. Navigate to %s to accept the certificate of your IoT Box.'),
url
),
});
}
});
return done;
+5 -1
View File
@@ -10,6 +10,7 @@ from odoo.osv import expression
import odoo.addons.decimal_precision as dp
class ProductCategory(models.Model):
_name = "product.category"
_description = "Product Category"
@@ -520,7 +521,10 @@ class ProductProduct(models.Model):
if date is None:
date = fields.Date.today()
res = self.env['product.supplierinfo']
for seller in self.seller_ids:
sellers = self.seller_ids
if self.env.context.get('force_company'):
sellers = sellers.filtered(lambda s: not s.company_id or s.company_id.id == self.env.context['force_company'])
for seller in sellers:
# Set quantity in UoM of seller
quantity_uom_seller = quantity
if quantity_uom_seller and uom_id and uom_id != seller.product_uom:
+6 -2
View File
@@ -953,7 +953,11 @@ class ProcurementOrder(models.Model):
"""Return the datetime value to use as Order Date (``date_order``) for the
Purchase Order created to satisfy the given procurement. """
self.ensure_one()
seller_delay = int(self.product_id._select_seller(quantity=self.product_qty, uom_id=self.product_uom).delay)
seller_delay = int(
self.product_id.with_context(force_company=self.company_id.id)._select_seller(
quantity=self.product_qty, uom_id=self.product_uom
).delay
)
return schedule_date - relativedelta(days=seller_delay)
@api.multi
@@ -961,7 +965,7 @@ class ProcurementOrder(models.Model):
self.ensure_one()
procurement_uom_po_qty = self.product_uom._compute_quantity(self.product_qty, self.product_id.uom_po_id)
seller = self.product_id._select_seller(
seller = self.product_id.with_context(force_company=self.company_id.id)._select_seller(
partner_id=supplier.name,
quantity=procurement_uom_po_qty,
date=po.date_order and po.date_order[:10],
+4 -4
View File
@@ -769,7 +769,7 @@ function createVideoNode(url, options) {
options = options || {};
// video url patterns(youtube, instagram, vimeo, dailymotion, youku)
var ytRegExp = /^(?:(?:https?:)?\/\/)?(?:www\.)?(?:youtu\.be\/|youtube\.com\/(?:embed\/|v\/|watch\?v=|watch\?.+&v=))((\w|-){11})(?:\S+)?$/;
var ytRegExp = /^(?:(?:https?:)?\/\/)?(?:www\.)?(?:youtu\.be\/|youtube(-nocookie)?\.com\/(?:embed\/|v\/|watch\?v=|watch\?.+&v=))((?:\w|-){11})(?:\S+)?$/;
var ytMatch = url.match(ytRegExp);
var igRegExp = /\/\/instagram.com\/p\/(.[a-zA-Z0-9]*)/;
@@ -788,10 +788,10 @@ function createVideoNode(url, options) {
var youkuMatch = url.match(youkuRegExp);
var $video = $('<iframe>');
if (ytMatch && ytMatch[1].length === 11) {
var youtubeId = ytMatch[1];
if (ytMatch && ytMatch[2].length === 11) {
var youtubeId = ytMatch[2];
$video = $('<iframe>', {
src: '//www.youtube.com/embed/' + youtubeId,
src: '//www.youtube' + (ytMatch[1] || '') + '.com/embed/' + youtubeId,
width: '640',
height: '360'
});