diff --git a/addons/account/account_invoice_view.xml b/addons/account/account_invoice_view.xml
index a91d4d7eb33..bceb1b3c857 100644
--- a/addons/account/account_invoice_view.xml
+++ b/addons/account/account_invoice_view.xml
@@ -193,7 +193,7 @@
-
+
@@ -202,12 +202,12 @@
-
+
-
-
+
+
-
+
@@ -257,7 +257,7 @@
-
+
@@ -287,7 +287,7 @@
-
+
@@ -296,11 +296,11 @@
-
-
+
+
-
+
diff --git a/addons/account/account_view.xml b/addons/account/account_view.xml
index 7df04b0f3f4..cf117613189 100644
--- a/addons/account/account_view.xml
+++ b/addons/account/account_view.xml
@@ -408,9 +408,9 @@
-
-
-
+
+
+
@@ -466,7 +466,7 @@
-
+
@@ -957,7 +957,8 @@
-
+
+
@@ -1152,9 +1153,9 @@
-
-
-
+
+
+
@@ -1430,7 +1431,7 @@
-
+
diff --git a/addons/account/project/wizard/project_account_analytic_line_view.xml b/addons/account/project/wizard/project_account_analytic_line_view.xml
index 96d9186cfa8..d564ffb5c81 100644
--- a/addons/account/project/wizard/project_account_analytic_line_view.xml
+++ b/addons/account/project/wizard/project_account_analytic_line_view.xml
@@ -17,7 +17,7 @@
-
+
diff --git a/addons/account/report/account_analytic_entries_report_view.xml b/addons/account/report/account_analytic_entries_report_view.xml
index 1564859540a..3b9e3ec193e 100644
--- a/addons/account/report/account_analytic_entries_report_view.xml
+++ b/addons/account/report/account_analytic_entries_report_view.xml
@@ -66,7 +66,7 @@
-
+
diff --git a/addons/account/report/account_analytic_report_view.xml b/addons/account/report/account_analytic_report_view.xml
index 290e6950569..070b3a8c10a 100644
--- a/addons/account/report/account_analytic_report_view.xml
+++ b/addons/account/report/account_analytic_report_view.xml
@@ -82,7 +82,7 @@
-
+
diff --git a/addons/account/report/account_entries_report_view.xml b/addons/account/report/account_entries_report_view.xml
index 0c3a77db2a7..5645c34d20c 100644
--- a/addons/account/report/account_entries_report_view.xml
+++ b/addons/account/report/account_entries_report_view.xml
@@ -93,7 +93,7 @@
-
+
diff --git a/addons/account/report/account_invoice_report_view.xml b/addons/account/report/account_invoice_report_view.xml
index 542b695e7dd..448f2abaf6d 100644
--- a/addons/account/report/account_invoice_report_view.xml
+++ b/addons/account/report/account_invoice_report_view.xml
@@ -111,7 +111,7 @@
-
+
diff --git a/addons/account/wizard/account_automatic_reconcile_view.xml b/addons/account/wizard/account_automatic_reconcile_view.xml
index 4cb5915f8e4..587b5cec733 100644
--- a/addons/account/wizard/account_automatic_reconcile_view.xml
+++ b/addons/account/wizard/account_automatic_reconcile_view.xml
@@ -28,8 +28,7 @@
-
-
+
@@ -64,7 +63,7 @@
-
+
diff --git a/addons/account/wizard/account_central_journal_view.xml b/addons/account/wizard/account_central_journal_view.xml
index dfe704c7051..b833af4a9dd 100644
--- a/addons/account/wizard/account_central_journal_view.xml
+++ b/addons/account/wizard/account_central_journal_view.xml
@@ -15,7 +15,7 @@
-
+
diff --git a/addons/account/wizard/account_change_currency_view.xml b/addons/account/wizard/account_change_currency_view.xml
index 5dca78673c5..3eae57dfe61 100644
--- a/addons/account/wizard/account_change_currency_view.xml
+++ b/addons/account/wizard/account_change_currency_view.xml
@@ -13,7 +13,7 @@
-
+
diff --git a/addons/account/wizard/account_chart_view.xml b/addons/account/wizard/account_chart_view.xml
index 56991301ad5..b621019dbe6 100644
--- a/addons/account/wizard/account_chart_view.xml
+++ b/addons/account/wizard/account_chart_view.xml
@@ -15,10 +15,10 @@
-
-
-
+
+
+
diff --git a/addons/account/wizard/account_invoice_state_view.xml b/addons/account/wizard/account_invoice_state_view.xml
index e0c22a0007f..8bdfb4ba8e2 100644
--- a/addons/account/wizard/account_invoice_state_view.xml
+++ b/addons/account/wizard/account_invoice_state_view.xml
@@ -10,7 +10,7 @@
-
+
@@ -43,8 +43,8 @@
diff --git a/addons/account/wizard/account_journal_select_view.xml b/addons/account/wizard/account_journal_select_view.xml
index 87d3814df85..eb081416e89 100644
--- a/addons/account/wizard/account_journal_select_view.xml
+++ b/addons/account/wizard/account_journal_select_view.xml
@@ -11,8 +11,8 @@
-
-
+
+
diff --git a/addons/account/wizard/account_move_bank_reconcile_view.xml b/addons/account/wizard/account_move_bank_reconcile_view.xml
index 89342803aaf..f17c2396255 100644
--- a/addons/account/wizard/account_move_bank_reconcile_view.xml
+++ b/addons/account/wizard/account_move_bank_reconcile_view.xml
@@ -13,8 +13,8 @@
-
-
+
+
diff --git a/addons/account/wizard/account_move_journal_view.xml b/addons/account/wizard/account_move_journal_view.xml
index c3a9e4ad75a..af9dd313255 100644
--- a/addons/account/wizard/account_move_journal_view.xml
+++ b/addons/account/wizard/account_move_journal_view.xml
@@ -16,8 +16,8 @@
-
-
+
+
diff --git a/addons/account/wizard/account_move_line_reconcile_select_view.xml b/addons/account/wizard/account_move_line_reconcile_select_view.xml
index 795ae925ef9..220c9e541de 100644
--- a/addons/account/wizard/account_move_line_reconcile_select_view.xml
+++ b/addons/account/wizard/account_move_line_reconcile_select_view.xml
@@ -13,8 +13,8 @@
-
-
+
diff --git a/addons/account/wizard/account_move_line_select_view.xml b/addons/account/wizard/account_move_line_select_view.xml
index d0b6a2f709a..bf3831baea0 100644
--- a/addons/account/wizard/account_move_line_select_view.xml
+++ b/addons/account/wizard/account_move_line_select_view.xml
@@ -11,8 +11,8 @@
-
-
+
+
diff --git a/addons/account/wizard/account_move_line_unreconcile_select_view.xml b/addons/account/wizard/account_move_line_unreconcile_select_view.xml
index 50449b36d2f..1daae353725 100644
--- a/addons/account/wizard/account_move_line_unreconcile_select_view.xml
+++ b/addons/account/wizard/account_move_line_unreconcile_select_view.xml
@@ -13,8 +13,8 @@
-
-
+
diff --git a/addons/account/wizard/account_open_closed_fiscalyear_view.xml b/addons/account/wizard/account_open_closed_fiscalyear_view.xml
index 421d3a319e4..afc7b7e6828 100644
--- a/addons/account/wizard/account_open_closed_fiscalyear_view.xml
+++ b/addons/account/wizard/account_open_closed_fiscalyear_view.xml
@@ -13,8 +13,8 @@
-
-
+
+
diff --git a/addons/account/wizard/account_partner_balance_report_view.xml b/addons/account/wizard/account_partner_balance_report_view.xml
index 55fb71553d7..35a2556982d 100644
--- a/addons/account/wizard/account_partner_balance_report_view.xml
+++ b/addons/account/wizard/account_partner_balance_report_view.xml
@@ -31,7 +31,7 @@
-
+
diff --git a/addons/account/wizard/account_period_close_view.xml b/addons/account/wizard/account_period_close_view.xml
index 0866e64bdb6..82e7f8b3f3a 100644
--- a/addons/account/wizard/account_period_close_view.xml
+++ b/addons/account/wizard/account_period_close_view.xml
@@ -16,7 +16,7 @@
-
+
diff --git a/addons/account/wizard/account_reconcile_view.xml b/addons/account/wizard/account_reconcile_view.xml
index 0f92376e045..1bed69d45fe 100644
--- a/addons/account/wizard/account_reconcile_view.xml
+++ b/addons/account/wizard/account_reconcile_view.xml
@@ -54,7 +54,7 @@
-
+
@@ -99,7 +99,7 @@
-
+
diff --git a/addons/account/wizard/account_statement_from_invoice_view.xml b/addons/account/wizard/account_statement_from_invoice_view.xml
index 6f17279888c..05b77a1d570 100644
--- a/addons/account/wizard/account_statement_from_invoice_view.xml
+++ b/addons/account/wizard/account_statement_from_invoice_view.xml
@@ -15,7 +15,7 @@
-
+
diff --git a/addons/account/wizard/account_use_model_view.xml b/addons/account/wizard/account_use_model_view.xml
index aeeac91a644..6ca3de7aa65 100644
--- a/addons/account/wizard/account_use_model_view.xml
+++ b/addons/account/wizard/account_use_model_view.xml
@@ -49,13 +49,14 @@
account.use.modelform
-
+
@@ -64,13 +65,14 @@
account.use.modelform
-
+
diff --git a/addons/account/wizard/account_validate_move_view.xml b/addons/account/wizard/account_validate_move_view.xml
index 8e006bf171f..3ef7f16d47c 100644
--- a/addons/account/wizard/account_validate_move_view.xml
+++ b/addons/account/wizard/account_validate_move_view.xml
@@ -17,7 +17,7 @@
-
+
diff --git a/addons/crm/report/crm_lead_report_view.xml b/addons/crm/report/crm_lead_report_view.xml
index 0601cd47c71..1eb4a2928a3 100644
--- a/addons/crm/report/crm_lead_report_view.xml
+++ b/addons/crm/report/crm_lead_report_view.xml
@@ -126,7 +126,7 @@
domain="[]"
context="{'group_by':'company_id'}" />
-
diff --git a/addons/crm/report/crm_phonecall_report_view.xml b/addons/crm/report/crm_phonecall_report_view.xml
index f1f5eb4a490..58136ea7a43 100644
--- a/addons/crm/report/crm_phonecall_report_view.xml
+++ b/addons/crm/report/crm_phonecall_report_view.xml
@@ -136,7 +136,7 @@
domain="[]"
context="{'group_by':'company_id'}" />
-
diff --git a/addons/crm_claim/report/crm_claim_report_view.xml b/addons/crm_claim/report/crm_claim_report_view.xml
index 7892039436c..0664295b83d 100644
--- a/addons/crm_claim/report/crm_claim_report_view.xml
+++ b/addons/crm_claim/report/crm_claim_report_view.xml
@@ -152,7 +152,7 @@
context="{'group_by':'type_id'}" />
-
-
-
+
diff --git a/addons/hr_evaluation/report/hr_evaluation_report_view.xml b/addons/hr_evaluation/report/hr_evaluation_report_view.xml
index 5406a7a3fbd..2a5cbe21ad9 100644
--- a/addons/hr_evaluation/report/hr_evaluation_report_view.xml
+++ b/addons/hr_evaluation/report/hr_evaluation_report_view.xml
@@ -82,7 +82,7 @@
-
+
diff --git a/addons/hr_expense/report/hr_expense_report_view.xml b/addons/hr_expense/report/hr_expense_report_view.xml
index bcc560573ab..b25ba45dd60 100644
--- a/addons/hr_expense/report/hr_expense_report_view.xml
+++ b/addons/hr_expense/report/hr_expense_report_view.xml
@@ -99,7 +99,7 @@
-
+
diff --git a/addons/hr_holidays/report/available_holidays_view.xml b/addons/hr_holidays/report/available_holidays_view.xml
index 5fd9a9c0199..327cdab032b 100644
--- a/addons/hr_holidays/report/available_holidays_view.xml
+++ b/addons/hr_holidays/report/available_holidays_view.xml
@@ -88,7 +88,7 @@
-
+
diff --git a/addons/hr_holidays/report/hr_holidays_report_view.xml b/addons/hr_holidays/report/hr_holidays_report_view.xml
index 24ea6745270..7f42982eaad 100644
--- a/addons/hr_holidays/report/hr_holidays_report_view.xml
+++ b/addons/hr_holidays/report/hr_holidays_report_view.xml
@@ -90,7 +90,7 @@
-
+
diff --git a/addons/hr_recruitment/report/hr_recruitment_report_view.xml b/addons/hr_recruitment/report/hr_recruitment_report_view.xml
index dc9c4cc78fa..2cfefa0d442 100644
--- a/addons/hr_recruitment/report/hr_recruitment_report_view.xml
+++ b/addons/hr_recruitment/report/hr_recruitment_report_view.xml
@@ -95,7 +95,7 @@
-
+
diff --git a/addons/hr_timesheet_invoice/report/hr_timesheet_invoice_report_view.xml b/addons/hr_timesheet_invoice/report/hr_timesheet_invoice_report_view.xml
index b3f81e5fbb1..882edfeee5a 100644
--- a/addons/hr_timesheet_invoice/report/hr_timesheet_invoice_report_view.xml
+++ b/addons/hr_timesheet_invoice/report/hr_timesheet_invoice_report_view.xml
@@ -76,7 +76,7 @@
-
+
diff --git a/addons/hr_timesheet_sheet/hr_timesheet_sheet_view.xml b/addons/hr_timesheet_sheet/hr_timesheet_sheet_view.xml
index 51edeea837b..cbaf4cd802f 100644
--- a/addons/hr_timesheet_sheet/hr_timesheet_sheet_view.xml
+++ b/addons/hr_timesheet_sheet/hr_timesheet_sheet_view.xml
@@ -105,12 +105,12 @@
-
+
-
-
-
+
+
+
@@ -121,8 +121,8 @@
-
-
+
+
@@ -176,10 +176,10 @@
-
-
-
-
+
+
+
+
diff --git a/addons/hr_timesheet_sheet/report/timesheet_report_view.xml b/addons/hr_timesheet_sheet/report/timesheet_report_view.xml
index 51e6b5d295c..4a6e486dac3 100644
--- a/addons/hr_timesheet_sheet/report/timesheet_report_view.xml
+++ b/addons/hr_timesheet_sheet/report/timesheet_report_view.xml
@@ -91,7 +91,7 @@
-
+
diff --git a/addons/idea/test/test_idea.yml b/addons/idea/test/test_idea.yml
index 4c3f5301a5a..bcb764f8933 100644
--- a/addons/idea/test/test_idea.yml
+++ b/addons/idea/test/test_idea.yml
@@ -19,13 +19,13 @@
user_id: base.user_root
- |
- I check that idea on draft state.
+ I check that the idea is in draft state.
-
!assert {model: idea.idea, id: idea_idea_0}:
- state == 'draft'
- |
- I open this idea by click on "Open" button.
+ I open this idea by clicking on the "Open" button.
-
!workflow {model: idea.idea, action: idea_open, ref: idea_idea_0}
diff --git a/addons/mrp/report/mrp_production_order_view.xml b/addons/mrp/report/mrp_production_order_view.xml
index 61aff34bf91..9c4d4924924 100644
--- a/addons/mrp/report/mrp_production_order_view.xml
+++ b/addons/mrp/report/mrp_production_order_view.xml
@@ -81,7 +81,7 @@
-
+
diff --git a/addons/point_of_sale/report/report_pos_order_view.xml b/addons/point_of_sale/report/report_pos_order_view.xml
index ecd3d431a3a..3efe9548c70 100644
--- a/addons/point_of_sale/report/report_pos_order_view.xml
+++ b/addons/point_of_sale/report/report_pos_order_view.xml
@@ -38,7 +38,6 @@
domain="[('date','<=', time.strftime('%%Y-%%m-%%d')),('date','>',(datetime.date.today()-datetime.timedelta(days=365)).strftime('%%Y-%%m-%%d'))]"
help="POS ordered created last 365 days"/>
+
-
@@ -76,7 +81,7 @@
-
+
@@ -90,7 +95,7 @@
formtree,graph
- {'search_default_month':1,'search_default_User':1}
+ {'search_default_today':1,'search_default_User':1}
diff --git a/addons/project/report/project_report_view.xml b/addons/project/report/project_report_view.xml
index 9b685001664..92edbc78d77 100644
--- a/addons/project/report/project_report_view.xml
+++ b/addons/project/report/project_report_view.xml
@@ -117,7 +117,7 @@
-
+
diff --git a/addons/project_issue/report/project_issue_report_view.xml b/addons/project_issue/report/project_issue_report_view.xml
index b4d0af02185..c422d987db5 100644
--- a/addons/project_issue/report/project_issue_report_view.xml
+++ b/addons/project_issue/report/project_issue_report_view.xml
@@ -93,7 +93,7 @@
-
@@ -118,7 +118,7 @@
context="{'group_by':'company_id'}" />
-
-
-
+
diff --git a/addons/purchase/report/purchase_report_view.xml b/addons/purchase/report/purchase_report_view.xml
index 2d18ae18b36..6b27a0ec6df 100644
--- a/addons/purchase/report/purchase_report_view.xml
+++ b/addons/purchase/report/purchase_report_view.xml
@@ -52,24 +52,24 @@
-
-
-
-
-
@@ -80,21 +80,21 @@
-
-
-
+
+
+
-
-
+
+
-
-
-
+
+
+
-
-
-
-
+
+
+
+
diff --git a/addons/sale/report/sale_report_view.xml b/addons/sale/report/sale_report_view.xml
index 4e6d75694fe..41ebc1de088 100644
--- a/addons/sale/report/sale_report_view.xml
+++ b/addons/sale/report/sale_report_view.xml
@@ -78,7 +78,7 @@
-
@@ -99,7 +99,7 @@
-
+
diff --git a/addons/sale_order_dates/__openerp__.py b/addons/sale_order_dates/__openerp__.py
index e8a2cf6e6b6..0f7a56fba20 100644
--- a/addons/sale_order_dates/__openerp__.py
+++ b/addons/sale_order_dates/__openerp__.py
@@ -21,11 +21,13 @@
{
- 'name': 'Customer & Sales',
+ 'name': 'Sale Order Dates',
'version': '1.0',
'category': 'Generic Modules/CRM & SRM',
- 'description': """Sale Orders Dates""",
- 'author': 'Tiny',
+ 'description': """
+Add commitment, requested and effective dates on the sale order.
+""",
+ 'author': 'OpenERP SA',
'website': 'http://www.openerp.com',
'depends': ["sale"],
'init_xml': [
diff --git a/addons/sale_order_dates/sale.py b/addons/sale_order_dates/sale.py
index 1b4bad360e6..877199b32ad 100644
--- a/addons/sale_order_dates/sale.py
+++ b/addons/sale_order_dates/sale.py
@@ -48,7 +48,8 @@ class sale_order_dates(osv.osv):
dt=DateTime.strptime(order.date_order, '%Y-%m-%d') + DateTime.RelativeDateTime(days=line.delay or 0.0)
dt_s = dt.strftime('%Y-%m-%d')
dates_list.append(dt_s)
- res[order.id] = min(dates_list)
+ if dates_list:
+ res[order.id] = min(dates_list)
return res
_columns = {
diff --git a/addons/sale_order_dates/sale_view.xml b/addons/sale_order_dates/sale_view.xml
index 7f5edf811ef..54248fa0176 100644
--- a/addons/sale_order_dates/sale_view.xml
+++ b/addons/sale_order_dates/sale_view.xml
@@ -2,22 +2,20 @@
-
+ sale.order.form.inherit5sale.orderform
-
-
+
-
-
+
-
+
-
+
diff --git a/addons/stock/report/report_stock_move_view.xml b/addons/stock/report/report_stock_move_view.xml
index e8ec9ed2983..0f41c0e4b3b 100644
--- a/addons/stock/report/report_stock_move_view.xml
+++ b/addons/stock/report/report_stock_move_view.xml
@@ -98,7 +98,7 @@
-
+
diff --git a/addons/stock/report/report_stock_picking_view.xml b/addons/stock/report/report_stock_picking_view.xml
index a14298ff771..83405f2c1bf 100644
--- a/addons/stock/report/report_stock_picking_view.xml
+++ b/addons/stock/report/report_stock_picking_view.xml
@@ -83,7 +83,7 @@
-
+
diff --git a/addons/stock/stock.py b/addons/stock/stock.py
index 6ffd60fd5b0..06f3fa44e55 100644
--- a/addons/stock/stock.py
+++ b/addons/stock/stock.py
@@ -2262,7 +2262,7 @@ class stock_inventory(osv.osv):
'prodlot_id': lot_id,
'date': inv.date,
'date_planned': inv.date,
- 'state': 'assigned'
+ 'state': 'done'
}
if change > 0:
value.update( {
@@ -2282,9 +2282,6 @@ class stock_inventory(osv.osv):
'product_qty': line.product_qty
})
move_ids.append(self._inventory_line_hook(cr, uid, line, value))
- if len(move_ids):
- self.pool.get('stock.move').action_done(cr, uid, move_ids,
- context=context)
self.write(cr, uid, [inv.id], {'state': 'done', 'date_done': time.strftime('%Y-%m-%d %H:%M:%S'), 'move_ids': [(6, 0, move_ids)]})
return True
diff --git a/addons/stock/stock_view.xml b/addons/stock/stock_view.xml
index ab33b07aacb..3fdfda9e057 100644
--- a/addons/stock/stock_view.xml
+++ b/addons/stock/stock_view.xml
@@ -322,6 +322,7 @@
+
diff --git a/addons/stock_avg_consommation/__init__.py b/addons/stock_avg_consommation/__init__.py
deleted file mode 100644
index c4d17a90d9a..00000000000
--- a/addons/stock_avg_consommation/__init__.py
+++ /dev/null
@@ -1,25 +0,0 @@
-# -*- coding: utf-8 -*-
-##############################################################################
-#
-# OpenERP, Open Source Management Solution
-# Copyright (C) 2004-2010 Tiny SPRL ().
-#
-# This program is free software: you can redistribute it and/or modify
-# it under the terms of the GNU Affero General Public License as
-# published by the Free Software Foundation, either version 3 of the
-# License, or (at your option) any later version.
-#
-# This program is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-# GNU Affero General Public License for more details.
-#
-# You should have received a copy of the GNU Affero General Public License
-# along with this program. If not, see .
-#
-##############################################################################
-
-import stock_avg_consommation
-import wizard
-
-# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
diff --git a/addons/stock_avg_consommation/__openerp__.py b/addons/stock_avg_consommation/__openerp__.py
deleted file mode 100644
index 37008770cae..00000000000
--- a/addons/stock_avg_consommation/__openerp__.py
+++ /dev/null
@@ -1,35 +0,0 @@
-# -*- coding: utf-8 -*-
-##############################################################################
-#
-# OpenERP, Open Source Management Solution
-# Copyright (C) 2004-2010 Tiny SPRL ().
-#
-# This program is free software: you can redistribute it and/or modify
-# it under the terms of the GNU Affero General Public License as
-# published by the Free Software Foundation, either version 3 of the
-# License, or (at your option) any later version.
-#
-# This program is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-# GNU Affero General Public License for more details.
-#
-# You should have received a copy of the GNU Affero General Public License
-# along with this program. If not, see .
-#
-##############################################################################
-
-
-{
- 'name': 'Stock Average consommation',
- 'version': '1.0',
- 'category': 'Generic Modules/Inventory Control',
- 'author': 'Tiny',
- 'depends': ['stock'],
- 'init_xml': [],
- 'update_xml': ['stock_avg_consommation_view.xml'],
- 'demo_xml': [],
- 'installable': True,
- 'active': False,
-}
-# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
diff --git a/addons/stock_avg_consommation/stock_avg_consommation.py b/addons/stock_avg_consommation/stock_avg_consommation.py
deleted file mode 100644
index b9dab63d18b..00000000000
--- a/addons/stock_avg_consommation/stock_avg_consommation.py
+++ /dev/null
@@ -1,100 +0,0 @@
-# -*- coding: utf-8 -*-
-##############################################################################
-#
-# OpenERP, Open Source Management Solution
-# Copyright (C) 2004-2010 Tiny SPRL ().
-#
-# This program is free software: you can redistribute it and/or modify
-# it under the terms of the GNU Affero General Public License as
-# published by the Free Software Foundation, either version 3 of the
-# License, or (at your option) any later version.
-#
-# This program is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-# GNU Affero General Public License for more details.
-#
-# You should have received a copy of the GNU Affero General Public License
-# along with this program. If not, see .
-#
-##############################################################################
-
-from osv import fields,osv
-import tools
-import ir
-import pooler
-from mx import DateTime
-from datetime import datetime
-import time
-from dateutil.relativedelta import relativedelta
-
-class stock_avg_consommation(osv.osv):
- _name = "stock.avg.consommation"
- _inherit="product.product"
-
- def _compute_avg_consommation(self, cr, uid, ids, fields, args, context={}):
- print ids, fields, args, context
- date_str=False
- from_date=context.get('from_date',False)
- to_date=context.get('to_date',False)
-
- if from_date and to_date:
- date_str="date_planned>='%s' and date_planned<='%s'"%(from_date,to_date)
- elif from_date:
- date_str="date_planned>='%s'"%(from_date)
- elif to_date:
- date_str="date_planned<='%s'"%(to_date)
-
- date_object_to = to_date and datetime.strptime(to_date, '%Y-%m-%d %H:%M:%S') or datetime.now()
- date_object_from = from_date and datetime.strptime(from_date, '%Y-%m-%d %H:%M:%S') or (datetime.now() + relativedelta(days=-30))
- dd = date_object_to - date_object_from
- total_days=dd.days+1
- if not from_date and not to_date:
- date_str="date_planned>='%s' and date_planned<='%s'"%(date_object_from.strftime('%Y-%m-%d 00:00:00'), date_object_to.strftime('%Y-%m-%d 23:59:59'))
- elif not from_date:
- date_str="date_planned>='%s'"%(date_object_from.strftime('%Y-%m-%d 00:00:00'))
- elif not to_date:
- date_str="date_planned<='%s'"%(date_object_to.strftime('%Y-%m-%d 23:59:59'))
- res={}
- for line_id in ids:
- res[line_id] = False
- location_ids = []
-
- if context.get('location', False):
- if type(context['location']) == type(1):
- location_ids = [context['location']]
- elif type(context['location']) in (type(''), type(u'')):
- location_ids = self.pool.get('stock.location').search(cr, uid, [('name','ilike',context['location'])], context=context)
- else:
- location_ids = context['location']
- else:
- location_ids = []
- wids = self.pool.get('stock.warehouse').search(cr, uid, [], context=context)
- for w in self.pool.get('stock.warehouse').browse(cr, uid, wids, context=context):
- location_ids.append(w.lot_stock_id.id)
-
- # build the list of ids of children of the location given by id
- if context.get('compute_child',True):
- child_location_ids = self.pool.get('stock.location').search(cr, uid, [('location_id', 'child_of', location_ids)])
- location_ids = child_location_ids or location_ids
- else:
- location_ids = location_ids
-
-
-
- #sql = """select product_id,sum(product_qty) from stock_move sm,stock_picking sp where sm.picking_id=sp.id and sp.type in ('out','delivery') and %s and location_id <> ANY(%s) and location_dest_id =ANY(%s) group by product_id""" % (date_str, location_ids, location_ids)
- sql = """select product_id,sum(product_qty) from stock_move sm,stock_picking sp where sm.picking_id=sp.id and sp.type in ('out','delivery') and """+date_str+""" and sm.location_id not in %s and sm.location_dest_id in %s group by product_id"""
- cr.execute(sql, [tuple(location_ids), tuple(location_ids)])
- product_ids = []
- res_sum = cr.fetchall()
- for line_id, avg in res_sum:
- res[line_id] = avg/total_days
- product_ids.append(avg)
- return res
-
- _columns = {
- 'avg_consommation':fields.function(_compute_avg_consommation,method=True, type='float', string="Average Consommation"),
- }
-stock_avg_consommation()
-
-# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
diff --git a/addons/stock_avg_consommation/stock_avg_consommation_view.xml b/addons/stock_avg_consommation/stock_avg_consommation_view.xml
deleted file mode 100644
index d9afed69af3..00000000000
--- a/addons/stock_avg_consommation/stock_avg_consommation_view.xml
+++ /dev/null
@@ -1,18 +0,0 @@
-
-
-
-
- stock.avg.consommation.tree
- stock.avg.consommation
- tree
-
-
-
-
-
-
-
-
-
-
-
diff --git a/addons/stock_avg_consommation/wizard/__init__.py b/addons/stock_avg_consommation/wizard/__init__.py
deleted file mode 100644
index a7d7cfed3dc..00000000000
--- a/addons/stock_avg_consommation/wizard/__init__.py
+++ /dev/null
@@ -1,24 +0,0 @@
-# -*- coding: utf-8 -*-
-##############################################################################
-#
-# OpenERP, Open Source Management Solution
-# Copyright (C) 2004-2010 Tiny SPRL ().
-#
-# This program is free software: you can redistribute it and/or modify
-# it under the terms of the GNU Affero General Public License as
-# published by the Free Software Foundation, either version 3 of the
-# License, or (at your option) any later version.
-#
-# This program is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-# GNU Affero General Public License for more details.
-#
-# You should have received a copy of the GNU Affero General Public License
-# along with this program. If not, see .
-#
-##############################################################################
-
-import stock_avg_consommation_wizard
-
-# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
diff --git a/addons/stock_avg_consommation/wizard/stock_avg_consommation_wizard.py b/addons/stock_avg_consommation/wizard/stock_avg_consommation_wizard.py
deleted file mode 100644
index 7d5d8657aa2..00000000000
--- a/addons/stock_avg_consommation/wizard/stock_avg_consommation_wizard.py
+++ /dev/null
@@ -1,57 +0,0 @@
-# -*- coding: utf-8 -*-
-##############################################################################
-#
-# OpenERP, Open Source Management Solution
-# Copyright (C) 2004-2010 Tiny SPRL ().
-#
-# This program is free software: you can redistribute it and/or modify
-# it under the terms of the GNU Affero General Public License as
-# published by the Free Software Foundation, either version 3 of the
-# License, or (at your option) any later version.
-#
-# This program is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-# GNU Affero General Public License for more details.
-#
-# You should have received a copy of the GNU Affero General Public License
-# along with this program. If not, see .
-#
-##############################################################################
-
-from osv import fields, osv
-
-class stock_location_product(osv.osv_memory):
- _inherit = "stock.location.product"
-
- def action_open_window(self, cr, uid, ids, context):
- """ To open location wise product information specific to given duration
- @param self: The object pointer.
- @param cr: A database cursor
- @param uid: ID of the user currently logged in
- @param ids: An ID or list of IDs if we want more than one
- @param context: A standard dictionary
- @return: Invoice type
- """
-
- mod_obj = self.pool.get('ir.model.data')
- view = mod_obj._get_id(cr, uid, 'stock_avg_consommation', 'stock_avg_consommation_tree')
- id = mod_obj.read(cr, uid, view, ['res_id'])
-
- for location_obj in self.read(cr, uid, ids, ['from_date', 'to_date']):
- return {
- 'name': False,
- 'view_id':[id['res_id']],
- 'view_type': 'form',
- 'view_mode': 'tree,form',
- 'res_model': 'stock.avg.consommation',
- 'type': 'ir.actions.act_window',
- 'context': {'location': context['active_id'],
- 'from_date': location_obj['from_date'],
- 'to_date': location_obj['to_date']},
- 'domain': [('type', '<>', 'service')],
- }
-
-stock_location_product()
-
-# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
\ No newline at end of file