[MERGE] forward port branch saas-15 up to ce84bacd72
This commit is contained in:
@@ -22,7 +22,7 @@
|
||||
<th class="text-right">Unit Price</th>
|
||||
<th t-if="display_discount" class="text-right" groups="sale.group_discount_per_so_line">Disc.(%)</th>
|
||||
<th class="text-right">Taxes</th>
|
||||
<th class="text-right">Price</th>
|
||||
<th class="text-right">Amount</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody class="invoice_tbody">
|
||||
@@ -53,7 +53,7 @@
|
||||
<td class="text-right">
|
||||
<span t-esc="', '.join(map(lambda x: x.description or x.name, l.invoice_line_tax_ids))"/>
|
||||
</td>
|
||||
<td class="text-right" groups="sale.group_show_price_subtotal">
|
||||
<td class="text-right">
|
||||
<span t-field="l.price_subtotal"
|
||||
t-options='{"widget": "monetary", "display_currency": o.currency_id}'/>
|
||||
</td>
|
||||
|
||||
@@ -137,13 +137,9 @@ class SaleOrderLine(models.Model):
|
||||
@api.multi
|
||||
@api.depends('product_id')
|
||||
def _compute_qty_delivered_updateable(self):
|
||||
# prefetch field before filtering
|
||||
self.mapped('product_id')
|
||||
# on consumable or stockable products, qty_delivered_updateable defaults
|
||||
# to False; on other lines use the original computation
|
||||
lines = self.filtered(lambda line: line.product_id.type not in ('consu', 'product'))
|
||||
lines = lines.with_prefetch(self._prefetch)
|
||||
super(SaleOrderLine, lines)._compute_qty_delivered_updateable()
|
||||
for line in self:
|
||||
if line.product_id.type not in ('consu', 'product'):
|
||||
super(SaleOrderLine, line)._compute_qty_delivered_updateable()
|
||||
|
||||
@api.onchange('product_id')
|
||||
def _onchange_product_id_set_customer_lead(self):
|
||||
|
||||
@@ -52,7 +52,7 @@ class TestSaleStock(TestSale):
|
||||
pick_2 = self.so.picking_ids[0]
|
||||
pick_2.force_assign()
|
||||
pick_2.move_lines.write({'quantity_done': 1})
|
||||
self.assertIsNone(pick_2.button_validate(), 'Sale Stock: second picking should be final without need for a backorder')
|
||||
self.assertTrue(pick_2.button_validate(), 'Sale Stock: second picking should be final without need for a backorder')
|
||||
self.assertEqual(self.so.invoice_status, 'to invoice', 'Sale Stock: so invoice_status should be "to invoice" after complete delivery')
|
||||
del_qties = [sol.qty_delivered for sol in self.so.order_line]
|
||||
del_qties_truth = [2.0 if sol.product_id.type in ['product', 'consu'] else 0.0 for sol in self.so.order_line]
|
||||
@@ -104,7 +104,7 @@ class TestSaleStock(TestSale):
|
||||
pick = self.so.picking_ids
|
||||
pick.force_assign()
|
||||
pick.move_lines.write({'quantity_done': 2})
|
||||
self.assertIsNone(pick.button_validate(), 'Sale Stock: complete delivery should not need a backorder')
|
||||
self.assertTrue(pick.button_validate(), 'Sale Stock: complete delivery should not need a backorder')
|
||||
del_qties = [sol.qty_delivered for sol in self.so.order_line]
|
||||
del_qties_truth = [2.0 if sol.product_id.type in ['product', 'consu'] else 0.0 for sol in self.so.order_line]
|
||||
self.assertEqual(del_qties, del_qties_truth, 'Sale Stock: delivered quantities are wrong after partial delivery')
|
||||
|
||||
@@ -757,7 +757,7 @@ class Picking(models.Model):
|
||||
if self._check_backorder():
|
||||
return self.action_generate_backorder_wizard()
|
||||
self.action_done()
|
||||
return
|
||||
return True
|
||||
|
||||
def action_generate_backorder_wizard(self):
|
||||
view = self.env.ref('stock.view_backorder_confirmation')
|
||||
|
||||
@@ -39,9 +39,7 @@
|
||||
|
||||
// Flex fields (inline)
|
||||
&.o_field_many2one, &.o_field_radio, &.o_field_many2manytags, &.o_field_percent_pie, &.o_field_monetary, &.o_field_binary_file {
|
||||
@media (min-width: @screen-sm-min) {
|
||||
.o-inline-flex-display();
|
||||
}
|
||||
.o-inline-flex-display();
|
||||
> span, > button {
|
||||
.o-flex(0, 0, auto);
|
||||
}
|
||||
@@ -185,6 +183,9 @@
|
||||
|
||||
// Radio buttons
|
||||
&.o_field_radio {
|
||||
@media (max-width: @screen-xs-max) {
|
||||
display: inline-block;
|
||||
}
|
||||
.o_radio_input {
|
||||
outline: none;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user