@@ -288,13 +276,7 @@
-
-
-
-
-
-
-
+
\ No newline at end of file
diff --git a/addons/account/report/account_aged_partner_balance.py b/addons/account/report/account_aged_partner_balance.py
index 22b04e05f39..5936e29fe29 100644
--- a/addons/account/report/account_aged_partner_balance.py
+++ b/addons/account/report/account_aged_partner_balance.py
@@ -62,7 +62,6 @@ class aged_trial_report(rml_parse.rml_parse, common_report_header):
def _get_lines(self, form):
res = []
- account_move_line_obj = pooler.get_pool(self.cr.dbname).get('account.move.line')
self.cr.execute('SELECT DISTINCT res_partner.id AS id,\
res_partner.name AS name \
FROM res_partner,account_move_line AS l, account_account\
@@ -219,7 +218,6 @@ class aged_trial_report(rml_parse.rml_parse, common_report_header):
def _get_lines_with_out_partner(self, form):
res = []
- account_move_line_obj = pooler.get_pool(self.cr.dbname).get('account.move.line')
move_state = ['draft','posted']
if self.target_move == 'posted':
move_state = ['posted']
diff --git a/addons/account/report/account_balance_sheet_horizontal.rml b/addons/account/report/account_balance_sheet_horizontal.rml
index 08b9030a968..bde0d2786d0 100644
--- a/addons/account/report/account_balance_sheet_horizontal.rml
+++ b/addons/account/report/account_balance_sheet_horizontal.rml
@@ -233,7 +233,7 @@
[[ '. '*(a['level']-1) ]][[ a['level']<4 and ( setTag('para','para',{'style':'terp_default_Bold_9'})) or removeParentNode('font') ]][[ a['name'] ]]
- [[ a['level1']<4 and ( setTag('para','para',{'style':'terp_default_Right_9_Bold'})) or removeParentNode('font') ]][[ formatLang(abs(a['balance'])) ]] [[ company.currency_id.symbol ]]
+ [[ a['level1']<4 and ( setTag('para','para',{'style':'terp_default_Right_9_Bold'})) or removeParentNode('font') ]][[(a['code'] and a['name']) and formatLang(abs(a['balance'])) or removeParentNode('font')]] [[ company.currency_id.symbol ]]
[[ line['currency_id'] and formatLang(line['amount_currency'] ) ]] [[ line['currency_code'] or '' ]]
+
[[ (line['currency_id']==None or line['amount_currency']==None) and removeParentNode('font') ]] [[ formatLang(line['amount_currency'] ) ]] [[ line['currency_code'] or '' ]]
diff --git a/addons/account/report/account_general_ledger.py b/addons/account/report/account_general_ledger.py
index f3ec97a592e..d35f0603ded 100644
--- a/addons/account/report/account_general_ledger.py
+++ b/addons/account/report/account_general_ledger.py
@@ -161,7 +161,7 @@ class general_ledger(rml_parse.rml_parse, common_report_header):
else:
sql_sort='l.date'
sql = """
- SELECT l.id AS lid, l.date AS ldate, j.code AS lcode, l.amount_currency,l.ref AS lref, l.name AS lname, COALESCE(l.debit,0) AS debit, COALESCE(l.credit,0) AS credit, l.period_id AS lperiod_id, l.partner_id AS lpartner_id,
+ SELECT l.id AS lid, l.date AS ldate, j.code AS lcode, l.currency_id,l.amount_currency,l.ref AS lref, l.name AS lname, COALESCE(l.debit,0) AS debit, COALESCE(l.credit,0) AS credit, l.period_id AS lperiod_id, l.partner_id AS lpartner_id,
m.name AS move_name, m.id AS mmove_id,
c.symbol AS currency_code,
i.id AS invoice_id, i.type AS invoice_type, i.number AS invoice_number,
diff --git a/addons/account/report/account_general_ledger.rml b/addons/account/report/account_general_ledger.rml
index 6ac6cd51286..917ffa214d8 100644
--- a/addons/account/report/account_general_ledger.rml
+++ b/addons/account/report/account_general_ledger.rml
@@ -334,7 +334,7 @@
[[ formatLang(line['amount_currency'] or '') ]] [[ line['currency_code'] or '']]
+
[[ (line['currency_id']==None or line['amount_currency']==None) and removeParentNode('font') ]] [[ formatLang(line['amount_currency'])]] [[ line['currency_code'] or '']]
[[ (line['currency_id']==None or line['amount_currency']==None) and removeParentNode('font') ]] [[ formatLang(line['amount_currency'])]] [[ line['currency_code'] or '']]
- [[ (line['account_id']['type'] == 'receivable' and formatLang(line['debit']) or 0) or (line['account_id']['type'] == 'payable' and formatLang(line['credit'] * -1) or ' ') ]]
+ [[ (line['account_id']['type'] == 'receivable' and formatLang(line['debit']) or 0) or (line['account_id']['type'] == 'payable' and formatLang(line['credit'] * -1) or ' ') ]]
- [[ (line['account_id']['type'] == 'receivable' and formatLang(line['credit']) or 0) or (line['account_id']['type'] == 'payable' and formatLang(line['debit'] * -1) or 0) ]]
+ [[ (line['account_id']['type'] == 'receivable' and formatLang(line['credit']) or 0) or (line['account_id']['type'] == 'payable' and formatLang(line['debit'] * -1) or 0) ]]
- [[ formatLang((reduce(lambda x, y: x + ((y['account_id']['type'] == 'receivable' and y['debit'] or 0) or (y['account_id']['type'] == 'payable' and y['credit'] * -1 or 0)), getLines(o), 0))) ]]
+ [[ formatLang((reduce(lambda x, y: x + ((y['account_id']['type'] == 'receivable' and y['debit'] or 0) or (y['account_id']['type'] == 'payable' and y['credit'] * -1 or 0)), getLines(o), 0))) ]]
[[ formatLang((reduce(lambda x, y: x + ((y['account_id']['type'] == 'receivable' and y['credit'] or 0) or (y['account_id']['type'] == 'payable' and y['debit'] * -1 or 0)), getLines(o), 0))) ]]
@@ -220,6 +222,8 @@
- [[ a['level']<4 and ( setTag('para','para',{'style':'terp_default_Right_9_Bold'})) or removeParentNode('font') ]][[ formatLang(abs(a['balance1'])) ]] [[ company.currency_id.symbol ]]
+ [[ a['level']<4 and ( setTag('para','para',{'style':'terp_default_Right_9_Bold'})) or removeParentNode('font') ]][[(a['code1'] and a['name1']) and formatLang(abs(a['balance1'])) or removeParentNode('font') ]] [[ company.currency_id.symbol ]]
@@ -1764,9 +1819,9 @@
search
-
+
-
+
@@ -1778,12 +1833,13 @@
+
-
+
@@ -1801,7 +1857,7 @@
tree,form['|','&',('picking_id','=',False),('location_id.usage', 'in', ['customer','supplier']),'&',('picking_id','!=',False),('picking_id.type','=','in')]
-
+ {"search_default_receive":1}
@@ -1863,7 +1919,7 @@
@@ -1878,7 +1934,7 @@
context="{'location': active_id, 'search_default_future': 1,'search_default_product_id': [active_id]}"
domain="[('state','in',('waiting','confirmed','assigned'))]"
id="act_product_stock_move_futur_open"
- name="Future Inventory Moves"
+ name="Future Stock Moves"
res_model="stock.move"
src_model="product.product"
groups="base.group_extended"/>
@@ -1899,80 +1955,6 @@
-
-
-
-
- Products To Received
- report.products.to.received.planned
- tree
-
-
-
-
-
-
-
-
-
-
- Products To Received
- report.products.to.received.planned
- graph
-
-
-
-
-
-
-
-
-
-
- Number of Products to receive Vs planned
- report.products.to.received.planned
- ir.actions.act_window
- form
- graph,tree
-
-
-
-
-
- Delivered Products
- report.delivery.products.planned
- tree
-
-
-
-
-
-
-
-
-
-
- Delivered Products
- report.delivery.products.planned
- graph
-
-
-
-
-
-
-
-
-
-
- Delivered Products Vs Planned
- report.delivery.products.planned
- ir.actions.act_window
- form
- graph,tree
-
-
-
Customers Packingsstock.picking
@@ -2009,7 +1991,7 @@
tree,form['|','&',('picking_id','=',False),('location_dest_id.usage', 'in', ['customer','supplier']),'&',('picking_id','!=',False),('picking_id.type','=','out')]
-
+ {"search_default_receive":1}
@@ -2072,7 +2054,7 @@
diff --git a/addons/stock/stock_workflow.xml b/addons/stock/stock_workflow.xml
index 3254f7b6984..7a1f786ebf8 100644
--- a/addons/stock/stock_workflow.xml
+++ b/addons/stock/stock_workflow.xml
@@ -86,21 +86,23 @@
- test_finnished()
+ test_finished()
- not test_finnished()
+ not test_finished()
+ allow_cancel()button_cancel
+ allow_cancel()button_cancel
diff --git a/addons/stock/test/stock_report.yml b/addons/stock/test/stock_report.yml
index 491fd7fa9d7..48396019c6c 100644
--- a/addons/stock/test/stock_report.yml
+++ b/addons/stock/test/stock_report.yml
@@ -1,22 +1,14 @@
-
In order to test the PDF reports defined on a stock, we will print a Stock Overviewall(childs) report
--
+-
!python {model: stock.location}: |
import netsvc, tools, os
(data, format) = netsvc.LocalService('report.lot.stock.overview_all').create(cr, uid, [ref('stock.stock_location_13')], {}, {})
if tools.config['test_report_directory']:
file(os.path.join(tools.config['test_report_directory'], 'stock-overviewall'+format), 'wb+').write(data)
--
- In order to test the PDF reports defined on stock location, we will print a lot location report
--
- !python {model: stock.location}: |
- import netsvc, tools, os
- (data, format) = netsvc.LocalService('report.lot.location').create(cr, uid, [ref('stock.stock_location_components')], {}, {})
- if tools.config['test_report_directory']:
- file(os.path.join(tools.config['test_report_directory'], 'stock-stock_lot_location.'+format), 'wb+').write(data)
-
In order to test the PDF reports defined on stock inventory, we will print a Stock Inventory Move report
--
+-
!python {model: stock.inventory}: |
import netsvc, tools, os
(data, format) = netsvc.LocalService('report.stock.inventory.move').create(cr, uid, [ref('stock.stock_inventory_0')], {}, {})
@@ -24,7 +16,7 @@
file(os.path.join(tools.config['test_report_directory'], 'stock-stock_inventory_move.'+format), 'wb+').write(data)
-
In order to test the PDF reports defined on a stock, we will print a Stock Overview report
--
+-
!python {model: stock.location}: |
import netsvc, tools, os
(data, format) = netsvc.LocalService('report.lot.stock.overview').create(cr, uid, [ref('stock.stock_location_14')], {}, {})
@@ -32,17 +24,17 @@
file(os.path.join(tools.config['test_report_directory'], 'stock-overview'+format), 'wb+').write(data)
-
In order to test the PDF reports defined on a stock, we will print a Stock Picking List report
--
+-
!python {model: stock.picking}: |
import netsvc, tools, os
- (data, format) = netsvc.LocalService('report.stock.picking.list').create(cr, uid, [ref('stock.stock_picking_1')], {}, {})
+ (data, format) = netsvc.LocalService('report.stock.picking.list').create(cr, uid, [ref('stock.stock_picking_0')], {}, {})
if tools.config['test_report_directory']:
file(os.path.join(tools.config['test_report_directory'], 'stock-picking_list'+format), 'wb+').write(data)
-
In order to test the PDF reports defined on a Stock, we will print Product Stock Report
--
+-
!python {model: product.product}: |
import netsvc, tools, os
(data, format) = netsvc.LocalService('report.stock.product.history').create(cr, uid, [ref('product.product_product_pc1')], {}, {})
if tools.config['test_report_directory']:
- file(os.path.join(tools.config['test_report_directory'], 'stock-product_stock_report.'+format), 'wb+').write(data)
\ No newline at end of file
+ file(os.path.join(tools.config['test_report_directory'], 'stock-product_stock_report.'+format), 'wb+').write(data)
diff --git a/addons/stock/test/stock_test.yml b/addons/stock/test/stock_test.yml
index 442cc8735b9..8b54e555a7b 100644
--- a/addons/stock/test/stock_test.yml
+++ b/addons/stock/test/stock_test.yml
@@ -53,7 +53,7 @@
I create Receivable Account .
-
!record {model: account.account, id: account_account_receivable0}:
- code: '40000'
+ code: '40000-stock-test'
company_id: base.main_company
currency_mode: current
name: Receivable
@@ -65,7 +65,7 @@
I create Payable Account.
-
!record {model: account.account, id: account_account_payable0}:
- code: '440000'
+ code: '440000-stock-test'
company_id: base.main_company
currency_mode: current
name: Payable
@@ -111,7 +111,7 @@
I create Product Sale Account.
-
!record {model: account.account, id: account_account_productsale0}:
- code: '001'
+ code: '001-stock-test'
company_id: base.main_company
currency_mode: current
name: Product Sale
@@ -123,7 +123,7 @@
I create Product Purchase Account.
-
!record {model: account.account, id: account_account_productpurchase0}:
- code: '0002'
+ code: '0002-stock-test'
company_id: base.main_company
currency_mode: current
name: Product Purchase
@@ -267,7 +267,7 @@
-
!record {model: stock.move.split, id: stock_move_split_0}:
line_ids:
- - name: '00001'
+ - name: '00001-stock-test'
quantity: 5
product_id: stock.product_product_hpcdwriters0
@@ -288,17 +288,17 @@
-
!record {model: stock.picking, id: stock_picking_0}:
name: test_picking
- address_id: res_partner_address_0
+ address_id: base.res_partner_address_4
company_id: base.main_company
date: '2010-05-11 15:18:52'
invoice_state: none
move_lines:
- company_id: base.main_company
- date_planned: '2010-05-11 15:18:57'
+ date: '2010-05-11 15:18:57'
location_dest_id: stock.stock_location_customers
location_id: stock.stock_location_stock
name: HP CD writers
- product_id: stock.product_product_hpcdwriters0
+ product_id: product.product_product_pc1
product_qty: 3.0
product_uom: product.product_uom_unit
date: '2010-05-11 15:18:57'
@@ -343,4 +343,4 @@
'product_qty': move.product_qty,
'product_uom': move.product_uom.id,
}
- self.do_partial(cr, uid, [ref('stock_picking_0')],partial_datas)
\ No newline at end of file
+ self.do_partial(cr, uid, [ref('stock_picking_0')],partial_datas)
diff --git a/addons/stock/wizard/__init__.py b/addons/stock/wizard/__init__.py
index 7a13dc26fd5..f6021e0fbe2 100644
--- a/addons/stock/wizard/__init__.py
+++ b/addons/stock/wizard/__init__.py
@@ -27,7 +27,6 @@ import stock_partial_move
import stock_replacement
import stock_ups
import stock_inventory_merge
-import stock_inventory_set_stock_zero
import stock_fill_inventory
import stock_inventory_line_split
import stock_invoice_onshipping
diff --git a/addons/stock/wizard/stock_change_standard_price.py b/addons/stock/wizard/stock_change_standard_price.py
index 47fb5387f26..ecbaef57a36 100644
--- a/addons/stock/wizard/stock_change_standard_price.py
+++ b/addons/stock/wizard/stock_change_standard_price.py
@@ -21,12 +21,13 @@
from osv import fields, osv
from tools.translate import _
+import decimal_precision as dp
class change_standard_price(osv.osv_memory):
_name = "stock.change.standard.price"
_description = "Change Standard Price"
_columns = {
- 'new_price': fields.float('Price', required=True,
+ 'new_price': fields.float('Price', required=True, digits_compute=dp.get_precision('Account'),
help="If cost price is increased, stock variation account will be debited "
"and stock output account will be credited with the value = (difference of amount * quantity available).\n"
"If cost price is decreased, stock variation account will be creadited and stock input account will be debited."),
diff --git a/addons/stock/wizard/stock_fill_inventory.py b/addons/stock/wizard/stock_fill_inventory.py
index e133a9fc879..599377fec1e 100644
--- a/addons/stock/wizard/stock_fill_inventory.py
+++ b/addons/stock/wizard/stock_fill_inventory.py
@@ -24,14 +24,32 @@ from tools.translate import _
class stock_fill_inventory(osv.osv_memory):
_name = "stock.fill.inventory"
- _description = "Fill Inventory"
+ _description = "Import Inventory"
_columns = {
'location_id': fields.many2one('stock.location', 'Location', required=True),
- 'recursive': fields.boolean("Include all children for the location"),
+ 'recursive': fields.boolean("Include children",help="If checked, products contained in child locations of selected location will be included as well."),
+ 'set_stock_zero': fields.boolean("Set to zero",help="If checked, all product quantities will be set to zero to help ensure a real physical inventory is done"),
}
+ def view_init(self, cr, uid, fields_list, context=None):
+ """
+ Creates view dynamically and adding fields at runtime.
+ @param self: The object pointer.
+ @param cr: A database cursor
+ @param uid: ID of the user currently logged in
+ @param context: A standard dictionary
+ @return: New arch of view with new columns.
+ """
+ if context==None:
+ context={}
+ res = super(stock_fill_inventory, self).view_init(cr, uid, fields_list, context=context)
+ if context.get('active_id', False):
+ stock = self.pool.get('stock.inventory').browse(cr, uid, context.get('active_id', False))
+ if stock.state=='done':
+ raise osv.except_osv('Error!','Stock Inventory is done')
+ True
- def fill_inventory(self, cr, uid, ids, context):
- """ To fill stock inventory according to products available in the selected locations.
+ def fill_inventory(self, cr, uid, ids, context=None):
+ """ To Import stock inventory according to products available in the selected locations.
@param self: The object pointer.
@param cr: A database cursor
@param uid: ID of the user currently logged in
@@ -39,36 +57,43 @@ class stock_fill_inventory(osv.osv_memory):
@param context: A standard dictionary
@return:
"""
+ if context==None:
+ context={}
inventory_line_obj = self.pool.get('stock.inventory.line')
location_obj = self.pool.get('stock.location')
product_obj = self.pool.get('product.product')
stock_location_obj = self.pool.get('stock.location')
- for fill_inventory in self.browse(cr, uid, ids):
- res = {}
- res_location = {}
- if fill_inventory.recursive :
- location_ids = location_obj.search(cr, uid, [('location_id',
- 'child_of', fill_inventory.location_id.id)])
- for location in location_ids :
- res = location_obj._product_get(cr, uid, location)
- res_location[location] = res
- else:
- context.update({'compute_child': False})
- res = location_obj._product_get(cr, uid,
- fill_inventory.location_id.id, context=context)
- res_location[fill_inventory.location_id.id] = res
-
+ if ids and len(ids):
+ ids = ids[0]
+ else:
+ return {}
+ fill_inventory = self.browse(cr, uid, ids)
+ res = {}
+ res_location = {}
+ if fill_inventory.recursive :
+ location_ids = location_obj.search(cr, uid, [('location_id',
+ 'child_of', fill_inventory.location_id.id)])
+ for location in location_ids :
+ res = location_obj._product_get(cr, uid, location)
+ res_location[location] = res
+ else:
+ context.update({'compute_child': False})
+ res = location_obj._product_get(cr, uid,
+ fill_inventory.location_id.id, context=context)
+ res_location[fill_inventory.location_id.id] = res
+
product_ids = []
for location in res_location.keys():
res = res_location[location]
for product_id in res.keys():
prod = product_obj.browse(cr, uid, [product_id])[0]
uom = prod.uom_id.id
- context.update({'uom': uom})
+ context.update(uom=uom, compute_child=False)
amount = stock_location_obj._product_get(cr, uid,
location, [product_id], context=context)[product_id]
-
if(amount):
+ if fill_inventory.set_stock_zero:
+ amount = 0
line_ids=inventory_line_obj.search(cr, uid,
[('inventory_id', '=', context['active_ids']),
('location_id', '=', location),
diff --git a/addons/stock/wizard/stock_fill_inventory_view.xml b/addons/stock/wizard/stock_fill_inventory_view.xml
index ef95a3bf447..3db42eb7be5 100644
--- a/addons/stock/wizard/stock_fill_inventory_view.xml
+++ b/addons/stock/wizard/stock_fill_inventory_view.xml
@@ -2,28 +2,30 @@
- Fill Inventory
+ Import Inventorystock.fill.inventoryform
-
-
+
+
+
-
+
-
diff --git a/addons/stock/wizard/stock_inventory_merge.py b/addons/stock/wizard/stock_inventory_merge.py
index 46c589f18e9..cbb9f380cb1 100644
--- a/addons/stock/wizard/stock_inventory_merge.py
+++ b/addons/stock/wizard/stock_inventory_merge.py
@@ -25,7 +25,25 @@ from tools.translate import _
class stock_inventory_merge(osv.osv_memory):
_name = "stock.inventory.merge"
_description = "Merge Inventory"
-
+
+ def fields_view_get(self, cr, uid, view_id=None, view_type='form',
+ context=None, toolbar=False, submenu=False):
+ """
+ Changes the view dynamically
+ @param self: The object pointer.
+ @param cr: A database cursor
+ @param uid: ID of the user currently logged in
+ @param context: A standard dictionary
+ @return: New arch of view.
+ """
+ if not context:
+ context={}
+ res = super(stock_inventory_merge, self).fields_view_get(cr, uid, view_id=view_id, view_type=view_type, context=context, toolbar=toolbar,submenu=False)
+ if context.get('active_model','') == 'stock.inventory' and len(context['active_ids']) < 2:
+ raise osv.except_osv(_('Warning'),
+ _('Please select multiple physical inventories to merge in the list view.'))
+ return res
+
def do_merge(self, cr, uid, ids, context):
""" To merge selected Inventories.
@param self: The object pointer.
@@ -37,13 +55,7 @@ class stock_inventory_merge(osv.osv_memory):
"""
invent_obj = self.pool.get('stock.inventory')
invent_line_obj = self.pool.get('stock.inventory.line')
-
invent_lines = {}
-
- if len(context['active_ids']) < 2:
- raise osv.except_osv(_('Warning'),
- _('Please select at least two inventories.'))
-
for inventory in invent_obj.browse(cr, uid, context['active_ids'], context=context):
if inventory.state == "done":
raise osv.except_osv(_('Warning'),
diff --git a/addons/stock/wizard/stock_inventory_merge_view.xml b/addons/stock/wizard/stock_inventory_merge_view.xml
index 5ae2987b59a..62cac877179 100644
--- a/addons/stock/wizard/stock_inventory_merge_view.xml
+++ b/addons/stock/wizard/stock_inventory_merge_view.xml
@@ -12,7 +12,7 @@
-
+
diff --git a/addons/stock/wizard/stock_inventory_set_stock_zero.py b/addons/stock/wizard/stock_inventory_set_stock_zero.py
deleted file mode 100644
index 4cbba93bdb6..00000000000
--- a/addons/stock/wizard/stock_inventory_set_stock_zero.py
+++ /dev/null
@@ -1,74 +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
-from tools.translate import _
-
-class inventory_set_stock_zero(osv.osv_memory):
- _name = "stock.inventory.set.stock.zero"
- _description = "Set Stock to 0"
-
- _columns = {
- 'location_id': fields.many2one('stock.location', 'Location', required=True),
- }
-
- def do_merge(self, cr, uid, ids, context):
- """ To set stock to Zero
- @param self: The object pointer.
- @param cr: A database cursor
- @param uid: ID of the user currently logged in
- @param ids: the ID or list of IDs if we want more than one
- @param context: A standard dictionary
- @return:
- """
- invent_obj = self.pool.get('stock.inventory')
- invent_line_obj = self.pool.get('stock.inventory.line')
- prod_obj = self.pool.get('product.product')
-
- if len(context['active_ids']) <> 1:
- raise osv.except_osv(_('Warning'),
- _('Please select one and only one inventory !'))
- for id in ids:
- datas = self.read(cr, uid, id)
- loc = str(datas['location_id'])
-
- cr.execute('select distinct location_id,product_id \
- from stock_inventory_line \
- where inventory_id=%s', (context['active_id'],))
- inv = cr.fetchall()
- cr.execute('select distinct product_id from stock_move where \
- location_dest_id=%s or location_id=%s', (loc, loc,))
- stock = cr.fetchall()
- for s in stock:
- if (loc, s[0]) not in inv:
- p = prod_obj.browse(cr, uid, s[0])
- invent_line_obj.create(cr, uid, {
- 'inventory_id': context['active_id'],
- 'location_id': loc,
- 'product_id': s[0],
- 'product_uom': p.uom_id.id,
- 'product_qty': 0.0,
- })
- return {}
-
-inventory_set_stock_zero()
-
-# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
diff --git a/addons/stock/wizard/stock_inventory_set_stock_zero_view.xml b/addons/stock/wizard/stock_inventory_set_stock_zero_view.xml
deleted file mode 100644
index 0ee84d2045d..00000000000
--- a/addons/stock/wizard/stock_inventory_set_stock_zero_view.xml
+++ /dev/null
@@ -1,31 +0,0 @@
-
-
-
-
-
- Set Stock to Zero
- stock.inventory.set.stock.zero
- form
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
diff --git a/addons/stock/wizard/stock_invoice_onshipping.py b/addons/stock/wizard/stock_invoice_onshipping.py
index f931e575b2f..7e0693b9045 100644
--- a/addons/stock/wizard/stock_invoice_onshipping.py
+++ b/addons/stock/wizard/stock_invoice_onshipping.py
@@ -48,22 +48,22 @@ class stock_invoice_onshipping(osv.osv_memory):
if context is None:
context = {}
picking_obj = self.pool.get('stock.picking')
- usage = 'customer'
+ src_usage = dest_usage = None
pick = picking_obj.browse(cr, uid, context['active_id'], context=context)
if pick.invoice_state == 'invoiced':
raise osv.except_osv(_('UserError'), _('Invoice is already created.'))
if pick.invoice_state == 'none':
raise osv.except_osv(_('UserError'), _('This picking does not require any invoicing.'))
if pick.move_lines:
- usage = pick.move_lines[0].location_id.usage
-
- if pick.type == 'out' and usage == 'supplier':
+ src_usage = pick.move_lines[0].location_id.usage
+ dest_usage = pick.move_lines[0].location_dest_id.usage
+ if pick.type == 'out' and dest_usage == 'supplier':
type = 'in_refund'
- elif pick.type == 'out' and usage == 'customer':
+ elif pick.type == 'out' and dest_usage == 'customer':
type = 'out_invoice'
- elif pick.type == 'in' and usage == 'supplier':
+ elif pick.type == 'in' and src_usage == 'supplier':
type = 'in_invoice'
- elif pick.type == 'in' and usage == 'customer':
+ elif pick.type == 'in' and src_usage == 'customer':
type = 'out_refund'
else:
type = 'out_invoice'
diff --git a/addons/stock/wizard/stock_invoice_onshipping_view.xml b/addons/stock/wizard/stock_invoice_onshipping_view.xml
index e1e742d7aee..eddffb594aa 100644
--- a/addons/stock/wizard/stock_invoice_onshipping_view.xml
+++ b/addons/stock/wizard/stock_invoice_onshipping_view.xml
@@ -16,7 +16,7 @@
-
+
diff --git a/addons/stock/wizard/stock_location_product_view.xml b/addons/stock/wizard/stock_location_product_view.xml
index 518bc6eab35..2459daac189 100644
--- a/addons/stock/wizard/stock_location_product_view.xml
+++ b/addons/stock/wizard/stock_location_product_view.xml
@@ -16,7 +16,7 @@
-
+
diff --git a/addons/stock/wizard/stock_move_view.xml b/addons/stock/wizard/stock_move_view.xml
index 46d3893900b..06f6822e3c7 100644
--- a/addons/stock/wizard/stock_move_view.xml
+++ b/addons/stock/wizard/stock_move_view.xml
@@ -13,7 +13,7 @@
+ string="_Cancel" />
diff --git a/addons/stock/wizard/stock_partial_move.py b/addons/stock/wizard/stock_partial_move.py
index 1016d6c3977..4825fa9c47e 100644
--- a/addons/stock/wizard/stock_partial_move.py
+++ b/addons/stock/wizard/stock_partial_move.py
@@ -47,7 +47,9 @@ class stock_partial_move(osv.osv_memory):
self._columns['move%s_product_qty'%(m.id)] = fields.float("Quantity")
if 'move%s_product_uom'%(m.id) not in self._columns:
self._columns['move%s_product_uom'%(m.id)] = fields.many2one('product.uom',string="Product UOM")
-
+ if 'move%s_prodlot_id'%(m.id) not in self._columns:
+ self._columns['move%s_prodlot_id'%(m.id)] = fields.many2one('stock.production.lot', string="Lot")
+
if (m.picking_id.type == 'in') and (m.product_id.cost_method == 'average'):
if 'move%s_product_price'%(m.id) not in self._columns:
self._columns['move%s_product_price'%(m.id)] = fields.float("Price")
@@ -89,7 +91,12 @@ class stock_partial_move(osv.osv_memory):
'relation': 'product.uom',
'required' : True,
'readonly' : True,
- }
+ },
+ 'move%s_prodlot_id'%(m.id): {
+ 'string': _('Production Lot'),
+ 'type': 'many2one',
+ 'relation': 'stock.production.lot',
+ }
})
_moves_arch_lst += """
@@ -97,7 +104,8 @@ class stock_partial_move(osv.osv_memory):
- """%(m.id, m.id, m.id)
+
+ """%(m.id, m.id, m.id,m.id,m.id)
if (m.picking_id.type == 'in') and (m.product_id.cost_method == 'average'):
_moves_fields.update({
'move%s_product_price'%(m.id) : {
@@ -162,29 +170,11 @@ class stock_partial_move(osv.osv_memory):
res['move%s_product_qty'%(m.id)] = m.product_qty
if 'move%s_product_uom'%(m.id) in fields:
res['move%s_product_uom'%(m.id)] = m.product_uom.id
- if (m.picking_id.type == 'out') and (m.product_id.cost_method == 'average') and 'sale_id' in m.picking_id._columns.keys():
- price = 0
- if hasattr(m, 'sale_line_id') and m.sale_line_id:
- price = m.sale_line_id.price_unit
-
+ if 'move%s_prodlot_id'%(m.id) in fields:
+ res['move%s_prodlot_id'%(m.id)] = m.prodlot_id.id
+ if m.product_id.cost_method == 'average' :
+ price = m.product_id.standard_price
currency = False
- if hasattr(m.picking_id, 'sale_id') and m.picking_id.sale_id:
- currency = m.picking_id.sale_id.pricelist_id.currency_id.id
-
- if 'move%s_product_price'%(m.id) in fields:
- res['move%s_product_price'%(m.id)] = price
- if 'move%s_product_currency'%(m.id) in fields:
- res['move%s_product_currency'%(m.id)] = currency
-
- if (m.picking_id.type == 'in') and (m.product_id.cost_method == 'average') and 'purchase_id' in m.picking_id._columns.keys():
- price = 0
- if hasattr(m, 'purchase_line_id') and m.purchase_line_id:
- price = m.purchase_line_id.price_unit
-
- currency = False
- if hasattr(m.picking_id, 'purchase_id') and m.picking_id.purchase_id:
- currency = m.picking_id.purchase_id.pricelist_id.currency_id.id
-
if 'move%s_product_price'%(m.id) in fields:
res['move%s_product_price'%(m.id)] = price
if 'move%s_product_currency'%(m.id) in fields:
@@ -213,7 +203,8 @@ class stock_partial_move(osv.osv_memory):
partial_datas['move%s'%(m.id)] = {
'product_id' : getattr(partial, 'move%s_product_id'%(m.id)).id,
'product_qty' : getattr(partial, 'move%s_product_qty'%(m.id)),
- 'product_uom' : getattr(partial, 'move%s_product_uom'%(m.id)).id
+ 'product_uom' : getattr(partial, 'move%s_product_uom'%(m.id)).id,
+ 'prodlot_id' : getattr(partial, 'move%s_prodlot_id'%(m.id)).id
}
if (m.picking_id.type == 'in') and (m.product_id.cost_method == 'average'):
diff --git a/addons/stock/wizard/stock_partial_picking.py b/addons/stock/wizard/stock_partial_picking.py
index 3b6ce21b6ee..d52198170a6 100644
--- a/addons/stock/wizard/stock_partial_picking.py
+++ b/addons/stock/wizard/stock_partial_picking.py
@@ -97,7 +97,6 @@ class stock_partial_picking(osv.osv_memory):
'string': _('Production Lot'),
'type': 'many2one',
'relation': 'stock.production.lot',
- 'readonly': True,
}
})
@@ -106,8 +105,8 @@ class stock_partial_picking(osv.osv_memory):
-
- """%(m.id, m.id, m.id, m.id)
+
+ """%(m.id, m.id, m.id, m.id,m.id)
if (m.product_id.cost_method == 'average'):
_moves_fields.update({
'move%s_product_price'%(m.id) : {
@@ -171,20 +170,9 @@ class stock_partial_picking(osv.osv_memory):
res['move%s_product_uom'%(m.id)] = m.product_uom.id
if 'move%s_prodlot_id'%(m.id) in fields:
res['move%s_prodlot_id'%(m.id)] = m.prodlot_id.id
-
if (m.product_id.cost_method == 'average'):
currency = False
- price = 0
- if (pick.type == 'in') and 'purchase_id' in pick._columns.keys():
- if hasattr(m, 'purchase_line_id') and m.purchase_line_id:
- price = m.purchase_line_id.price_unit
- if hasattr(pick, 'purchase_id') and pick.purchase_id:
- currency = pick.purchase_id.pricelist_id.currency_id.id
- if (pick.type == 'out') and 'sale_id' in pick._columns.keys():
- if hasattr(m, 'sale_line_id') and m.sale_line_id:
- price = m.sale_line_id.price_unit
- if hasattr(pick, 'sale_id') and pick.sale_id:
- currency = pick.sale_id.pricelist_id.currency_id.id
+ price = m.product_id.standard_price
if 'move%s_product_price'%(m.id) in fields:
res['move%s_product_price'%(m.id)] = price
if 'move%s_product_currency'%(m.id) in fields:
diff --git a/addons/stock/wizard/stock_picking_make_view.xml b/addons/stock/wizard/stock_picking_make_view.xml
index fa77042c5d8..4ecebed1031 100644
--- a/addons/stock/wizard/stock_picking_make_view.xml
+++ b/addons/stock/wizard/stock_picking_make_view.xml
@@ -12,7 +12,7 @@
width="600" height="300"/>
+ string="_Cancel" />
diff --git a/addons/stock/wizard/stock_replacement_view.xml b/addons/stock/wizard/stock_replacement_view.xml
index ce5f7efbc9f..cea5bfedbe8 100644
--- a/addons/stock/wizard/stock_replacement_view.xml
+++ b/addons/stock/wizard/stock_replacement_view.xml
@@ -9,7 +9,7 @@
-
+
diff --git a/addons/stock/wizard/stock_return_picking.py b/addons/stock/wizard/stock_return_picking.py
index 74aa96e8e63..4bddc9a7ee4 100644
--- a/addons/stock/wizard/stock_return_picking.py
+++ b/addons/stock/wizard/stock_return_picking.py
@@ -65,18 +65,27 @@ class stock_return_picking(osv.osv_memory):
@return: New arch of view with new columns.
"""
res = super(stock_return_picking, self).view_init(cr, uid, fields_list, context=context)
- record_id = context and context.get('active_id', False) or False
+ record_id = context and context.get('active_id', False)
if record_id:
pick_obj = self.pool.get('stock.picking')
- try:
- pick = pick_obj.browse(cr, uid, record_id)
- for m in [line for line in pick.move_lines]:
- if 'return%s'%(m.id) not in self._columns:
- self._columns['return%s'%(m.id)] = fields.float(string=m.name, required=True)
- if 'invoice_state' not in self._columns:
- self._columns['invoice_state'] = fields.selection([('2binvoiced', 'To be Invoiced'), ('none', 'None')], string='Invoice State', required=True)
- except Exception:
- return res
+ pick = pick_obj.browse(cr, uid, record_id)
+ if pick.state not in ['done','confirmed','assigned']:
+ raise osv.except_osv(_('Warning !'), _("You may only return pickings that are Confirmed, Available or Done!"))
+ return_history = {}
+ valid_lines = 0
+ for m in [line for line in pick.move_lines]:
+ if m.state == 'done':
+ return_history[m.id] = 0
+ for rec in m.move_history_ids2:
+ return_history[m.id] += (rec.product_qty * rec.product_uom.factor)
+ if m.product_qty * m.product_uom.factor > return_history[m.id]:
+ valid_lines += 1
+ if 'return%s'%(m.id) not in self._columns:
+ self._columns['return%s'%(m.id)] = fields.float(string=m.name, required=True)
+ if 'invoice_state' not in self._columns:
+ self._columns['invoice_state'] = fields.selection([('2binvoiced', 'To be Invoiced'), ('none', 'None')], string='Invoice State', required=True)
+ if not valid_lines:
+ raise osv.except_osv(_('Warning !'), _("There are no products to return (only lines in Done state and not fully returned yet can be returned)!"))
return res
def fields_view_get(self, cr, uid, view_id=None, view_type='form',
@@ -97,36 +106,29 @@ class stock_return_picking(osv.osv_memory):
if record_id:
pick_obj = self.pool.get('stock.picking')
pick = pick_obj.browse(cr, uid, record_id)
- if pick.state != 'done':
- raise osv.except_osv(_('Warning !'), _("The Picking is not completed yet!\nYou cannot return picking which is not in 'Done' state!"))
-
return_history = {}
- for m_line in pick.move_lines:
- return_history[m_line.id] = 0
- for rec in m_line.move_history_ids2:
- return_history[m_line.id] += rec.product_qty
res['fields'].clear()
arch_lst=['', '
' % _('Return lines'), '' % _('Provide the quantities of the returned products.')]
- for m in [line for line in pick.move_lines]:
+ for m in pick.move_lines:
+ return_history[m.id] = 0
+ for rec in m.move_history_ids2:
+ return_history[m.id] += rec.product_qty
quantity = m.product_qty
- if quantity > return_history[m.id] and (quantity - return_history[m.id])>0:
+ if m.state=='done' and quantity > return_history[m.id]:
arch_lst.append('\n' % (m.id,))
res['fields']['return%s' % m.id]={'string':m.name, 'type':'float', 'required':True}
res.setdefault('returns', []).append(m.id)
- if not res.get('returns',False):
- raise osv.except_osv(_('Warning!'),_('There is no product to return!'))
-
arch_lst.append('\n')
res['fields']['invoice_state']={'string':_('Invoice state'), 'type':'selection','required':True, 'selection':[('2binvoiced', _('To Be Invoiced')), ('none', _('None'))]}
arch_lst.append('')
arch_lst.append('')
- arch_lst.append('')
+ arch_lst.append('')
arch_lst.append('')
arch_lst.append('
')
res['arch'] = '\n'.join(arch_lst)
return res
- def _create_returns(self, cr, uid, ids, context):
+ def create_returns(self, cr, uid, ids, context):
"""
Creates return picking.
@param self: The object pointer.
@@ -149,6 +151,7 @@ class stock_return_picking(osv.osv_memory):
move_ids = [m.id for m in [line for line in pick.move_lines]]
set_invoice_state_to_none = True
+ returned_lines = 0
for move in move_obj.browse(cr, uid, move_ids):
if not new_picking:
if pick.type=='out':
@@ -161,57 +164,45 @@ class stock_return_picking(osv.osv_memory):
'move_lines':[], 'state':'draft', 'type':new_type,
'date':date_cur, 'invoice_state':data['invoice_state'],})
new_location=move.location_dest_id.id
+ if move.state=='done':
+ new_qty = data['return%s' % move.id]
+ returned_qty = move.product_qty
- new_qty = data['return%s' % move.id]
- returned_qty = move.product_qty
-
- for rec in move.move_history_ids2:
- returned_qty -= rec.product_qty
-
- if returned_qty != new_qty:
- set_invoice_state_to_none = False
-
- new_move=move_obj.copy(cr, uid, move.id, {
- 'product_qty': new_qty,
- 'product_uos_qty': uom_obj._compute_qty(cr, uid, move.product_uom.id,
- new_qty, move.product_uos.id),
- 'picking_id':new_picking, 'state':'draft',
- 'location_id':new_location, 'location_dest_id':move.location_id.id,
- 'date':date_cur, 'date_planned':date_cur,})
- move_obj.write(cr, uid, [move.id], {'move_history_ids2':[(4,new_move)]})
-
+ for rec in move.move_history_ids2:
+ returned_qty -= rec.product_qty
+
+ if returned_qty != new_qty:
+ set_invoice_state_to_none = False
+
+ if new_qty:
+ returned_lines += 1
+ new_move=move_obj.copy(cr, uid, move.id, {
+ 'product_qty': new_qty,
+ 'product_uos_qty': uom_obj._compute_qty(cr, uid, move.product_uom.id,
+ new_qty, move.product_uos.id),
+ 'picking_id':new_picking, 'state':'draft',
+ 'location_id':new_location, 'location_dest_id':move.location_id.id,
+ 'date':date_cur,})
+ move_obj.write(cr, uid, [move.id], {'move_history_ids2':[(4,new_move)]})
+
+ if not returned_lines:
+ raise osv.except_osv(_('Warning !'), _("Please specify at least one non-zero quantity!"))
+
if set_invoice_state_to_none:
pick_obj.write(cr, uid, [pick.id], {'invoice_state':'none'})
-
- if new_picking:
- if new_picking:
- wf_service.trg_validate(uid, 'stock.picking', new_picking, 'button_confirm', cr)
- pick_obj.force_assign(cr, uid, [new_picking], context)
- return new_picking
-
- def action_open_window(self, cr, uid, ids, context):
- """
- Opens return picking list.
- @param self: The object pointer.
- @param cr: A database cursor
- @param uid: ID of the user currently logged in
- @param ids: List of ids selected
- @param context: A standard dictionary
- @return: A dictionary which of fields with values.
- """
- res = self._create_returns(cr, uid, ids, context)
- if not res:
- return {}
+ wf_service.trg_validate(uid, 'stock.picking', new_picking, 'button_confirm', cr)
+ pick_obj.force_assign(cr, uid, [new_picking], context)
return {
- 'domain': "[('id', 'in', ["+str(res)+"])]",
+ 'domain': "[('id', 'in', ["+str(new_picking)+"])]",
'name': 'Picking List',
'view_type':'form',
'view_mode':'tree,form',
'res_model':'stock.picking',
'view_id':False,
'type':'ir.actions.act_window',
+ 'context':context,
}
-
+
stock_return_picking()
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
diff --git a/addons/stock/wizard/stock_splitinto.py b/addons/stock/wizard/stock_splitinto.py
index 20b1940e1c7..a54e6a485c2 100644
--- a/addons/stock/wizard/stock_splitinto.py
+++ b/addons/stock/wizard/stock_splitinto.py
@@ -21,13 +21,13 @@
from osv import fields, osv
from tools.translate import _
-
+import decimal_precision as dp
class stock_split_into(osv.osv_memory):
_name = "stock.split.into"
_description = "Split into"
_columns = {
- 'quantity': fields.float('Quantity', digits=(16,2)),
+ 'quantity': fields.float('Quantity',digits_compute=dp.get_precision('Product UOM')),
}
_defaults = {
'quantity': lambda *x: 0,
diff --git a/addons/stock/wizard/stock_splitinto_view.xml b/addons/stock/wizard/stock_splitinto_view.xml
index a325519ca75..7ed7266a163 100644
--- a/addons/stock/wizard/stock_splitinto_view.xml
+++ b/addons/stock/wizard/stock_splitinto_view.xml
@@ -10,7 +10,7 @@
+ string="_Cancel" />
diff --git a/addons/stock/wizard/stock_ups_view.xml b/addons/stock/wizard/stock_ups_view.xml
index 89b5fe131e8..cbce721e1b9 100644
--- a/addons/stock/wizard/stock_ups_view.xml
+++ b/addons/stock/wizard/stock_ups_view.xml
@@ -11,7 +11,7 @@
-
+
diff --git a/addons/stock_location/__openerp__.py b/addons/stock_location/__openerp__.py
index beb24997fb8..e5d6f767975 100644
--- a/addons/stock_location/__openerp__.py
+++ b/addons/stock_location/__openerp__.py
@@ -21,29 +21,70 @@
{
- 'name': 'Stock Location Paths',
+ 'name': 'Warehouse Locations Paths',
'version': '1.0',
'category': 'Generic Modules/Inventory Control',
'description': """
-Manages product's path in locations.
+This module supplements the Warehouse application by adding support for per-product
+location paths, effectively implementing Push and Pull inventory flows.
-This module may be useful for different purposes:
-* Manages the product in his whole manufacturing chain
-* Manages different default locations by products
-* Define paths within the warehouse to route products based on operations:
+Typically this could be used to:
+* Manage product manufacturing chains
+* Manage default locations per product
+* Define routes within your warehouse according to business needs, such as:
- Quality Control
- After Sales Services
- - Supplier Return
-* Manage products to be rent.
+ - Supplier Returns
+* Help rental management, by generating automated return moves for rented products
+
+Once this module is installed, an additional tab appear on the product form, where you can add
+Push and Pull flow specifications. The demo data of CPU1 product for that push/pull :
+
+Push flows
+----------
+Push flows are useful when the arrival of certain products in a given location should always
+be followed by a corresponding move to another location, optionally after a certain delay.
+The original Warehouse application already supports such Push flow specifications on the
+Locations themselves, but these cannot be refined per-product.
+
+A push flow specification indicates which location is chained with which location, and with
+what parameters. As soon as a given quantity of products is moved in the source location,
+a chained move is automatically foreseen according to the parameters set on the flow specification
+(destination location, delay, type of move, journal, etc.) The new move can be automatically
+processed, or require a manual confirmation, depending on the parameters.
+
+Pull flows
+----------
+Pull flows are a bit different from Pull flows, in the sense that they are not related to
+the processing of product moves, but rather to the processing of procurement orders.
+What is being pulled is a need, not directly products.
+A classical example of Push flow is when you have an Outlet company, with a parent Company
+that is responsible for the supplies of the Outlet.
+
+ [ Customer ] <- A - [ Outlet ] <- B - [ Holding ] <~ C ~ [ Supplier ]
+
+When a new procurement order (A, coming from the confirmation of a Sale Order for example) arrives
+in the Outlet, it is converted into another procurement (B, via a Push flow of type 'move')
+requested from the Holding. When procurement order B is processed by the Holding company, and
+if the product is out of stock, it can be converted into a Purchase Order (C) from the Supplier
+(Push flow of type Purchase). The result is that the procurement order, the need, is pushed
+all the way between the Customer and Supplier.
+
+Technically, Pull flows allow to process procurement orders differently, not only depending on
+the product being considered, but also depending on which location holds the "need" for that
+product (i.e. the destination location of that procurement order).
+
""",
'author': 'OpenERP SA',
'depends': ['procurement','stock'],
'init_xml': [],
'update_xml': ['stock_location_view.xml', 'security/ir.model.access.csv', 'mrp_pull_workflow.xml'],
- 'demo_xml': [],
+ 'demo_xml': ['stock_location_demo.xml',],
+
'installable': True,
- 'test':[
- 'test/stock_location.yml'
+ 'test':[''
+ 'test/stock_location_pull_flow.yml',
+ 'test/stock_location_push_flow.yml',
],
'active': False,
'certificate': '0046505115101',
diff --git a/addons/stock_location/mrp_pull.py b/addons/stock_location/mrp_pull.py
index b4a68ca1b74..f4c9868a58f 100644
--- a/addons/stock_location/mrp_pull.py
+++ b/addons/stock_location/mrp_pull.py
@@ -18,13 +18,8 @@
#
##############################################################################
-from osv import fields,osv
-import tools
-import ir
-import pooler
+from osv import osv
import netsvc
-from mx import DateTime
-import time
from tools.translate import _
class procurement_order(osv.osv):
@@ -32,7 +27,6 @@ class procurement_order(osv.osv):
def check_buy(self, cr, uid, ids, context=None):
for procurement in self.browse(cr, uid, ids):
for line in procurement.product_id.flow_pull_ids:
-
if line.location_id==procurement.location_id:
return line.type_proc=='buy'
return super(procurement_order, self).check_buy(cr, uid, ids)
@@ -56,7 +50,7 @@ class procurement_order(osv.osv):
def action_move_create(self, cr, uid, ids,context=None):
proc_obj = self.pool.get('procurement.order')
move_obj = self.pool.get('stock.move')
- location_obj = self.pool.get('stock.location')
+ picking_obj=self.pool.get('stock.picking')
wf_service = netsvc.LocalService("workflow")
for proc in proc_obj.browse(cr, uid, ids, context=context):
line = None
@@ -65,7 +59,7 @@ class procurement_order(osv.osv):
break
assert line, 'Line can not be False if we are on this state of the workflow'
origin = (proc.origin or proc.name or '').split(':')[0] +':'+line.name
- picking_id = self.pool.get('stock.picking').create(cr, uid, {
+ picking_id =picking_obj.create(cr, uid, {
'origin': origin,
'company_id': line.company_id and line.company_id.id or False,
'type': line.picking_type,
@@ -75,12 +69,12 @@ class procurement_order(osv.osv):
'note': line.name, # TODO: note on procurement ?
'invoice_state': line.invoice_state,
})
- move_id = self.pool.get('stock.move').create(cr, uid, {
+ move_id =move_obj.create(cr, uid, {
'name': line.name,
'picking_id': picking_id,
'company_id': line.company_id and line.company_id.id or False,
'product_id': proc.product_id.id,
- 'date_planned': proc.date_planned,
+ 'date': proc.date_planned,
'product_qty': proc.product_qty,
'product_uom': proc.product_uom.id,
'product_uos_qty': (proc.product_uos and proc.product_uos_qty)\
@@ -97,10 +91,10 @@ class procurement_order(osv.osv):
'note': line.name, # TODO: same as above
})
if proc.move_id and proc.move_id.state in ('confirmed'):
- self.pool.get('stock.move').write(cr,uid, [proc.move_id.id], {
+ move_obj.write(cr,uid, [proc.move_id.id], {
'state':'waiting'
}, context=context)
- proc_id = self.pool.get('procurement.order').create(cr, uid, {
+ proc_id = proc_obj.create(cr, uid, {
'name': line.name,
'origin': origin,
'company_id': line.company_id and line.company_id.id or False,
@@ -120,7 +114,7 @@ class procurement_order(osv.osv):
wf_service.trg_validate(uid, 'stock.picking', picking_id, 'button_confirm', cr)
wf_service.trg_validate(uid, 'procurement.order', proc_id, 'button_confirm', cr)
if proc.move_id:
- self.pool.get('stock.move').write(cr, uid, [proc.move_id.id],
+ move_obj.write(cr, uid, [proc.move_id.id],
{'location_id':proc.location_id.id})
self.write(cr, uid, [proc.id], {'state':'running','message':_('Moved from other location')})
diff --git a/addons/stock_location/stock_location_demo.xml b/addons/stock_location/stock_location_demo.xml
new file mode 100644
index 00000000000..a828eb76f2d
--- /dev/null
+++ b/addons/stock_location/stock_location_demo.xml
@@ -0,0 +1,89 @@
+
+
+
+
+ This product is configured with example of push/pull flows
+
+
+
+
+
+ internal
+ none
+ Input
+ manual
+
+
+
+
+
+ internal
+ none
+ Quality test
+ manual
+
+
+
+
+
+
+
+ auto
+ none
+
+
+ out
+
+
+
+
+ auto
+ none
+
+
+ out
+
+
+
+
+ auto
+ none
+
+
+ out
+
+
+
+
+
+
+
+ none
+
+ move
+
+ make_to_stock
+ internal
+ L001
+
+
+
+
+ none
+
+ buy
+
+ make_to_stock
+ out
+ L002
+
+
+ 20.0
+ 10.0
+
+
+
+
+
+
+
diff --git a/addons/stock_location/test/stock_location.yml b/addons/stock_location/test/stock_location.yml
deleted file mode 100644
index c5360ce67c5..00000000000
--- a/addons/stock_location/test/stock_location.yml
+++ /dev/null
@@ -1,270 +0,0 @@
-
--
- In order to test the stock location module, I will create product, locations, SO, warehouse.
-
--
- Creating a account.account.type record
--
- !record {model: account.account.type, id: account_account_type_asset0}:
- close_method: balance
- code: asset
- name: Asset
- sign: 1
-
-
--
- Creating a account.account.type record
--
- !record {model: account.account.type, id: account_account_type_income0}:
- close_method: unreconciled
- code: income
- name: Income
- sign: 1
-
-
--
- Creating a account.account.type record
--
- !record {model: account.account.type, id: account_account_type_expense0}:
- close_method: unreconciled
- code: expense
- name: Expense
- sign: 1
--
- Creating a account.account.type record
--
- !record {model: account.account.type, id: account_account_type_receivable0}:
- close_method: balance
- code: receivable
- name: Receivable
- sign: 1
--
-
- Creating a account.account record
--
- !record {model: account.account, id: account_account_receivable0}:
- code: '40000'
- company_id: base.main_company
- currency_mode: current
- name: Receivable
- parent_left: 1
- parent_right: 2
- type: receivable
- user_type: account_account_type_receivable0
--
- Creating a account.account record
--
- !record {model: account.account, id: account_account_payable0}:
- code: '440000'
- company_id: base.main_company
- currency_mode: current
- name: Payable
- parent_left: 3
- parent_right: 4
- type: payable
- user_type: account_account_type_expense0
--
- Creating a account.journal record
--
- !record {model: account.journal, id: account_journal_purchasejournal0}:
- code: pur
- company_id: base.main_company
- name: Purchase Journal
- sequence_id: account.sequence_purchase_journal
- type: purchase
- view_id: account.account_journal_bank_view
-
--
- Creating a account.journal record
--
- !record {model: account.journal, id: account_journal_salejouran0}:
- code: sal
- company_id: base.main_company
- name: Sale Jouran
- sequence_id: account.sequence_sale_journal
- type: sale
- view_id: account.account_journal_view
-
--
- Creating a account.account record
--
- !record {model: account.account, id: account_account_expenseaccount0}:
- code: Expe
- company_id: base.main_company
- currency_mode: current
- name: Expense Account
- parent_left: 5
- parent_right: 6
- type: consolidation
- user_type: account_account_type_asset0
--
- Creating a account.account record
--
- !record {model: account.account, id: account_account_productsale0}:
- code: '001'
- company_id: base.main_company
- currency_mode: current
- name: Product Sale
- type: other
- user_type: account_account_type_income0
-
--
- Creating a account.account record
--
- !record {model: account.account, id: account_account_productpurchase0}:
- code: '0002'
- company_id: base.main_company
- currency_mode: current
- name: Product Purchase
- type: other
- user_type: account_account_type_expense0
-
--
- Creating a res.partner record
--
- !record {model: res.partner, id: res_partner_shawtrust0}:
- address:
- - country_id: base.in
- - street: St James House, Vicar Lane, Sheffield
- lang: en_US
- name: 'Shaw Trust '
- property_account_payable: account_account_payable0
- property_account_receivable: account_account_receivable0
--
- Creating a res.partner record
--
- !record {model: res.partner, id: res_partner_diasorinltd0}:
- address:
- - country_id: base.in
- street: Ash House, Ash Road
- name: DiaSorin Ltd
- supplier: true
-
-
--
- Creating a res.partner record
--
- !record {model: res.partner, id: res_partner_microlinktechnologies0}:
- address:
- - street: Kailash Vaibhav, Parksite
- name: Micro Link Technologies
- property_account_payable: account_account_payable0
- property_account_receivable: account_account_receivable0
- supplier: true
-
--
- Creating a res.partner.address record
--
- !record {model: res.partner.address, id: res_partner_address_0}:
- country_id: base.in
- partner_id: res_partner_microlinktechnologies0
- street: Ash House, Ash Road
- title: base.res_partner_title_miss
-
-
--
- Creating a product.category record
--
- !record {model: product.category, id: product_category_computer0}:
- name: Computer
--
- Creating a stock.location record
--
- !record {model: stock.location, id: stock_location_suppiler0}:
- chained_auto_packing: auto
- chained_delay: 15
- chained_location_type: none
- company_id: base.main_company
- name: Suppiler1
- usage: supplier
--
-
- Creating a product.product record
--
- !record {model: product.product, id: product_product_hpcdwriters0}:
- categ_id: product_category_computer0
- cost_method: standard
- list_price: 1000.0
- mes_type: fixed
- name: HP CD writers
- procure_method: make_to_stock
- seller_ids:
- - delay: 1
- name: res_partner_shawtrust0
- min_qty: 5.0
- supply_method: buy
- type: product
- uom_id: product.product_uom_unit
- uom_po_id: product.product_uom_unit
- property_account_expense: account_account_productpurchase0
- property_account_income: account_account_productsale0
- path_ids:
- - auto: auto
- delay: 30
- location_dest_id: stock.location_inventory
- location_from_id: stock_location_suppiler0
- property_stock_inventory: stock.location_inventory
- property_stock_procurement: stock.location_procurement
- property_stock_production: stock.location_production
--
- Creating a stock.location record
--
- !record {model: stock.location, id: stock_location_suppiler0}:
- address_id: res_partner_address_0
- chained_auto_packing: manual
- chained_delay: 20
- chained_location_type: none
- company_id: base.main_company
- name: Suppiler 1
- usage: internal
--
- I create warehouse.
--
- !record {model: stock.warehouse, id: warehouse0}:
- company_id: base.main_company
- lot_input_id: stock.stock_location_stock
- lot_output_id: stock_location_suppiler0
- lot_stock_id: stock_location_suppiler0
- name: OpenERP S.A.
- partner_address_id: res_partner_address_0
--
- I create Sale order for HP CD writers.
--
- !record {model: sale.order, id: sale_order_01}:
- date_order: '2010-04-20'
- invoice_quantity: order
- name: Test/location
- order_line:
- - name: HP CD writers
- price_unit: 1000.0
- product_uom: product.product_uom_unit
- product_uom_qty: 5.0
- state: draft
- product_id: product_product_hpcdwriters0
- type: make_to_order
- order_policy: manual
- partner_id: base.res_partner_agrolait
- partner_invoice_id: base.res_partner_address_8
- partner_order_id: base.res_partner_address_8
- partner_shipping_id: base.res_partner_address_8
- picking_policy: direct
- pricelist_id: product.list0
- shop_id: sale.shop
--
- I confirm the sale order.
--
- !workflow {model: sale.order, action: order_confirm, ref: sale_order_01}
--
- I check the delay mentioned in pushed flow in move.
--
- !python {model: stock.move}: |
- product_id=self.pool.get('product.product').search(cr,uid,[('name','=','HP CD writers')])
- location_id=self.pool.get('stock.location').search(cr,uid,[('name','=','Inventory loss')])
- move_ids =self.search(cr, uid, [('product_id','in',product_id),('location_dest_id','=',location_id)])
- if move_ids:
- move_obj=self.browse(cr,uid,move_ids)[0]
- import time
- from_dt = time.mktime(time.strptime(move_obj.date,'%Y-%m-%d %H:%M:%S'))
- to_dt = time.mktime(time.strptime(move_obj.date_planned,'%Y-%m-%d %H:%M:%S'))
- diff_day = (to_dt-from_dt)/(3600*24)
- assert (round(diff_day)+1 ==30)
diff --git a/addons/stock_location/test/stock_location_pull_flow.yml b/addons/stock_location/test/stock_location_pull_flow.yml
new file mode 100644
index 00000000000..a6f7a8e913a
--- /dev/null
+++ b/addons/stock_location/test/stock_location_pull_flow.yml
@@ -0,0 +1,226 @@
+-
+ In order to test the product pulled flow , I create ,partner,product,procurement
+-
+ I create a account type Asset.
+-
+ !record {model: account.account.type, id: account_account_type_asset0}:
+ close_method: balance
+ code: asset
+ name: Asset
+ sign: 1
+-
+ I create a account type income.
+-
+ !record {model: account.account.type, id: account_account_type_income0}:
+ close_method: unreconciled
+ code: income
+ name: Income
+ sign: 1
+-
+ I create a account type Expense.
+-
+ !record {model: account.account.type, id: account_account_type_expense0}:
+ close_method: unreconciled
+ code: expense
+ name: Expense
+ sign: 1
+-
+ I create a account type Receivable.
+-
+ !record {model: account.account.type, id: account_account_type_receivable0}:
+ close_method: balance
+ code: receivable
+ name: Receivable
+ sign: 1
+-
+
+ I create a account Receivable.
+-
+ !record {model: account.account, id: account_account_receivable0}:
+ code: '40000'
+ company_id: base.main_company
+ currency_mode: current
+ name: Receivable
+ parent_left: 1
+ parent_right: 2
+ type: receivable
+ user_type: account_account_type_receivable0
+-
+ I create a account Payable.
+-
+ !record {model: account.account, id: account_account_payable0}:
+ code: '440000'
+ company_id: base.main_company
+ currency_mode: current
+ name: Payable
+ parent_left: 3
+ parent_right: 4
+ type: payable
+ user_type: account_account_type_expense0
+-
+ I create a Purchase Journal.
+-
+ !record {model: account.journal, id: account_journal_purchasejournal0}:
+ code: pur
+ company_id: base.main_company
+ name: Purchase Journal
+ sequence_id: account.sequence_purchase_journal
+ type: purchase
+ view_id: account.account_journal_bank_view
+
+-
+ I create a Sale Journal.
+-
+ !record {model: account.journal, id: account_journal_salejouran0}:
+ code: sal
+ company_id: base.main_company
+ name: Sale Journal
+ sequence_id: account.sequence_sale_journal
+ type: sale
+ view_id: account.account_journal_view
+
+-
+ I create a Sale Journal.
+-
+ !record {model: account.account, id: account_account_expenseaccount0}:
+ code: Expe
+ company_id: base.main_company
+ currency_mode: current
+ name: Expense Account
+ parent_left: 5
+ parent_right: 6
+ type: consolidation
+ user_type: account_account_type_asset0
+-
+ I create Product Sale account.
+-
+ !record {model: account.account, id: account_account_productsale0}:
+ code: '001'
+ company_id: base.main_company
+ currency_mode: current
+ name: Product Sale
+ type: other
+ user_type: account_account_type_income0
+
+-
+ I create Product Product Purchase.
+-
+ !record {model: account.account, id: account_account_productpurchase0}:
+ code: '0002'
+ company_id: base.main_company
+ currency_mode: current
+ name: Product Purchase
+ type: other
+ user_type: account_account_type_expense0
+-
+ I create Supplier.
+-
+ !record {model: res.partner, id: res_partner_shawtrust0}:
+ address:
+ - country_id: base.in
+ - street: St James House, Vicar Lane, Sheffield
+ lang: en_US
+ name: 'Shaw Trust '
+ property_account_payable: account_account_payable0
+ property_account_receivable: account_account_receivable0
+-
+ I create product category.
+-
+ !record {model: product.category, id: product_category_computer0}:
+ name: Computer
+-
+ I create product and define the pulled flow condition for stock move.
+ I set shipping type Sending Goods. and set Procurement type move.
+-
+ !record {model: product.product, id: product_product_hpcdwriters0}:
+ categ_id: product_category_computer0
+ cost_method: standard
+ list_price: 1000.0
+ mes_type: fixed
+ name: HP CD writers
+ procure_method: make_to_stock
+ seller_ids:
+ - delay: 1
+ name: res_partner_shawtrust0
+ min_qty: 5.0
+ supply_method: buy
+ type: product
+ uom_id: product.product_uom_unit
+ uom_po_id: product.product_uom_unit
+ property_account_expense: account_account_productpurchase0
+ property_account_income: account_account_productsale0
+ flow_pull_ids:
+ - invoice_state: none
+ location_id: stock.stock_location_shop0
+ location_src_id: stock.stock_location_shop1
+ name: E001
+ partner_address_id: base.res_partner_address_2
+ picking_type: out
+ procure_method: make_to_stock
+ type_proc: move
+ - invoice_state: none
+ location_id: stock.stock_location_shop1
+ location_src_id: stock.stock_location_suppliers
+ name: E002
+ partner_address_id: base.res_partner_address_7
+ picking_type: out
+ procure_method: make_to_stock
+ type_proc: move
+ - invoice_state: none
+ location_id: stock.stock_location_suppliers
+ location_src_id: stock.stock_location_stock
+ name: E003
+ type_proc: buy
+ property_stock_inventory: stock.location_inventory
+ property_stock_procurement: stock.location_procurement
+ property_stock_production: stock.location_production
+ qty_available: 15
+-
+ I create procurement order.
+-
+ !record {model: procurement.order, id: procurement_order_test0}:
+ company_id: base.main_company
+ date_planned: '2010-10-07 18:24:24'
+ location_id: stock.stock_location_shop0
+ name: Testing pulled flow
+ priority: '1'
+ procure_method: make_to_order
+ product_id: product_product_hpcdwriters0
+ product_qty: 5.0
+ product_uom: product.product_uom_unit
+ product_uos: product.product_uom_unit
+ product_uos_qty: 0.0
+-
+ I confirm procurement order.
+-
+ !workflow {model: procurement.order, action: button_confirm, ref: procurement_order_test0}
+-
+ I launch the scheduler to compute procurement.
+-
+ !python {model: procurement.order.compute.all}: |
+ proc_obj = self.pool.get('procurement.order')
+ proc_obj._procure_confirm(cr,uid)
+-
+ I check the state of procurement order is cancel and stock move is cancel.
+-
+ !python {model: procurement.order }: |
+ from tools.translate import _
+ procurement_ids=self.search(cr, uid, [('id', '=', ref('procurement_order_test0'))])
+ if procurement_ids:
+ order=self.browse(cr,uid,procurement_ids)[0]
+ assert(order.state=='cancel')
+-
+ I check the new of procurement order create .
+-
+ !python {model: procurement.order }: |
+ from tools.translate import _
+ procurement_ids=self.search(cr, uid, [('name','=','E001')])
+ assert len(procurement_ids), "Procurement order hasn't Created."
+-
+ I check the Outgoing Picking is create for source location Shop 2 and destination shop1.
+-
+ !python {model: stock.picking }: |
+ from tools.translate import _
+ picking_id = self.search(cr, uid, [('origin','=','Testing pulled flow:E001'),('type','=','out')])
+ assert len(picking_id), "Picking hasn't Created."
+
\ No newline at end of file
diff --git a/addons/stock_location/test/stock_location_push_flow.yml b/addons/stock_location/test/stock_location_push_flow.yml
new file mode 100644
index 00000000000..989134c13bb
--- /dev/null
+++ b/addons/stock_location/test/stock_location_push_flow.yml
@@ -0,0 +1,134 @@
+-
+ In order to test the product pushed flow , I create account ,partner,product,shipment
+ Push flow specification indicates which location is chained with which location.
+-
+ I create product category.
+-
+ !record {model: product.category, id: product_category_computer0}:
+ name: Computer
+
+-
+ I create Supplier.
+-
+ !record {model: res.partner, id: res_partner_microlinktechnologies0}:
+ address:
+ - street: Kailash Vaibhav, Parksite
+ name: Micro Link Technologies
+ property_account_payable: account_account_payable0
+ property_account_receivable: account_account_receivable0
+ supplier: true
+
+-
+ I create Supplier address.
+-
+ !record {model: res.partner.address, id: res_partner_address_0}:
+ country_id: base.in
+ partner_id: res_partner_microlinktechnologies0
+ street: Ash House, Ash Road
+ title: base.res_partner_title_miss
+
+-
+ I create product and define the pushed flow .
+-
+ I set the chain location Supplier to stock Input
+ Stock Input to Quality test and Quality test -Stock .
+-
+ !record {model: product.product, id: product_product_hpcdwriters0}:
+ categ_id: product_category_computer0
+ cost_method: standard
+ list_price: 1000.0
+ mes_type: fixed
+ name: HP CD writers
+ procure_method: make_to_stock
+ seller_ids:
+ - delay: 1
+ name: res_partner_microlinktechnologies0
+ min_qty: 5.0
+ path_ids:
+ - auto: auto
+ invoice_state: none
+ location_dest_id: stock_location.stock_location_input0
+ location_from_id: stock.stock_location_suppliers
+ - auto: auto
+ invoice_state: none
+ location_dest_id: stock_location.stock_location_qualitytest0
+ location_from_id: stock_location.stock_location_input0
+ - auto: auto
+ invoice_state: none
+ location_dest_id: stock.stock_location_stock
+ location_from_id: stock_location.stock_location_qualitytest0
+ supply_method: buy
+ type: product
+ uom_id: product.product_uom_unit
+ uom_po_id: product.product_uom_unit
+ property_stock_inventory: stock.location_inventory
+ property_stock_procurement: stock.location_procurement
+ property_stock_production: stock.location_production
+-
+ In order to test pushed flow .I buy the product from Micro Link Technologies supplier. I create a Picking.
+-
+ !record {model: stock.picking , id: stock_picking_in0}:
+ address_id: res_partner_address_0
+ company_id: base.main_company
+ invoice_state: none
+ move_lines:
+ - date_expected: '2010-10-08 15:36:53'
+ location_dest_id: stock_location.stock_location_input0
+ location_id: stock.stock_location_suppliers
+ name: 'HP CD writers'
+ product_id: product_product_hpcdwriters0
+ product_qty: 6.0
+ product_uom: product.product_uom_unit
+ product_uos_qty: 6.0
+ name: Pushed Flow Test
+ type: in
+-
+ I confirm picking.
+-
+ !python {model: stock.picking }: |
+ self.draft_force_assign(cr, uid, [ref("stock_picking_in0")], {"lang": "en_US",
+ "search_default_available": 1, "tz": False, "active_model": "ir.ui.menu",
+ "contact_display": "partner_address", "active_ids": [ref("stock.menu_action_picking_tree4")],
+ "active_id": ref("stock.menu_action_picking_tree4"), })
+-
+ I check that the outgoing order of the supplier is create with two move line.
+ Stock/Input To Quality test and Quality test To Stock.
+-
+ I check the move is in waiting state.
+-
+ !python {model: stock.picking }: |
+ from tools.translate import _
+ picking_id = self.search(cr, uid, [('origin','=','Pushed Flow Test'),('type','=','out')])
+ if picking_id:
+ pick=self.browse(cr,uid,picking_id[0])
+ for move in pick.move_lines:
+ assert(move.state == 'waiting'), _('Stock is not in waiting state')
+-
+ I receive the order of the supplier Micro Link Technologies from the Incoming Shipments menu.
+-
+ !python {model: stock.picking }: |
+ import time
+ picking_id = self.search(cr, uid, [('address_id.partner_id','=',ref('res_partner_microlinktechnologies0')),('type','=','in')])
+ if picking_id:
+ pick=self.browse(cr,uid,picking_id[0])
+ move =pick.move_lines[0]
+ partial_datas = {
+ 'partner_id':pick.address_id.partner_id.id,
+ 'address_id': pick.address_id.id,
+ 'delivery_date' : time.strftime('%Y-%m-%d'),
+ }
+ partial_datas['move%s'%(move.id)]= {
+ 'product_id': move.product_id.id,
+ 'product_qty': move.product_qty,
+ 'product_uom': move.product_uom.id,
+ }
+ self.do_partial(cr, uid, picking_id,partial_datas)
+-
+ I check the Outgoing Orders is automatically done.
+-
+ !python {model: stock.picking }: |
+ from tools.translate import _
+ picking_id = self.search(cr, uid, [('origin','=','Pushed Flow Test'),('type','=','out')])
+ if picking_id:
+ pick=self.browse(cr,uid,picking_id[0])
+ assert(pick.state == 'done'), _('Picking is not in done state')
diff --git a/addons/stock_planning/stock_planning.py b/addons/stock_planning/stock_planning.py
index 9d9102d67b3..546e83e0053 100644
--- a/addons/stock_planning/stock_planning.py
+++ b/addons/stock_planning/stock_planning.py
@@ -691,7 +691,7 @@ class stock_planning(osv.osv):
'name': _('MPS(') + str(user.login) +') '+ obj.period_id.name,
'picking_id': picking_id,
'product_id': obj.product_id.id,
- 'date_planned': obj.period_id.date_start,
+ 'date': obj.period_id.date_start,
'product_qty': uom_qty,
'product_uom': uom,
'product_uos_qty': uos_qty,
diff --git a/addons/survey/report/survey_analysis_report.py b/addons/survey/report/survey_analysis_report.py
index c95bd33ac32..0d866368bf2 100644
--- a/addons/survey/report/survey_analysis_report.py
+++ b/addons/survey/report/survey_analysis_report.py
@@ -29,7 +29,6 @@ from report import report_sxw
class survey_analysis(report_rml):
def create(self, cr, uid, ids, datas, context):
-
surv_obj = pooler.get_pool(cr.dbname).get('survey')
user_obj = pooler.get_pool(cr.dbname).get('res.users')
rml_obj=report_sxw.rml_parse(cr, uid, surv_obj._name,context)
@@ -46,9 +45,6 @@ class survey_analysis(report_rml):
"""+to_xml(rml_obj.formatLang(time.strftime("%Y-%m-%d %H:%M:%S"),date_time=True))+""""""+ to_xml(company.name) +"""
-
- /
- 1.3cm 28.1cm 20cm 28.1cm
@@ -426,6 +422,7 @@ class survey_analysis(report_rml):
rml += """"""
report_type = datas.get('report_type', 'pdf')
create_doc = self.generators[report_type]
+ self.internal_header=True
pdf = create_doc(rml, title=self.title)
return (pdf, report_type)
diff --git a/addons/survey/report/survey_browse_response.py b/addons/survey/report/survey_browse_response.py
index a8bfa906c90..2cdb98622a9 100644
--- a/addons/survey/report/survey_browse_response.py
+++ b/addons/survey/report/survey_browse_response.py
@@ -273,7 +273,7 @@ class survey_browse_response(report_rml):
style = 'tbl_white'
else:
style = 'tbl_gainsboro'
- i +=1
+ i +=1
rml += """