[MERGE] forward port branch 10.0 up to 4c66eae308

This commit is contained in:
Christophe Simonis
2017-06-26 18:38:41 +02:00
7 changed files with 31 additions and 12 deletions
+7 -3
View File
@@ -325,11 +325,11 @@ class Picking(models.Model):
.filtered(lambda move: move.state not in ['cancel', 'done'])\
.sorted(key=lambda move: (move.state == 'assigned' and 2) or (move.state == 'waiting' and 1) or 0)
if self.move_type == 'one':
self.state = moves_todo[0].state
self.state = moves_todo[0].state or 'draft'
elif moves_todo[0].state != 'assigned' and any(x.partially_available or x.state == 'assigned' for x in moves_todo):
self.state = 'partially_available'
else:
self.state = moves_todo[-1].state
self.state = moves_todo[-1].state or 'draft'
@api.one
@api.depends('move_lines.priority')
@@ -607,9 +607,13 @@ class Picking(models.Model):
forced_qties[move.product_id] = forced_qty
for vals in picking._prepare_pack_ops(picking_quants, forced_qties):
vals['fresh_record'] = False
PackOperation.create(vals)
PackOperation |= PackOperation.create(vals)
# recompute the remaining quantities all at once
self.do_recompute_remaining_quantities()
for pack in PackOperation:
pack.ordered_qty = sum(
pack.mapped('linked_move_operation_ids').mapped('move_id').filtered(lambda r: r.state != 'cancel').mapped('ordered_qty')
)
self.write({'recompute_pack_op': False})
@api.multi
+1
View File
@@ -157,6 +157,7 @@
<header>
<field name="state" widget="statusbar"/>
</header>
<field name="scrapped" invisible="1"/>
<group>
<group string="#Products">
<field name="product_id"/>
+1 -1
View File
@@ -41,7 +41,7 @@ class StockHistory(models.Model):
self._cr.execute("""SELECT DISTINCT ON (product_id, company_id) product_id, company_id, cost
FROM product_price_history
WHERE product_id in %s AND datetime <= %s
ORDER BY product_id, company_id, datetime DESC""", (tuple(not_real_cost_method_products.ids), date))
ORDER BY product_id, company_id, datetime DESC, id DESC""", (tuple(not_real_cost_method_products.ids), date))
for history in self._cr.dictfetchall():
histories_dict[(history['product_id'], history['company_id'])] = history['cost']
+6 -6
View File
@@ -50,19 +50,19 @@ class WebsiteCrmBackend(WebsiteBackend):
'graph': [
{
'values': leads_graph,
'key': 'Leads',
'key': _('Leads'),
},
{
'values': previous_leads_graph,
'key': 'Previous Leads',
'key': _('Previous Leads'),
},
],
'leads': leads,
'lead_fields': {
'create_date': 'Create Date',
'campaign_id': 'Campaign',
'medium_id': 'Medium',
'source_id': 'Source',
'create_date': _('Create Date'),
'campaign_id': _('Campaign'),
'medium_id': _('Medium'),
'source_id': _('Source'),
},
}
+2 -2
View File
@@ -58,11 +58,11 @@ class WebsiteSaleBackend(WebsiteBackend):
'graph': [
{
'values': sales_graph,
'key': 'Sales',
'key': _('Sales'),
},
{
'values': previous_sales_graph,
'key': 'Previous Sales',
'key': _('Previous Sales'),
},
],
'best_sellers': best_sellers,
+9
View File
@@ -0,0 +1,9 @@
Poland, 2017-06-25
I hereby agree to the terms of the Odoo Individual Contributor License Agreement v1.0.
I declare that I am authorized and able to make this agreement and sign this declaration.
Signed,
Marcin Pieczyński marcin-pieczynski@wp.pl https://github.com/piemar1
+5
View File
@@ -1120,6 +1120,11 @@ default and behave as booleans (they can only be enabled by default).
Gantt
-----
.. warning::
The gantt view requires the web_gantt module which is present in
:ref:`the enterprise edition <setup/install/editions>` version.
Horizontal bar charts typically used to show project planning and advancement,
their root element is ``<gantt>``.