summaryrefslogtreecommitdiff
path: root/addons
diff options
context:
space:
mode:
authorChristophe Simonis <chs@odoo.com>2019-05-14 13:55:35 +0200
committerChristophe Simonis <chs@odoo.com>2019-05-14 13:55:35 +0200
commita7743e0be8b0e0ef8819f4e107914263e36bbb88 (patch)
tree84322835094a2c0bea42115b93a457fe753e1f5c /addons
parent82f88478cf87d4c142be170d2d10b265888ae86c (diff)
parent64ed30e34b5764dbe42c408886cd0d23601b211f (diff)
[MERGE] forward port branch saas-14 up to 64ed30e34b5
Diffstat (limited to 'addons')
-rw-r--r--addons/point_of_sale/static/src/js/gui.js7
-rw-r--r--addons/sale/models/sale_analytic.py2
-rw-r--r--addons/stock/models/stock_inventory.py4
-rw-r--r--addons/website_crm_partner_assign/views/website_crm_partner_assign_templates.xml12
-rw-r--r--addons/website_customer/views/website_customer_templates.xml9
5 files changed, 22 insertions, 12 deletions
diff --git a/addons/point_of_sale/static/src/js/gui.js b/addons/point_of_sale/static/src/js/gui.js
index 6107d3a979e..fdc73a13987 100644
--- a/addons/point_of_sale/static/src/js/gui.js
+++ b/addons/point_of_sale/static/src/js/gui.js
@@ -457,7 +457,9 @@ var Gui = core.Class.extend({
newbuf = newbuf.substring(1,newbuf.length);
}
} else if (input === '-') {
- if ( newbuf[0] === '-' ) {
+ if (options.firstinput) {
+ newbuf = '-0';
+ } else if ( newbuf[0] === '-' ) {
newbuf = newbuf.substring(1,newbuf.length);
} else {
newbuf = '-' + newbuf;
@@ -471,6 +473,9 @@ var Gui = core.Class.extend({
newbuf += input;
}
}
+ if (newbuf === "-") {
+ newbuf = "";
+ }
// End of input buffer at 12 characters.
if (newbuf.length > buffer.length && newbuf.length > 12) {
diff --git a/addons/sale/models/sale_analytic.py b/addons/sale/models/sale_analytic.py
index 0475fa3b82a..25145e0f1e3 100644
--- a/addons/sale/models/sale_analytic.py
+++ b/addons/sale/models/sale_analytic.py
@@ -34,7 +34,7 @@ class SaleOrderLine(models.Model):
lines.setdefault(line, 0.0)
uom = self.env['product.uom'].browse(d['product_uom_id'][0])
if line.product_uom.category_id == uom.category_id:
- qty = uom._compute_quantity(d['unit_amount'], line.product_uom)
+ qty = uom._compute_quantity(d['unit_amount'], line.product_uom, rounding_method='HALF-UP')
else:
qty = d['unit_amount']
lines[line] += qty
diff --git a/addons/stock/models/stock_inventory.py b/addons/stock/models/stock_inventory.py
index 42220a548a2..38b0a3d2432 100644
--- a/addons/stock/models/stock_inventory.py
+++ b/addons/stock/models/stock_inventory.py
@@ -225,7 +225,7 @@ class Inventory(models.Model):
def _get_inventory_lines_values(self):
# TDE CLEANME: is sql really necessary ? I don't think so
locations = self.env['stock.location'].search([('id', 'child_of', [self.location_id.id])])
- domain = ' location_id in %s'
+ domain = ' location_id in %s AND active = TRUE'
args = (tuple(locations.ids),)
vals = []
@@ -266,6 +266,8 @@ class Inventory(models.Model):
self.env.cr.execute("""SELECT product_id, sum(qty) as product_qty, location_id, lot_id as prod_lot_id, package_id, owner_id as partner_id
FROM stock_quant
+ LEFT JOIN product_product
+ ON product_product.id = stock_quant.product_id
WHERE %s
GROUP BY product_id, location_id, lot_id, package_id, partner_id """ % domain, args)
diff --git a/addons/website_crm_partner_assign/views/website_crm_partner_assign_templates.xml b/addons/website_crm_partner_assign/views/website_crm_partner_assign_templates.xml
index 37b99d87760..0b16759dc5b 100644
--- a/addons/website_crm_partner_assign/views/website_crm_partner_assign_templates.xml
+++ b/addons/website_crm_partner_assign/views/website_crm_partner_assign_templates.xml
@@ -170,18 +170,12 @@
<template id="references_block" name="Partner References Block">
<t t-if="any([p.website_published for p in partner.implemented_partner_ids])">
<h3 id="references">References</h3>
- <div t-foreach="partner.implemented_partner_ids" t-as="reference" class="media">
- <t t-if="reference.website_published">
- <a class="pull-left" t-attf-href="/customers/#{slug(reference)}">
- <span t-field="reference.image_small" t-options='{"widget": "image", "class": "center-block"}'/>
- </a>
+ <div t-foreach="partner.implemented_partner_ids" t-if="reference.website_published" t-as="reference" class="media">
+ <span t-field="reference.image_small" t-options='{"widget": "image", "class": "center-block pull-left"}'/>
<div class="media-body" style="min-height: 64px;">
- <a class="media-heading" t-attf-href="/customers/#{slug(reference)}">
- <span t-field="reference.self"/>
- </a>
+ <span class="media-heading" t-field="reference.self"/>
<div t-field='reference.website_short_description'/>
</div>
- </t>
</div>
</t>
</template>
diff --git a/addons/website_customer/views/website_customer_templates.xml b/addons/website_customer/views/website_customer_templates.xml
index d4c743cdcd5..81b83e89e1d 100644
--- a/addons/website_customer/views/website_customer_templates.xml
+++ b/addons/website_customer/views/website_customer_templates.xml
@@ -208,4 +208,13 @@
</t>
</template>
+<template id="references_block_href" inherit_id="website_crm_partner_assign.references_block" name="Partner References Block">
+ <xpath expr="//div/span" position="replace">
+ <a class="pull-left" t-attf-href="/customers/#{slug(reference)}">$0</a>
+ </xpath>
+ <xpath expr="//div[@class='media-body']/span" position="replace">
+ <a class="media-heading" t-attf-href="/customers/#{slug(reference)}">$0</a>
+ </xpath>
+</template>
+
</odoo>