[MERGE] forward port branch 10.0 up to 2a14eea095

This commit is contained in:
Christophe Simonis
2019-05-14 13:54:56 +02:00
6 changed files with 26 additions and 16 deletions
+6 -1
View File
@@ -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) {
+1 -1
View File
@@ -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
+3 -1
View File
@@ -224,7 +224,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 = []
@@ -265,6 +265,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)
@@ -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>
@@ -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>
+4 -4
View File
@@ -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):