[MERGE] forward port branch 9.0 up to e542b450a3

This commit is contained in:
Christophe Simonis
2017-03-16 16:01:56 +01:00
3 changed files with 5 additions and 3 deletions
@@ -9,6 +9,7 @@
}
.kanban_html_preview {
pointer-events: none;
width: 600px;
-webkit-transform: scale(.50);
-ms-transform: scale(.50);
+2 -2
View File
@@ -255,8 +255,8 @@ class SaleOrder(models.Model):
@api.model
def create(self, vals):
if vals.get('name', 'New') == 'New':
vals['name'] = self.env['ir.sequence'].next_by_code('sale.order') or 'New'
if vals.get('name', _('New')) == _('New'):
vals['name'] = self.env['ir.sequence'].next_by_code('sale.order') or _('New')
# Makes sure partner_invoice_id', 'partner_shipping_id' and 'pricelist_id' are defined
if any(f not in vals for f in ['partner_invoice_id', 'partner_shipping_id', 'pricelist_id']):
+2 -1
View File
@@ -195,7 +195,8 @@ class SaleOrderLine(models.Model):
qty = 0.0
for move in self.procurement_ids.mapped('move_ids').filtered(lambda r: r.state == 'done' and not r.scrapped):
if move.location_dest_id.usage == "customer":
qty += self.env['product.uom']._compute_qty_obj(move.product_uom, move.product_uom_qty, self.product_uom)
if not move.origin_returned_move_id:
qty += self.env['product.uom']._compute_qty_obj(move.product_uom, move.product_uom_qty, self.product_uom)
elif move.location_dest_id.usage == "internal" and move.to_refund_so:
qty -= self.env['product.uom']._compute_qty_obj(move.product_uom, move.product_uom_qty, self.product_uom)
return qty