diff options
| author | Christophe Simonis <chs@odoo.com> | 2019-05-14 13:55:35 +0200 |
|---|---|---|
| committer | Christophe Simonis <chs@odoo.com> | 2019-05-14 13:55:35 +0200 |
| commit | a7743e0be8b0e0ef8819f4e107914263e36bbb88 (patch) | |
| tree | 84322835094a2c0bea42115b93a457fe753e1f5c | |
| parent | 82f88478cf87d4c142be170d2d10b265888ae86c (diff) | |
| parent | 64ed30e34b5764dbe42c408886cd0d23601b211f (diff) | |
[MERGE] forward port branch saas-14 up to 64ed30e34b5
| -rw-r--r-- | addons/point_of_sale/static/src/js/gui.js | 7 | ||||
| -rw-r--r-- | addons/sale/models/sale_analytic.py | 2 | ||||
| -rw-r--r-- | addons/stock/models/stock_inventory.py | 4 | ||||
| -rw-r--r-- | addons/website_crm_partner_assign/views/website_crm_partner_assign_templates.xml | 12 | ||||
| -rw-r--r-- | addons/website_customer/views/website_customer_templates.xml | 9 | ||||
| -rw-r--r-- | odoo/addons/base/res/res_users.py | 8 |
6 files changed, 26 insertions, 16 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> diff --git a/odoo/addons/base/res/res_users.py b/odoo/addons/base/res/res_users.py index 0e221361f30..c4a85ba0ae2 100644 --- a/odoo/addons/base/res/res_users.py +++ b/odoo/addons/base/res/res_users.py @@ -858,9 +858,9 @@ class UsersView(models.Model): group_multi_company = self.env.ref('base.group_multi_company', False) if group_multi_company and 'company_ids' in values: if len(user.company_ids) <= 1 and user.id in group_multi_company.users.ids: - group_multi_company.write({'users': [(3, user.id)]}) + user.write({'groups_id': [(3, group_multi_company.id)]}) elif len(user.company_ids) > 1 and user.id not in group_multi_company.users.ids: - group_multi_company.write({'users': [(4, user.id)]}) + user.write({'groups_id': [(4, group_multi_company.id)]}) return user @api.multi @@ -871,9 +871,9 @@ class UsersView(models.Model): if group_multi_company and 'company_ids' in values: for user in self: if len(user.company_ids) <= 1 and user.id in group_multi_company.users.ids: - group_multi_company.write({'users': [(3, user.id)]}) + user.write({'groups_id': [(3, group_multi_company.id)]}) elif len(user.company_ids) > 1 and user.id not in group_multi_company.users.ids: - group_multi_company.write({'users': [(4, user.id)]}) + user.write({'groups_id': [(4, group_multi_company.id)]}) return res def _remove_reified_groups(self, values): |
