+
+
diff --git a/addons/stock/wizard/stock_partial_picking.py b/addons/stock/wizard/stock_partial_picking.py
index 9ac3fab9f72..3580b21035d 100644
--- a/addons/stock/wizard/stock_partial_picking.py
+++ b/addons/stock/wizard/stock_partial_picking.py
@@ -1,9 +1,8 @@
-
# -*- coding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Management Solution
-# Copyright (C) 2004-2010 Tiny SPRL ().
+# Copyright (C) 2004-TODAY OpenERP SA ().
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as
@@ -20,169 +19,119 @@
#
##############################################################################
-from osv import fields, osv
-from tools.translate import _
import time
+from osv import fields, osv
+from tools.misc import DEFAULT_SERVER_DATETIME_FORMAT
+
+class stock_partial_picking_line(osv.TransientModel):
+ _name = "stock.partial.picking.line"
+ _rec_name = 'product_id'
+ _columns = {
+ 'product_id' : fields.many2one('product.product', string="Product", required=True, ondelete='CASCADE'),
+ 'quantity' : fields.float("Quantity", required=True),
+ 'product_uom': fields.many2one('product.uom', 'Unit of Measure', required=True, ondelete='CASCADE'),
+ 'prodlot_id' : fields.many2one('stock.production.lot', 'Production Lot', ondelete='CASCADE'),
+ 'location_id': fields.many2one('stock.location', 'Location', required=True, ondelete='CASCADE'),
+ 'location_dest_id': fields.many2one('stock.location', 'Dest. Location', required=True, ondelete='CASCADE'),
+ 'move_id' : fields.many2one('stock.move', "Move", ondelete='CASCADE'),
+ 'wizard_id' : fields.many2one('stock.partial.picking', string="Wizard", ondelete='CASCADE'),
+ 'update_cost': fields.boolean('Need cost update'),
+ 'cost' : fields.float("Cost", help="Unit Cost for this product line"),
+ 'currency' : fields.many2one('res.currency', string="Currency", help="Currency in which Unit cost is expressed", ondelete='CASCADE'),
+ }
class stock_partial_picking(osv.osv_memory):
_name = "stock.partial.picking"
- _description = "Partial Picking"
+ _description = "Partial Picking Processing Wizard"
_columns = {
'date': fields.datetime('Date', required=True),
- 'product_moves_out' : fields.one2many('stock.move.memory.out', 'wizard_id', 'Moves'),
- 'product_moves_in' : fields.one2many('stock.move.memory.in', 'wizard_id', 'Moves'),
+ 'move_ids' : fields.one2many('stock.partial.picking.line', 'wizard_id', 'Product Moves'),
+ 'picking_id': fields.many2one('stock.picking', 'Picking', required=True, ondelete='CASCADE'),
}
-
- def get_picking_type(self, cr, uid, picking, context=None):
- picking_type = picking.type
- for move in picking.move_lines:
- if picking.type == 'in' and move.product_id.cost_method == 'average':
- picking_type = 'in'
- break
- else:
- picking_type = 'out'
- return picking_type
-
+
def default_get(self, cr, uid, fields, context=None):
- """ To get default values for the object.
- @param self: The object pointer.
- @param cr: A database cursor
- @param uid: ID of the user currently logged in
- @param fields: List of fields for which we want default values
- @param context: A standard dictionary
- @return: A dictionary which of fields with values.
- """
- if context is None:
- context = {}
-
- pick_obj = self.pool.get('stock.picking')
+ if context is None: context = {}
res = super(stock_partial_picking, self).default_get(cr, uid, fields, context=context)
picking_ids = context.get('active_ids', [])
- if not picking_ids:
+ if not picking_ids or (not context.get('active_model') == 'stock.picking') \
+ or len(picking_ids) != 1:
+ # Partial Picking Processing may only be done for one picking at a time
return res
-
- result = []
- for pick in pick_obj.browse(cr, uid, picking_ids, context=context):
- pick_type = self.get_picking_type(cr, uid, pick, context=context)
- for m in pick.move_lines:
- if m.state in ('done', 'cancel'):
- continue
- result.append(self.__create_partial_picking_memory(m, pick_type))
-
- if 'product_moves_in' in fields:
- res.update({'product_moves_in': result})
- if 'product_moves_out' in fields:
- res.update({'product_moves_out': result})
+ picking_id, = picking_ids
+ if 'picking_id' in fields:
+ res.update(picking_id=picking_id)
+ if 'move_ids' in fields:
+ picking = self.pool.get('stock.picking').browse(cr, uid, picking_id, context=context)
+ moves = [self._partial_move_for(cr, uid, m) for m in picking.move_lines if m.state not in ('done','cancel')]
+ res.update(move_ids=moves)
if 'date' in fields:
- res.update({'date': time.strftime('%Y-%m-%d %H:%M:%S')})
+ res.update(date=time.strftime(DEFAULT_SERVER_DATETIME_FORMAT))
return res
-
- def fields_view_get(self, cr, uid, view_id=None, view_type='form', context=None, toolbar=False, submenu=False):
- result = super(stock_partial_picking, self).fields_view_get(cr, uid, view_id, view_type, context, toolbar, submenu)
-
- pick_obj = self.pool.get('stock.picking')
- picking_ids = context.get('active_ids', False)
- if not picking_ids:
- # not called through an action (e.g. buildbot), return the default.
- return result
-
- for pick in pick_obj.browse(cr, uid, picking_ids, context=context):
- picking_type = self.get_picking_type(cr, uid, pick, context=context)
+ def _product_cost_for_average_update(self, cr, uid, move):
+ """Returns product cost and currency ID for the given move, suited for re-computing
+ the average product cost.
- _moves_arch_lst = """
-
-
-
- """ % (_('Process Document'), _('Products'), "product_moves_" + picking_type)
- _moves_fields = result['fields']
+ :return: map of the form::
- # add field related to picking type only
- _moves_fields.update({
- 'product_moves_' + picking_type: {'relation': 'stock.move.memory.'+picking_type, 'type' : 'one2many', 'string' : 'Product Moves'},
- })
+ {'cost': 123.34,
+ 'currency': 42}
+ """
+ # Currently, the cost on the product form is supposed to be expressed in the currency
+ # of the company owning the product. If not set, we fall back to the picking's company,
+ # which should work in simple cases.
+ return {'cost': move.product_id.standard_price,
+ 'currency': move.product_id.company_id.currency_id.id \
+ or move.picking_id.company_id.currency_id.id \
+ or False}
- _moves_arch_lst += """
-
-
-
-
-
-
-
"""
- result['arch'] = _moves_arch_lst
- result['fields'] = _moves_fields
- return result
-
- def __create_partial_picking_memory(self, picking, pick_type):
- move_memory = {
- 'product_id' : picking.product_id.id,
- 'quantity' : picking.product_qty,
- 'product_uom' : picking.product_uom.id,
- 'prodlot_id' : picking.prodlot_id.id,
- 'move_id' : picking.id,
- 'location_id' : picking.location_id.id,
- 'location_dest_id' : picking.location_dest_id.id,
+ def _partial_move_for(self, cr, uid, move):
+ partial_move = {
+ 'product_id' : move.product_id.id,
+ 'quantity' : move.product_qty,
+ 'product_uom' : move.product_uom.id,
+ 'prodlot_id' : move.prodlot_id.id,
+ 'move_id' : move.id,
+ 'location_id' : move.location_id.id,
+ 'location_dest_id' : move.location_dest_id.id,
}
-
- if pick_type == 'in':
- move_memory.update({
- 'cost' : picking.product_id.standard_price,
- 'currency' : picking.product_id.company_id and picking.product_id.company_id.currency_id and picking.product_id.company_id.currency_id.id or False,
- })
- return move_memory
+ if move.picking_id.type == 'in' and move.product_id.cost_method == 'average':
+ partial_move.update(update_cost=True, **self._product_cost_for_average_update(cr, uid, move))
+ return partial_move
def do_partial(self, cr, uid, ids, context=None):
- """ Makes partial moves and pickings done.
- @param self: The object pointer.
- @param cr: A database cursor
- @param uid: ID of the user currently logged in
- @param fields: List of fields for which we want default values
- @param context: A standard dictionary
- @return: A dictionary which of fields with values.
- """
- pick_obj = self.pool.get('stock.picking')
- stock_move_obj = self.pool.get('stock.move')
- picking_ids = context.get('active_ids', False)
+ assert len(ids) == 1, 'Partial picking processing may only be done one at a time'
+ stock_picking = self.pool.get('stock.picking')
+ stock_move = self.pool.get('stock.move')
partial = self.browse(cr, uid, ids[0], context=context)
- partial_datas = {
+ partial_data = {
'delivery_date' : partial.date
}
- for pick in pick_obj.browse(cr, uid, picking_ids, context=context):
- picking_type = self.get_picking_type(cr, uid, pick, context=context)
- moves_list = picking_type == 'in' and partial.product_moves_in or partial.product_moves_out
- for move in moves_list:
- if not move.move_id.id:
- seq_obj_name = 'stock.picking.' + picking_type
- move_id = stock_move_obj.create(cr,uid,{'name' : self.pool.get('ir.sequence').get(cr, uid, seq_obj_name),
- 'product_id': move.product_id.id,
- 'product_qty': move.quantity,
- 'product_uom': move.product_uom.id,
- 'prodlot_id': move.prodlot_id.id,
- 'location_id' : move.location_id.id,
- 'location_dest_id' : move.location_dest_id.id,
- 'picking_id': pick.id
- },context=context)
- stock_move_obj.action_done(cr, uid, [move_id], context)
- else:
- move_id = move.move_id.id
-
- partial_datas['move%s' % (move_id)] = {
- 'product_id': move.product_id.id,
- 'product_qty': move.quantity,
- 'product_uom': move.product_uom.id,
- 'prodlot_id': move.prodlot_id.id,
- }
- if (picking_type == 'in') and (move.product_id.cost_method == 'average'):
- partial_datas['move%s' % (move.move_id.id)].update({
- 'product_price' : move.cost,
- 'product_currency': move.currency.id,
- })
- pick_obj.do_partial(cr, uid, picking_ids, partial_datas, context=context)
+ picking_type = partial.picking_id.type
+ for move in partial.move_ids:
+ move_id = move.move_id.id
+ if not move_id:
+ seq_obj_name = 'stock.picking.' + picking_type
+ move_id = stock_move.create(cr,uid,{'name' : self.pool.get('ir.sequence').get(cr, uid, seq_obj_name),
+ 'product_id': move.product_id.id,
+ 'product_qty': move.quantity,
+ 'product_uom': move.product_uom.id,
+ 'prodlot_id': move.prodlot_id.id,
+ 'location_id' : move.location_id.id,
+ 'location_dest_id' : move.location_dest_id.id,
+ 'picking_id': partial.picking_id.id
+ },context=context)
+ stock_move.action_done(cr, uid, [move_id], context)
+ partial_data['move%s' % (move_id)] = {
+ 'product_id': move.product_id.id,
+ 'product_qty': move.quantity,
+ 'product_uom': move.product_uom.id,
+ 'prodlot_id': move.prodlot_id.id,
+ }
+ if (picking_type == 'in') and (move.product_id.cost_method == 'average'):
+ partial_data['move%s' % (move.move_id.id)].update(product_price=move.cost,
+ product_currency=move.currency.id)
+ stock_picking.do_partial(cr, uid, [partial.picking_id.id], partial_data, context=context)
return {'type': 'ir.actions.act_window_close'}
-stock_partial_picking()
-
-# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
+# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
\ No newline at end of file
diff --git a/addons/stock/wizard/stock_partial_picking_view.xml b/addons/stock/wizard/stock_partial_picking_view.xml
index 4887c1e16d8..be85d266673 100644
--- a/addons/stock/wizard/stock_partial_picking_view.xml
+++ b/addons/stock/wizard/stock_partial_picking_view.xml
@@ -9,5 +9,59 @@
new
+
+ stock.partial.picking.form
+ stock.partial.picking
+ form
+
+
+
+
diff --git a/addons/stock/wizard/stock_replacement.py b/addons/stock/wizard/stock_replacement.py
deleted file mode 100644
index 17f4d5a62ab..00000000000
--- a/addons/stock/wizard/stock_replacement.py
+++ /dev/null
@@ -1,61 +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 _
-import time
-
-class stock_replacement(osv.osv_memory):
- """
- This class has been defined for replacement wizard
- """
- _name = "stock.replacement"
- _description = "Stock Replacement"
-
- def get_composant(self, cr, uid, ids, context=None):
- return {}
-
- def replace_composant(self, cr, uid, ids, context=None):
- """ To open a new wizard that acknowledge, a replacement task
- @return: It returns the replacement acknowledgement form
- """
- return {
- 'name': False,
- 'view_type': 'form',
- 'view_mode': 'form',
- 'res_model': 'stock.replacement.result',
- 'type': 'ir.actions.act_window',
- 'target':'new',
- }
-
-stock_replacement()
-
-class stock_replacement_result(osv.osv_memory):
- """
- This class has been defined for replacement result
- """
- _name = "stock.replacement.result"
- _description = "Stock Replacement result"
-
-stock_replacement_result()
-
-# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
-
diff --git a/addons/stock/wizard/stock_replacement_view.xml b/addons/stock/wizard/stock_replacement_view.xml
deleted file mode 100644
index cea5bfedbe8..00000000000
--- a/addons/stock/wizard/stock_replacement_view.xml
+++ /dev/null
@@ -1,41 +0,0 @@
-
-
-
-
- Stock Replacement
- stock.replacement
- form
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- Stock Replacement result
- stock.replacement.result
- form
-
-
-
-
-
-
-
-
-
-
-
diff --git a/addons/stock/wizard/stock_ups.py b/addons/stock/wizard/stock_ups.py
deleted file mode 100644
index fb47587f254..00000000000
--- a/addons/stock/wizard/stock_ups.py
+++ /dev/null
@@ -1,95 +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 netsvc
-from osv import fields, osv
-from tools.translate import _
-
-class stock_ups(osv.osv_memory):
- _name = "stock.ups"
- _description = "Stock ups"
-
- def ups_save(self, cr, uid, ids, context=None):
- return {
- 'name': False,
- 'view_type': 'form',
- 'view_mode': 'form',
- 'res_model': 'stock.ups.final',
- 'type': 'ir.actions.act_window',
- 'target':'new',
- }
-
- def ups_upload(self, cr, uid, ids, context=None):
- return {
- 'name': False,
- 'view_type': 'form',
- 'view_mode': 'form',
- 'res_model': 'stock.ups.upload',
- 'type': 'ir.actions.act_window',
- 'target':'new',
- }
-
- _columns = {
- 'weight': fields.float('Lot weight', required=True),
- }
-
- _defaults = {
- 'weight': lambda *a: 3.0,
- }
-stock_ups()
-
-class stock_ups_final(osv.osv_memory):
- _name = "stock.ups.final"
- _description = "Stock ups final"
-
- def create_xmlfile(self, cr, uid, ids, context=None):
- """ Creates xml report file.
- @return: xml file
- """
- data={}
- report = netsvc._group['report']['report.stock.move.lot.ups_xml']
- data['report_type'] = 'raw'
- return {'xmlfile' : report.create(uid, context['active_id'], ids, {})}
-
- _columns = {
- 'xmlfile': fields.binary('XML File'),
- }
-
-stock_ups_final()
-
-class stock_ups_upload(osv.osv_memory):
- _name = "stock.ups.upload"
- _description = "Stock ups upload"
-
- def upload_xmlfile(self, cr, uid, ids, context=None):
- """ Uploads xml report file.
- @return:
- """
- data={}
- report = netsvc._group['report']['report.stock.move.lot.ups_xml']
- data['report_type'] = 'raw'
- fp = file('/tmp/test.xml', 'w').write(report.create(uid, context['active_id'], ids, {}))
- return {'type': 'ir.actions.act_window_close'}
-
-stock_ups_upload()
-
-# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
-
diff --git a/addons/stock/wizard/stock_ups_view.xml b/addons/stock/wizard/stock_ups_view.xml
deleted file mode 100644
index cbce721e1b9..00000000000
--- a/addons/stock/wizard/stock_ups_view.xml
+++ /dev/null
@@ -1,56 +0,0 @@
-
-
-
-
-
- Stock ups
- stock.ups
- form
-
-
-
-
-
-
-
-
-
-
-
-
-
- Stock ups
- stock.ups.final
- form
-
-
-
-
-
-
-
-
-
-
-
- Stock ups
- stock.ups.upload
- form
-
-
-
-
-
-
-
-
-
-
-
-
diff --git a/addons/stock_invoice_directly/test/stock_invoice_directly.yml b/addons/stock_invoice_directly/test/stock_invoice_directly.yml
index 6d70540b4d5..795da509d04 100644
--- a/addons/stock_invoice_directly/test/stock_invoice_directly.yml
+++ b/addons/stock_invoice_directly/test/stock_invoice_directly.yml
@@ -38,33 +38,19 @@
"active_ids": [ref("stock.menu_action_picking_tree")], "active_id": ref("stock.menu_action_picking_tree"),
})
-
- I create a record for partial picking.
--
- !record {model: stock.partial.picking, id: stock_partial_picking_0}:
- date: !eval time.strftime('%Y-%m-%d %H:%M:%S')
--
- I make picking order Done.
+ I process the delivery
-
!python {model: stock.partial.picking}: |
- pick_obj = self.pool.get('stock.picking')
- partial = self.browse(cr, uid, ref('stock_partial_picking_0'), context)
- partial_datas = {
- 'delivery_date' : partial.date
- }
- for pick in pick_obj.browse(cr, uid, [ref('stock_picking_out0')]):
- for m in pick.move_lines:
- partial_datas['move%s'%(m.id)] = {
- 'product_id' : m.product_id.id,
- 'product_qty' : m.product_qty,
- 'product_uom' : m.product_uom.id
- }
- pick_obj.do_partial(cr, uid, [ref('stock_picking_out0')], partial_datas, context=context)
+ partial_id = self.create(cr, uid, {}, context={'active_model':'stock.picking',
+ 'active_ids':[ref('stock_picking_out0')]})
+ self.do_partial(cr, uid, [partial_id])
+
-
As the Invoice state of the picking order is To be invoiced. I create invoice for my outgoing picking order.
-
!python {model: stock.invoice.onshipping}: |
- wiz_id = self.create(cr, uid, {'invoice_date': '2010-08-04', 'journal_id': ref('account.bank_journal')},
- {'active_ids': [ref("stock_picking_out0")]})
+ wiz_id = self.create(cr, uid, {'invoice_date': '2010-08-04', 'journal_id': ref('account.sales_journal')},
+ {'active_ids': [ref("stock_picking_out0")], "active_model": "stock.picking"})
self.create_invoice(cr, uid, [wiz_id], {"lang": "en_US",
"search_default_available": 1, "tz": False, "active_model": "stock.picking",
"contact_display": "partner", "active_ids": [ref("stock_picking_out0")], "active_id": ref("stock_picking_out0")})
diff --git a/addons/stock_invoice_directly/wizard/stock_invoice.py b/addons/stock_invoice_directly/wizard/stock_invoice.py
index 11b31725a88..3725d9b6d7f 100644
--- a/addons/stock_invoice_directly/wizard/stock_invoice.py
+++ b/addons/stock_invoice_directly/wizard/stock_invoice.py
@@ -25,24 +25,15 @@ class invoice_directly(osv.osv_memory):
_inherit = 'stock.partial.picking'
def do_partial(self, cr, uid, ids, context=None):
- """ Makes partial moves and pickings done and
- launches Create invoice wizard if invoice state is To be Invoiced.
- @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:
+ """Launch Create invoice wizard if invoice state is To be Invoiced,
+ after processing the partial picking.
"""
- if context is None:
- context = {}
+ if context is None: context = {}
result = super(invoice_directly, self).do_partial(cr, uid, ids, context)
- pick_obj = self.pool.get('stock.picking')
- context.update({'active_model':'stock.picking'})
- picking_ids = context.get('active_ids', False)
- if picking_ids:
- context.update({'active_id':picking_ids[0]})
- pick = pick_obj.browse(cr, uid, picking_ids, context=context)[0]
- if pick.invoice_state == '2binvoiced':
+ partial = self.browse(cr, uid, ids[0], context)
+ context.update(active_model='stock.picking',
+ active_ids=[partial.picking_id.id])
+ if partial.picking_id.invoice_state == '2binvoiced':
return {
'name': 'Create Invoice',
'view_type': 'form',
@@ -55,5 +46,5 @@ class invoice_directly(osv.osv_memory):
return {'type': 'ir.actions.act_window_close'}
invoice_directly()
-# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
+# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
\ No newline at end of file
diff --git a/addons/stock_location/__openerp__.py b/addons/stock_location/__openerp__.py
index ba81a42de5a..d50bcc0cac4 100644
--- a/addons/stock_location/__openerp__.py
+++ b/addons/stock_location/__openerp__.py
@@ -96,8 +96,8 @@ You can use the demo data as follow:
],
'installable': True,
'test':[
-# 'test/stock_location_pull_flow.yml',
-# 'test/stock_location_push_flow.yml',
+ 'test/stock_location_pull_flow.yml',
+ 'test/stock_location_push_flow.yml',
],
'active': False,
'certificate': '0046505115101',
diff --git a/addons/stock_location/test/stock_location_pull_flow.yml b/addons/stock_location/test/stock_location_pull_flow.yml
index 557162c725d..dec830b2d77 100644
--- a/addons/stock_location/test/stock_location_pull_flow.yml
+++ b/addons/stock_location/test/stock_location_pull_flow.yml
@@ -28,7 +28,7 @@
I create a account type Receivable.
-
!record {model: account.account.type, id: account_account_type_receivable0}:
- close_method: balance
+ close_method: unreconciled
code: receivable_test
name: Receivable For Tests
sign: 1
@@ -126,7 +126,7 @@
I create a product and define the pulled flow condition for stock move.
I set shipping type Sending Goods. and set Procurement type to move.
-
- !record {model: product.product, id: product_product_hpcdwriters0}:
+ !record {model: product.product, id: product_product_hpcdwriters01}:
categ_id: product_category_computer0
cost_method: standard
list_price: 1000.0
@@ -179,7 +179,7 @@
name: Testing pulled flow
priority: '1'
procure_method: make_to_order
- product_id: product_product_hpcdwriters0
+ product_id: product_product_hpcdwriters01
product_qty: 5.0
product_uom: product.product_uom_unit
product_uos: product.product_uom_unit
@@ -194,15 +194,7 @@
!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 procurement order has been created .
-
diff --git a/addons/stock_location/test/stock_location_push_flow.yml b/addons/stock_location/test/stock_location_push_flow.yml
index db2ae388317..b6a938e99e5 100644
--- a/addons/stock_location/test/stock_location_push_flow.yml
+++ b/addons/stock_location/test/stock_location_push_flow.yml
@@ -33,7 +33,7 @@
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}:
+ !record {model: product.product, id: product_product_hpcdwriters01}:
categ_id: product_category_computer0
cost_method: standard
list_price: 1000.0
@@ -72,7 +72,7 @@
location_dest_id: stock.stock_location_stock
location_id: stock.stock_location_suppliers
name: 'HP CD writers'
- product_id: product_product_hpcdwriters0
+ product_id: product_product_hpcdwriters01
product_qty: 6.0
product_uom: product.product_uom_unit
product_uos_qty: 6.0
diff --git a/addons/stock_planning/i18n/fr.po b/addons/stock_planning/i18n/fr.po
index 28e37d8934e..a5dd24c6c6b 100644
--- a/addons/stock_planning/i18n/fr.po
+++ b/addons/stock_planning/i18n/fr.po
@@ -7,14 +7,14 @@ msgstr ""
"Project-Id-Version: OpenERP Server 6.0dev\n"
"Report-Msgid-Bugs-To: support@openerp.com\n"
"POT-Creation-Date: 2011-01-11 11:16+0000\n"
-"PO-Revision-Date: 2011-01-13 22:58+0000\n"
-"Last-Translator: Quentin THEURET \n"
+"PO-Revision-Date: 2011-09-26 12:15+0000\n"
+"Last-Translator: lholivier \n"
"Language-Team: \n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
-"X-Launchpad-Export-Date: 2011-09-05 05:51+0000\n"
-"X-Generator: Launchpad (build 13830)\n"
+"X-Launchpad-Export-Date: 2011-09-27 04:47+0000\n"
+"X-Generator: Launchpad (build 14028)\n"
#. module: stock_planning
#: code:addons/stock_planning/wizard/stock_planning_createlines.py:73
@@ -473,7 +473,7 @@ msgstr "Erreur !"
#: code:addons/stock_planning/stock_planning.py:626
#, python-format
msgid "Manual planning for %s"
-msgstr ""
+msgstr "Planification manuelle pour %s"
#. module: stock_planning
#: field:stock.sale.forecast,analyzed_user_id:0
@@ -1648,7 +1648,7 @@ msgstr ""
#. module: stock_planning
#: field:stock.planning,history:0
msgid "Procurement History"
-msgstr "Historique du besoin"
+msgstr "Historique d'approvisionnement"
#. module: stock_planning
#: help:stock.period.createlines,date_start:0
diff --git a/addons/stock_planning/stock_planning.py b/addons/stock_planning/stock_planning.py
index fe0b2f8f3ce..3ec992ecd0c 100644
--- a/addons/stock_planning/stock_planning.py
+++ b/addons/stock_planning/stock_planning.py
@@ -46,7 +46,7 @@ class stock_period(osv.osv):
'name': fields.char('Period Name', size=64, required=True),
'date_start': fields.datetime('Start Date', required=True),
'date_stop': fields.datetime('End Date', required=True),
- 'state': fields.selection([('draft','Draft'), ('open','Open'),('close','Close')], 'State')
+ 'state': fields.selection([('draft','Draft'), ('open','Open'),('close','Close')], 'State'),
}
_defaults = {
'state': 'draft'
diff --git a/addons/stock_planning/test/stock_planning.yml b/addons/stock_planning/test/stock_planning.yml
index 77f1d5a427d..df2f53dbb6e 100644
--- a/addons/stock_planning/test/stock_planning.yml
+++ b/addons/stock_planning/test/stock_planning.yml
@@ -38,6 +38,18 @@
date_start: !eval "'%s-07-29 00:00:00' %(datetime.now().year)"
date_stop: !eval "'%s-07-31 23:59:00' %(datetime.now().year)"
name: !eval "'%s, week 31' %(datetime.now().year)"
+-
+ I validate in open state module stock.period
+-
+ !python {model: stock.period}: |
+ self.button_open(cr, uid, [ref("stock_period_01")], {"lang": 'en_GB', "tz": False, "active_model": 'ir.ui.menu', "active_id": ref("stock_planning.menu_stock_period_main"), "active_ids": [ref("stock_planning.menu_stock_period_main")], "department_id": False})
+
+-
+ I validate in close state module stock.period
+-
+ !python {model: stock.period}: |
+ self.button_close(cr, uid, [ref("stock_period_01")], {"lang": 'en_GB', "tz": False, "active_model": 'ir.ui.menu', "active_id": ref("stock_planning.menu_stock_period_main"), "active_ids": [ref("stock_planning.menu_stock_period_main")], "department_id": False})
+
-
Now I create the forecast for this period for all PCs.
-
@@ -54,6 +66,66 @@
'en_US', "active_model": "ir.ui.menu", "active_ids": [ref("stock_planning.menu_stock_sale_forecast_createlines")],
"tz": False, "active_id": ref("stock_planning.menu_stock_sale_forecast_createlines"),
})
+
+-
+ I create stock.period.createlines for the first week of august.
+-
+ !record {model: stock.period.createlines, id: stock_period_createlines_week01}:
+ date_start: !eval "'%s-08-01' %(datetime.now().year)"
+ date_stop: !eval "'%s-08-06' %(datetime.now().year)"
+ name: !eval "'%s, week 31' %(datetime.now().year)"
+
+-
+ Performing an osv_memory action create_stock_periods on module stock.period.createlines
+-
+ !python {model: stock.period.createlines}: |
+ self.create_stock_periods(cr, uid, [ref("stock_period_createlines_week01")], {"lang":
+ 'en_US', "name": 'Weekly', "interval": 6, "active_model": "ir.ui.menu", "active_ids": [ref("stock_planning.menu_stock_period_creatlines")],
+ "tz": False, "active_id": ref("stock_planning.menu_stock_period_creatlines"),
+ })
+-
+ I create stock.period.createlines for the month of august - september
+-
+ !record {model: stock.period.createlines, id: stock_period_createlines_month01}:
+ date_start: !eval "'%s-08-01' %(datetime.now().year)"
+ date_stop: !eval "'%s-09-01' %(datetime.now().year)"
+ name: !eval "'%s, month 8' %(datetime.now().year)"
+
+-
+ Performing an osv_memory action create_stock_periods on module stock.period.createlines
+-
+ !python {model: stock.period.createlines}: |
+ self.create_stock_periods(cr, uid, [ref("stock_period_createlines_month01")], {"lang":
+ 'en_US', "name": 'Monthly', "interval": 6, "active_model": "ir.ui.menu", "active_ids": [ref("stock_planning.menu_stock_period_creatlines")],
+ "tz": False, "active_id": ref("stock_planning.menu_stock_period_creatlines"),
+ })
+
+-
+ I create stock.period.createlines for the Day of august
+-
+ !record {model: stock.period.createlines, id: stock_period_createlines_day01}:
+ date_start: !eval "'%s-08-01' %(datetime.now().year)"
+ date_stop: !eval "'%s-08-01' %(datetime.now().year)"
+ name: !eval "'%s, day 01' %(datetime.now().year)"
+
+-
+ Performing an osv_memory action create_stock_periods on module stock.period.createlines
+-
+ !python {model: stock.period.createlines}: |
+ self.create_stock_periods(cr, uid, [ref("stock_period_createlines_day01")], {"lang":
+ 'en_US', "name": 'Daily', "interval": 6, "active_model": "ir.ui.menu", "active_ids": [ref("stock_planning.menu_stock_period_creatlines")],
+ "tz": False, "active_id": ref("stock_planning.menu_stock_period_creatlines"),
+ })
+
+-
+ I Read date_start on module stock.period.createlines.
+-
+ !python {model: stock.period.createlines }: |
+ self._get_new_period_start(cr, uid,{"lang":'en_US', "active_model": "ir.ui.menu",
+ "active_ids": [ref("stock_planning.menu_stock_period_creatlines")],
+ "tz": False, "active_id": ref("stock_planning.menu_stock_period_creatlines"),"department_id": False
+ })
+
-
I create a sale order for PC1-Basic PC and PC3-Medium PC.
-
@@ -100,11 +172,29 @@
'analyzed_period1_id': ref("stock_period_03"),
'analyzed_user_id': ref("base.user_root"),
'analyzed_warehouse_id': ref("stock.warehouse0")}
+ context = {"lang": "en_US", "tz":False, "search_default_create_uid": 1, "active_model": "ir.ui.menu",
+ "department_id": False, "active_ids": [ref("stock_planning.menu_stock_sale_forecast_all")],
+ "active_id": ref("stock_planning.menu_stock_sale_forecast_all"), }
self.write(cr, uid, forecast_ids, write_dict)
- self.calculate_sales_history(cr, uid, forecast_ids, {"lang": "en_US", "tz":
+ self.calculate_sales_history(cr, uid, forecast_ids, context)
+ self.action_validate(cr, uid, forecast_ids, context)
+
+-
+ Now I applying onchange and unlink forecast record for the product PC3
+-
+ !python {model: stock.sale.forecast}: |
+ forecast_ids = self.search(cr, uid, [('product_id','=',ref('product.product_product_pc3'))])
+ self.unlink(cr, uid, forecast_ids, {"lang": "en_US", "tz":
False, "search_default_create_uid": 1, "active_model": "ir.ui.menu", "department_id":
False, "active_ids": [ref("stock_planning.menu_stock_sale_forecast_all")], "active_id":
ref("stock_planning.menu_stock_sale_forecast_all"), })
+ self.product_id_change(cr, uid, forecast_ids, ref('product.product_product_20'))
+ self.onchange_uom(cr, uid, forecast_ids, ref('product.product_uom_unit'), False, ref('product.product_uom_unit'), ref('product.product_product_20'))
+ self.product_amt_change(cr, uid, forecast_ids, 5.0, ref('product.product_uom_unit'), ref('product.product_product_20'))
+ self.product_amt_change(cr, uid, forecast_ids, 5.0, ref('product.product_uom_unit'), ref('product.product_product_20'))
+ self._to_default_uom_factor(cr, uid, ref('product.product_product_20'), ref('product.product_uom_unit'), {})
+ self.onchange_company(cr, uid, forecast_ids, ref('stock.res_company_tinyshop0'))
+
-
I create Master procurement schedule for the third week of July.
-
@@ -113,10 +203,22 @@
period_id: stock_period_03
product_categ_id: product.product_category_pc
warehouse_id: stock.warehouse0
+
+-
+ I create source warehouse for supply from another warehouse.
+-
+ !record {model: stock.warehouse, id: stock_warehouse_0}:
+ name: shop1
+ company_id: base.main_company
+ lot_input_id: stock.stock_location_stock
+ lot_stock_id: stock.stock_location_stock
+ lot_output_id: stock.stock_location_output
+
-
Performing an osv_memory action create_planning on module stock.planning.createlines
-
!python {model: stock.planning.createlines}: |
+ self.onchange_company(cr, uid, ref("stock_planning_createlines_0"), ref('stock.res_company_tinyshop0'))
self.create_planning(cr, uid, [ref("stock_planning_createlines_0")], {"lang":
"en_US", "tz": False, "active_model": "ir.ui.menu", "active_ids": [ref("stock_planning.menu_stock_planning_createlines")],
"active_id": ref("stock_planning.menu_stock_planning_createlines"), "department_id":
@@ -126,11 +228,17 @@
-
!python {model: stock.planning}: |
planning_ids = self.search(cr, uid, [('product_id','=',ref('product.product_product_pc1')),('period_id','=',ref('stock_period_03'))])
- self.write(cr, uid, planning_ids, {'to_procure': 30.0,'planned_outgoing': 40.0})
- self.calculate_planning(cr, uid, planning_ids, {"lang": "en_US", "tz": False,
- "active_model": "ir.ui.menu", "active_ids": [ref("stock_planning.menu_stock_planning")],
+ self.write(cr, uid, planning_ids, {'to_procure': 30.0,'planned_outgoing': 40.0,'supply_warehouse_id': ref("stock_warehouse_0")})
+ self.onchange_company(cr, uid, planning_ids, ref('stock.res_company_tinyshop0'))
+ self.onchange_uom(cr, uid, planning_ids, ref('product.product_uom_unit'), ref('product.product_product_pc1'),ref('product.product_uom_unit'), False, False)
+ self.product_id_change(cr, uid, planning_ids, ref('product.product_product_20'))
+ context = {"lang": "en_US", "tz": False, "active_model": "ir.ui.menu",
+ "active_ids": [ref("stock_planning.menu_stock_planning")],
"active_id": ref("stock_planning.menu_stock_planning"), "department_id": False,
- })
+ }
+ self.calculate_planning(cr, uid, planning_ids, context)
+ self.internal_supply(cr, uid, planning_ids, context)
+
-
I create a procurement order for the incoming products left.
-
diff --git a/addons/stock_planning/wizard/stock_planning_create_periods.py b/addons/stock_planning/wizard/stock_planning_create_periods.py
index 05f8aa925a9..963ff416822 100644
--- a/addons/stock_planning/wizard/stock_planning_create_periods.py
+++ b/addons/stock_planning/wizard/stock_planning_create_periods.py
@@ -46,6 +46,7 @@ class stock_period_createlines(osv.osv_memory):
'date_start': fields.date('Start Date', required=True, help="Starting date for planning period."),
'date_stop': fields.date('End Date', required=True, help="Ending date for planning period."),
'period_ids': fields.one2many('stock.period', 'planning_id', 'Periods'),
+ 'period_ids': fields.many2many('stock.period', 'stock_period_createlines_stock_period_rel', 'wizard_id', 'period_id', 'Periods'),
}
_defaults={
'date_start': _get_new_period_start,
diff --git a/addons/survey/survey.py b/addons/survey/survey.py
index 78b824af004..8bce83380b6 100644
--- a/addons/survey/survey.py
+++ b/addons/survey/survey.py
@@ -58,7 +58,7 @@ class survey(osv.osv):
help="Set to one if survey is answerable only once"),
'response_user': fields.integer('Maximum Answer per User',
help="Set to one if you require only one Answer per user"),
- 'state': fields.selection([('draft', 'Draft'), ('open', 'Open'), ('close', 'Closed'), ('cancel', 'Cancelled')], 'Status', readonly=True),
+ 'state': fields.selection([('open', 'Open'), ('close', 'Closed'), ('cancel', 'Cancelled')], 'Status', readonly=True),
'responsible_id': fields.many2one('res.users', 'Responsible', help="User responsible for survey"),
'tot_start_survey': fields.integer("Total Started Survey", readonly=1),
'tot_comp_survey': fields.integer("Total Completed Survey", readonly=1),
@@ -70,17 +70,13 @@ class survey(osv.osv):
'invited_user_ids': fields.many2many('res.users', 'survey_invited_user_rel', 'sid', 'uid', 'Invited User'),
}
_defaults = {
- 'state': lambda * a: "draft",
+ 'state': lambda * a: "open",
'tot_start_survey': lambda * a: 0,
'tot_comp_survey': lambda * a: 0,
'send_response': lambda * a: 1,
'response_user': lambda * a:1,
}
- def survey_draft(self, cr, uid, ids, arg):
- self.write(cr, uid, ids, {'state': 'draft'})
- return True
-
def survey_open(self, cr, uid, ids, arg):
self.write(cr, uid, ids, {'state': 'open', 'date_open': strftime("%Y-%m-%d %H:%M:%S")})
return True
diff --git a/addons/survey/survey_demo.xml b/addons/survey/survey_demo.xml
index 97e8daeb5b4..89571bd647a 100644
--- a/addons/survey/survey_demo.xml
+++ b/addons/survey/survey_demo.xml
@@ -1281,6 +1281,7 @@
20
+ open5
@@ -2140,7 +2141,7 @@
Community SurveyPlease take a few minutes to complete this survey on the quality of service we provide. We welcome your feedback and appreciate your honesty. With your help, we hope to strengthen the bond between our clients.
- draft
+ open
diff --git a/addons/survey/survey_view.xml b/addons/survey/survey_view.xml
index 00ac7620be7..f92ce45a037 100644
--- a/addons/survey/survey_view.xml
+++ b/addons/survey/survey_view.xml
@@ -180,14 +180,12 @@
-
+
-
-
+
@@ -261,7 +259,8 @@
-
+
+
diff --git a/addons/survey/test/survey00.yml b/addons/survey/test/survey00.yml
index 7bfe8a5320d..fa56e9fac39 100644
--- a/addons/survey/test/survey00.yml
+++ b/addons/survey/test/survey00.yml
@@ -144,8 +144,8 @@
Give answer of the survey, Run "Answer a Survey" wizard and select the survey and press on start button then run the selected survey.
-
!python {model: survey.name.wiz}: |
- ids = self.create(cr, uid, {'survey_id': ref("survey_partner_0")})
- self.action_next(cr, uid, [ids], context)
+ id = self.create(cr, uid, {'survey_id': ref("survey_partner_0")})
+ self.action_next(cr, uid, [id], context)
-
Give answer of the first and second page in "Partner Feedback" suvey.
-
diff --git a/addons/survey/wizard/survey_answer.py b/addons/survey/wizard/survey_answer.py
index 471290af2cb..be43a409774 100644
--- a/addons/survey/wizard/survey_answer.py
+++ b/addons/survey/wizard/survey_answer.py
@@ -40,14 +40,6 @@ class survey_question_wiz(osv.osv_memory):
def fields_view_get(self, cr, uid, view_id=None, view_type='form', context=None, toolbar=False, submenu=False):
"""
Fields View Get method :- generate the new view and display the survey pages of selected survey.
-
- @param self: The object pointer
- @param cr: the current row, from the database cursor,
- @param uid: the current user’s ID for security checks,
- @param view_id : view id of the current object.
- @param view_type : which type of view is create. like :- form, tree ,search etc...
- @param context: A standard dictionary for contextual values
- @return : Dictionary value for created view of particular survey pages.
"""
result = super(survey_question_wiz, self).fields_view_get(cr, uid, view_id, \
@@ -88,7 +80,7 @@ class survey_question_wiz(osv.osv_memory):
if not survey_id:
# Try one more time to find it
if sur_name_rec and sur_name_rec.survey_id:
- survey_id = sur_name_rec.survey_id[0]
+ survey_id = sur_name_rec.survey_id.id
else:
# raise osv.except_osv(_('Error!'), _("Cannot locate survey for the question wizard!"))
# If this function is called without a survey_id in
@@ -398,10 +390,10 @@ class survey_question_wiz(osv.osv_memory):
sur_response_obj.write(cr, uid, [sur_name_read.response], {'state' : 'done'})
if sur_rec.send_response:
- survey_data = survey_obj.browse(cr, uid, int(survey_id))
+ survey_data = survey_obj.browse(cr, uid, survey_id)
response_id = surv_name_wiz.read(cr, uid, context.get('sur_name_id',False))['response']
context.update({'response_id':response_id})
- report = self.create_report(cr, uid, [int(survey_id)], 'report.survey.browse.response', survey_data.title,context)
+ report = self.create_report(cr, uid, [survey_id], 'report.survey.browse.response', survey_data.title,context)
attachments = {}
file = open(addons.get_module_resource('survey', 'report') + survey_data.title + ".pdf")
file_data = ""
@@ -445,15 +437,6 @@ class survey_question_wiz(osv.osv_memory):
def create_report(self, cr, uid, res_ids, report_name=False, file_name=False, context=None):
"""
If any user give answer of survey then last create report of this answer and if 'E-mail Notification on Answer' set True in survey then send mail on responsible person of this survey and attach survey answer report in pdf format.
-
- @param self: The object pointer
- @param cr: the current row, from the database cursor,
- @param uid: the current user’s ID for security checks,
- @param res_ids: List of survey answer IDs,
- @param report_name: name of the report,
- @param file_name: To give file name of the report,
- @param context: A standard dictionary for contextual values,
- @return : Dictionary value for created report with file nameself.
"""
if not report_name or not res_ids:
return (False, Exception('Report name and Resources ids are required !!!'))
@@ -474,13 +457,6 @@ class survey_question_wiz(osv.osv_memory):
def default_get(self, cr, uid, fields_list, context=None):
"""
Assign Default value in particular field. If Browse Answers wizard run then read the value into database and Assigne to a particular fields.
-
- @param self: The object pointer
- @param cr: the current row, from the database cursor,
- @param uid: the current user’s ID for security checks,
- @param fields_list: List of fields of current view,
- @param context: A standard dictionary for contextual values,
- @return : Dictionary value for fields list with value.
"""
value = {}
if context is None:
@@ -556,13 +532,6 @@ class survey_question_wiz(osv.osv_memory):
def create(self, cr, uid, vals, context=None):
"""
Create the Answer of survey and store in survey.response object, and if set validation of question then check the value of question if value is wrong then raise the exception.
-
- @param self: The object pointer
- @param cr: the current row, from the database cursor,
- @param uid: the current user’s ID for security checks,
- @param vals: Values,
- @param context: A standard dictionary for contextual values
- @return : True.
"""
if context is None: context = {}
if context.has_key('active') and context.get('active',False):
@@ -600,9 +569,10 @@ class survey_question_wiz(osv.osv_memory):
#click first time on next button then increemnet on total start suvey
if not sur_name_read['store_ans']:
his_id = self.pool.get('survey.history').create(cr, uid, {'user_id': uid, \
- 'date': strftime('%Y-%m-%d %H:%M:%S'), 'survey_id': sur_name_read['survey_id']})
- sur_rec = survey_obj.read(cr, uid, sur_name_read['survey_id'])
- survey_obj.write(cr, uid, sur_name_read['survey_id'], {'tot_start_survey' : sur_rec['tot_start_survey'] + 1})
+ 'date': strftime('%Y-%m-%d %H:%M:%S'), 'survey_id': sur_name_read['survey_id'][0]})
+ survey_id = sur_name_read['survey_id'][0]
+ sur_rec = survey_obj.read(cr, uid, survey_id)
+ survey_obj.write(cr, uid, survey_id, {'tot_start_survey' : sur_rec['tot_start_survey'] + 1})
if context.has_key('cur_id'):
if context.has_key('request') and context.get('request',False):
self.pool.get(context.get('object',False)).write(cr, uid, [int(context.get('cur_id',False))], {'response' : response_id})
@@ -1016,13 +986,6 @@ class survey_question_wiz(osv.osv_memory):
def action_new_question(self,cr, uid, ids, context=None):
"""
New survey.Question form.
-
- @param self: The object pointer
- @param cr: the current row, from the database cursor,
- @param uid: the current user’s ID for security checks,
- @param ids: List of survey.question.wiz IDs
- @param context: A standard dictionary for contextual values
- @return : Dictionary value for Open new survey.Qestion form.
"""
if context is None:
context = {}
@@ -1044,13 +1007,6 @@ class survey_question_wiz(osv.osv_memory):
def action_new_page(self, cr, uid, ids, context=None):
"""
New survey.Page form.
-
- @param self: The object pointer
- @param cr: the current row, from the database cursor,
- @param uid: the current user’s ID for security checks,
- @param ids: List of survey.question.wiz IDs
- @param context: A standard dictionary for contextual values
- @return : Dictionary value for Open new survey.page form.
"""
if context is None:
context = {}
@@ -1072,13 +1028,6 @@ class survey_question_wiz(osv.osv_memory):
def action_edit_page(self,cr, uid, ids, context=None):
"""
Edit survey.page.
-
- @param self: The object pointer
- @param cr: the current row, from the database cursor,
- @param uid: the current user’s ID for security checks,
- @param ids: List of survey.question.wiz IDs
- @param context: A standard dictionary for contextual values
- @return : Dictionary value for Open Edit survey.page form.
"""
if context is None:
context = {}
@@ -1101,13 +1050,6 @@ class survey_question_wiz(osv.osv_memory):
def action_delete_page(self,cr, uid, ids, context=None):
"""
Delete survey.page.
-
- @param self: The object pointer
- @param cr: the current row, from the database cursor,
- @param uid: the current user’s ID for security checks,
- @param ids: List of survey.question.wiz IDs
- @param context: A standard dictionary for contextual values
- @return : Dictionary value for Open next survey.page form, but delete the selected page.
"""
if context is None:
context = {}
@@ -1134,13 +1076,6 @@ class survey_question_wiz(osv.osv_memory):
def action_edit_question(self,cr, uid, ids, context=None):
"""
Edit survey.question.
-
- @param self: The object pointer
- @param cr: the current row, from the database cursor,
- @param uid: the current user’s ID for security checks,
- @param ids: List of survey.question.wiz IDs
- @param context: A standard dictionary for contextual values
- @return : Dictionary value for Open Edit survey.question form.
"""
if context is None:
context = {}
@@ -1163,13 +1098,6 @@ class survey_question_wiz(osv.osv_memory):
def action_delete_question(self,cr, uid, ids, context=None):
"""
Delete survey.question.
-
- @param self: The object pointer
- @param cr: the current row, from the database cursor,
- @param uid: the current user’s ID for security checks,
- @param ids: List of survey.question.wiz IDs
- @param context: A standard dictionary for contextual values
- @return : Dictionary value for Open same survey.page form, but delete the selected survey.question in current survey.page.
"""
if context is None:
context = {}
@@ -1197,13 +1125,6 @@ class survey_question_wiz(osv.osv_memory):
def action_forward_previous(self, cr, uid, ids, context=None):
"""
Goes to previous Survey Answer.
-
- @param self: The object pointer
- @param cr: the current row, from the database cursor,
- @param uid: the current user’s ID for security checks,
- @param ids: List of survey.question.wiz IDs
- @param context: A standard dictionary for contextual values
- @return : Dictionary value for Open Previous Answer form.
"""
if context is None:
context = {}
@@ -1229,13 +1150,6 @@ class survey_question_wiz(osv.osv_memory):
def action_forward_next(self, cr, uid, ids, context=None):
"""
Goes to Next Survey Answer.
-
- @param self: The object pointer
- @param cr: the current row, from the database cursor,
- @param uid: the current user’s ID for security checks,
- @param ids: List of survey.question.wiz IDs
- @param context: A standard dictionary for contextual values
- @return : Dictionary value for Open Next Answer form.
"""
if context is None:
context = {}
@@ -1261,13 +1175,6 @@ class survey_question_wiz(osv.osv_memory):
def action_next(self, cr, uid, ids, context=None):
"""
Goes to Next page.
-
- @param self: The object pointer
- @param cr: the current row, from the database cursor,
- @param uid: the current user’s ID for security checks,
- @param ids: List of survey.question.wiz IDs
- @param context: A standard dictionary for contextual values
- @return : Dictionary value for Open Next survey.page form.
"""
if context is None:
context = {}
@@ -1288,13 +1195,6 @@ class survey_question_wiz(osv.osv_memory):
def action_previous(self, cr, uid, ids, context=None):
"""
Goes to previous page.
-
- @param self: The object pointer
- @param cr: the current row, from the database cursor,
- @param uid: the current user’s ID for security checks,
- @param ids: List of survey.question.wiz IDs
- @param context: A standard dictionary for contextual values
- @return : Dictionary value for Open Previous survey.page form.
"""
if context is None:
context = {}
diff --git a/addons/survey/wizard/survey_browse_answer.py b/addons/survey/wizard/survey_browse_answer.py
index 1798a7c418c..5af913993b2 100644
--- a/addons/survey/wizard/survey_browse_answer.py
+++ b/addons/survey/wizard/survey_browse_answer.py
@@ -24,26 +24,9 @@ from osv import fields
class survey_browse_answer(osv.osv_memory):
_name = 'survey.browse.answer'
-
- def _get_survey(self, cr, uid, context=None):
- """
- Set the value in survey_id field,
-
- @param self: The object pointer
- @param cr: the current row, from the database cursor,
- @param context: A standard dictionary for contextual values,
- @return : Tuple in list with values.
- """
- surv_obj = self.pool.get("survey")
- surv_resp_obj = self.pool.get("survey.response")
- result = []
- for sur in surv_obj.browse(cr, uid, surv_obj.search(cr, uid, [])):
- if surv_resp_obj.search(cr, uid, [('survey_id', '=', sur.id)]):
- result.append((sur.id, sur.title))
- return result
_columns = {
- 'survey_id': fields.selection(_get_survey, "Survey", required="1"),
+ 'survey_id': fields.many2one('survey', "Survey", required="1"),
'response_id': fields.many2one("survey.response", "Survey Answers", help="If this field is empty, all answers of the selected survey will be print."),
}
@@ -51,13 +34,6 @@ class survey_browse_answer(osv.osv_memory):
"""
Open Browse Response wizard. if you select only survey_id then this wizard open with all response_ids and
if you select survey_id and response_id then open the particular response of the survey.
-
- @param self: The object pointer
- @param cr: the current row, from the database cursor,
- @param uid: the current user’s ID for security checks,
- @param ids: List of survey.browse.answer IDs,
- @param context: A standard dictionary for contextual values,
- @return : Dictionary value for Open the browse answer wizard.
"""
if context is None: context = {}
record = self.read(cr, uid, ids, [])
@@ -66,8 +42,8 @@ class survey_browse_answer(osv.osv_memory):
res_id = [(record.get('response_id') and record['response_id'][0])]
else:
sur_response_obj = self.pool.get('survey.response')
- res_id = sur_response_obj.search(cr, uid, [('survey_id', '=',int(record['survey_id']))])
- context.update({'active' : True,'survey_id' : record['survey_id'], 'response_id' : res_id, 'response_no' : 0})
+ res_id = sur_response_obj.search(cr, uid, [('survey_id', '=', record['survey_id'][0])])
+ context.update({'active' : True,'survey_id' : record['survey_id'][0], 'response_id' : res_id, 'response_no' : 0})
search_obj = self.pool.get('ir.ui.view')
search_id = search_obj.search(cr,uid,[('model','=','survey.question.wiz'),('name','=','Survey Search')])
return {
diff --git a/addons/survey/wizard/survey_print.py b/addons/survey/wizard/survey_print.py
index 87767f34a68..6ae84ed37cc 100644
--- a/addons/survey/wizard/survey_print.py
+++ b/addons/survey/wizard/survey_print.py
@@ -27,8 +27,7 @@ from tools.translate import _
class survey_print(osv.osv_memory):
_name = 'survey.print'
_columns = {
- 'survey_ids': fields.many2many('survey','survey_print',\
- 'survey_id','print_id', "Survey", required="1"),
+ 'survey_ids': fields.many2many('survey', string="Survey", required="1"),
'orientation' : fields.selection([('vertical','Portrait(Vertical)'),\
('horizontal','Landscape(Horizontal)')], 'Orientation'),
'paper_size' : fields.selection([('letter','Letter (8.5" x 11")'),\
diff --git a/addons/survey/wizard/survey_print_statistics.py b/addons/survey/wizard/survey_print_statistics.py
index 10b321fcf45..bd8b9f2ad14 100644
--- a/addons/survey/wizard/survey_print_statistics.py
+++ b/addons/survey/wizard/survey_print_statistics.py
@@ -26,20 +26,12 @@ from tools.translate import _
class survey_print_statistics(osv.osv_memory):
_name = 'survey.print.statistics'
_columns = {
- 'survey_ids': fields.many2many('survey','survey_print_statistics','survey_id',\
- 'print_id', "Survey", required="1"),
+ 'survey_ids': fields.many2many('survey', string="Survey", required="1"),
}
def action_next(self, cr, uid, ids, context=None):
"""
Print Survey Statistics in pdf format.
-
- @param self: The object pointer
- @param cr: the current row, from the database cursor,
- @param uid: the current user’s ID for security checks,
- @param ids: List of Survey statistics IDs
- @param context: A standard dictionary for contextual values
- @return: Dictionary value for created survey statistics report
"""
if context is None:
context = {}
diff --git a/addons/survey/wizard/survey_selection.py b/addons/survey/wizard/survey_selection.py
index c6eebd62a67..a803459899c 100644
--- a/addons/survey/wizard/survey_selection.py
+++ b/addons/survey/wizard/survey_selection.py
@@ -26,71 +26,8 @@ from tools.translate import _
class survey_name_wiz(osv.osv_memory):
_name = 'survey.name.wiz'
- def default_get(self, cr, uid, fields, context=None):
- """
- Set the default value in survey_id field. if open this wizard in survey form then set the default value in survey_id = active survey id.
-
- @param self: The object pointer
- @param cr: the current row, from the database cursor,
- @param uid: the current user’s ID for security checks,
- @param fields: List of Survey statistics IDs
- @param context: A standard dictionary for contextual values
- @return : Dictionary value for created survey statistics report
- """
- if context is None:
- context = {}
- data = super(survey_name_wiz, self).default_get(cr, uid, fields, context)
- if context.has_key('survey_id'):
- data['survey_id'] = context.get('survey_id',False)
- return data
-
- def _get_survey(self, cr, uid, context=None):
- """
- Set the value In survey_id field.
-
- @param self: The object pointer
- @param cr: the current row, from the database cursor,
- @param uid: the current user’s ID for security checks,
- @param ids: List of Survey statistics IDs
- @param context: A standard dictionary for contextual values
- @return: Dictionary value for created survey statistics report
- """
- surv_obj = self.pool.get("survey")
- result = []
- if context.has_key('survey_id'):
- for sur in surv_obj.browse(cr, uid, [context.get('survey_id',False)]):
- result.append((sur.id, sur.title))
- return result
- survey_user_group_id = self.pool.get('res.groups').search(cr, uid, [('name', '=', 'Survey / User')])
- group_id = self.pool.get('res.groups').search(cr, uid, [('name', 'in', ('Tools / Manager','Tools / User','Survey / User'))])
- user_obj = self.pool.get('res.users')
- user_rec = user_obj.read(cr, uid, uid, [])
- if survey_user_group_id:
- if survey_user_group_id == user_rec['groups_id']:
- for sur in surv_obj.browse(cr, uid, surv_obj.search(cr, uid, [])):
- if sur.state == 'open':
- u_list = []
- for use in sur.invited_user_ids:
- u_list.append(use.id)
- if uid in u_list:
- result.append((sur.id, sur.title))
- return result
- for sur in surv_obj.browse(cr, uid, surv_obj.search(cr, uid, [])):
- if sur.state == 'open':
- res = False
- for i in group_id:
- if i in user_rec['groups_id']:
- res = True
- break
- elif sur.id in user_rec['survey_id']:
- res = True
- break
- if res:
- result.append((sur.id, sur.title))
- return result
-
_columns = {
- 'survey_id': fields.selection(_get_survey, "Survey", required="1"),
+ 'survey_id': fields.many2one('survey', 'Survey', required=True, ondelete='cascade'),
'page_no': fields.integer('Page Number'),
'note': fields.text("Description"),
'page': fields.char('Page Position',size = 12),
@@ -99,10 +36,11 @@ class survey_name_wiz(osv.osv_memory):
'response': fields.char('Answer',size=16)
}
_defaults = {
- 'page_no': lambda * a: - 1,
- 'page': lambda * a: 'next',
- 'transfer': lambda * a: 1,
- 'response': lambda * a: 0,
+ 'page_no': -1,
+ 'page': 'next',
+ 'transfer': 1,
+ 'response': 0,
+ 'survey_id': lambda self,cr,uid,context:context.get('survey_id',False),
}
def action_next(self, cr, uid, ids, context=None):
@@ -110,30 +48,22 @@ class survey_name_wiz(osv.osv_memory):
Start the survey, Increment in started survey field but if set the max_response_limit of
survey then check the current user how many times start this survey. if current user max_response_limit
is reach then this user can not start this survey(Raise Exception).
-
- @param self: The object pointer
- @param cr: the current row, from the database cursor,
- @param uid: the current user’s ID for security checks,
- @param ids: List of Survey IDs
- @param context: A standard dictionary for contextual values
- @return : Dictionary value for open survey question wizard.
"""
survey_obj = self.pool.get('survey')
search_obj = self.pool.get('ir.ui.view')
if context is None: context = {}
this = self.browse(cr, uid, ids, context=context)[0]
- survey_id = this.survey_id
+ survey_id = this.survey_id.id
context.update({'survey_id': survey_id, 'sur_name_id': this.id})
cr.execute('select count(id) from survey_history where user_id=%s\
and survey_id=%s' % (uid,survey_id))
res = cr.fetchone()[0]
- user_limit = survey_obj.read(cr, uid, survey_id, ['response_user'])['response_user']
- if user_limit and res >= user_limit:
+ sur_rec = survey_obj.browse(cr,uid,survey_id,context=context)
+ if sur_rec.response_user and res >= sur_rec.response_user:
raise osv.except_osv(_('Warning !'),_("You can not give response for this survey more than %s times") % (user_limit))
- sur_rec = survey_obj.browse(cr,uid,ids,context=context)[0]
if sur_rec.max_response_limit and sur_rec.max_response_limit <= sur_rec.tot_start_survey:
raise osv.except_osv(_('Warning !'),_("You can not give more response. Please contact the author of this survey for further assistance."))
@@ -152,16 +82,10 @@ class survey_name_wiz(osv.osv_memory):
def on_change_survey(self, cr, uid, ids, survey_id, context=None):
"""
on change event of survey_id field, if note is available in selected survey then display this note in note fields.
- @param ids: List of Survey IDs
- @param survey_id: Id of Survey
- @param context: A standard dictionary for contextual values
- @return : Dictionary values of notes fields.
"""
if not survey_id:
return {}
notes = self.pool.get('survey').read(cr, uid, survey_id, ['note'])['note']
return {'value': {'note': notes}}
-survey_name_wiz()
-
-# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
+# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
\ No newline at end of file
diff --git a/addons/survey/wizard/survey_selection.xml b/addons/survey/wizard/survey_selection.xml
index a72566f7888..144525979dd 100644
--- a/addons/survey/wizard/survey_selection.xml
+++ b/addons/survey/wizard/survey_selection.xml
@@ -15,7 +15,8 @@
+ on_change="on_change_survey(survey_id)" width="250"
+ domain="[('state','=','open')]"/>
diff --git a/addons/thunderbird/i18n/da.po b/addons/thunderbird/i18n/da.po
new file mode 100644
index 00000000000..594e02b8f74
--- /dev/null
+++ b/addons/thunderbird/i18n/da.po
@@ -0,0 +1,151 @@
+# Danish translation for openobject-addons
+# Copyright (c) 2011 Rosetta Contributors and Canonical Ltd 2011
+# This file is distributed under the same license as the openobject-addons package.
+# FIRST AUTHOR , 2011.
+#
+msgid ""
+msgstr ""
+"Project-Id-Version: openobject-addons\n"
+"Report-Msgid-Bugs-To: FULL NAME \n"
+"POT-Creation-Date: 2011-01-11 11:16+0000\n"
+"PO-Revision-Date: 2011-09-22 20:28+0000\n"
+"Last-Translator: FULL NAME \n"
+"Language-Team: Danish \n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+"X-Launchpad-Export-Date: 2011-09-23 04:39+0000\n"
+"X-Generator: Launchpad (build 14012)\n"
+
+#. module: thunderbird
+#: field:thunderbird.installer,plugin_file:0
+#: field:thunderbird.installer,thunderbird:0
+msgid "Thunderbird Plug-in"
+msgstr ""
+
+#. module: thunderbird
+#: help:thunderbird.installer,plugin_file:0
+msgid ""
+"Thunderbird plug-in file. Save as this file and install this plug-in in "
+"thunderbird."
+msgstr ""
+
+#. module: thunderbird
+#: help:thunderbird.installer,thunderbird:0
+msgid ""
+"Allows you to select an object that you would like to add to your email and "
+"its attachments."
+msgstr ""
+
+#. module: thunderbird
+#: help:thunderbird.installer,pdf_file:0
+msgid "The documentation file :- how to install Thunderbird Plug-in."
+msgstr ""
+
+#. module: thunderbird
+#: model:ir.model,name:thunderbird.model_email_server_tools
+msgid "Email Server Tools"
+msgstr ""
+
+#. module: thunderbird
+#: view:thunderbird.installer:0
+msgid "_Close"
+msgstr ""
+
+#. module: thunderbird
+#: field:thunderbird.installer,pdf_file:0
+msgid "Installation Manual"
+msgstr "Installations manual"
+
+#. module: thunderbird
+#: field:thunderbird.installer,description:0
+msgid "Description"
+msgstr "Beskrivelse:"
+
+#. module: thunderbird
+#: view:thunderbird.installer:0
+msgid "title"
+msgstr ""
+
+#. module: thunderbird
+#: model:ir.ui.menu,name:thunderbird.menu_base_config_plugins_thunderbird
+#: view:thunderbird.installer:0
+msgid "Thunderbird Plug-In"
+msgstr ""
+
+#. module: thunderbird
+#: view:thunderbird.installer:0
+msgid ""
+"This plug-in allows you to link your e-mail to OpenERP's documents. You can "
+"attach it to any existing one in OpenERP or create a new one."
+msgstr ""
+
+#. module: thunderbird
+#: model:ir.module.module,shortdesc:thunderbird.module_meta_information
+msgid "Thunderbird Interface"
+msgstr ""
+
+#. module: thunderbird
+#: model:ir.model,name:thunderbird.model_thunderbird_installer
+msgid "thunderbird.installer"
+msgstr ""
+
+#. module: thunderbird
+#: field:thunderbird.installer,name:0
+#: field:thunderbird.installer,pdf_name:0
+msgid "File name"
+msgstr "Fil Navn"
+
+#. module: thunderbird
+#: view:thunderbird.installer:0
+msgid "Installation and Configuration Steps"
+msgstr ""
+
+#. module: thunderbird
+#: field:thunderbird.installer,progress:0
+msgid "Configuration Progress"
+msgstr ""
+
+#. module: thunderbird
+#: model:ir.actions.act_window,name:thunderbird.action_thunderbird_installer
+#: model:ir.actions.act_window,name:thunderbird.action_thunderbird_wizard
+#: view:thunderbird.installer:0
+msgid "Thunderbird Plug-In Configuration"
+msgstr ""
+
+#. module: thunderbird
+#: model:ir.model,name:thunderbird.model_thunderbird_partner
+msgid "Thunderbid Plugin Tools"
+msgstr ""
+
+#. module: thunderbird
+#: view:thunderbird.installer:0
+msgid "Configure"
+msgstr "Konfigurer"
+
+#. module: thunderbird
+#: view:thunderbird.installer:0
+msgid "Skip"
+msgstr "Spring over"
+
+#. module: thunderbird
+#: field:thunderbird.installer,config_logo:0
+msgid "Image"
+msgstr "Billede"
+
+#. module: thunderbird
+#: model:ir.module.module,description:thunderbird.module_meta_information
+msgid ""
+"\n"
+" This module is required for the thuderbird plug-in to work\n"
+" properly.\n"
+" The Plugin allows you archive email and its attachments to the "
+"selected \n"
+" OpenERP objects. You can select a partner, a task, a project, an "
+"analytical\n"
+" account,or any other object and attach selected mail as eml file in \n"
+" attachment of selected record. You can create Documents for crm Lead,\n"
+" HR Applicant and project issue from selected mails.\n"
+"\n"
+" "
+msgstr ""
diff --git a/addons/thunderbird/installer.py b/addons/thunderbird/installer.py
index 5bf11218842..35d31b9d636 100644
--- a/addons/thunderbird/installer.py
+++ b/addons/thunderbird/installer.py
@@ -41,7 +41,7 @@ class thunderbird_installer(osv.osv_memory):
'pdf_name':fields.char('File name', size=64),
'thunderbird':fields.boolean('Thunderbird Plug-in', help="Allows you to select an object that you would like to add to your email and its attachments."),
'plugin_file':fields.binary('Thunderbird Plug-in', readonly=True, help="Thunderbird plug-in file. Save as this file and install this plug-in in thunderbird."),
- 'pdf_file':fields.char('Installation Manual', size="264", help="The documentation file :- how to install Thunderbird Plug-in.", readonly=True),
+ 'pdf_file':fields.char('Installation Manual', size=264, help="The documentation file :- how to install Thunderbird Plug-in.", readonly=True),
'description':fields.text('Description', readonly=True)
}
diff --git a/addons/thunderbird/thunderbird_installer.xml b/addons/thunderbird/thunderbird_installer.xml
index 2ab1d97fe46..cf23cdf45c1 100644
--- a/addons/thunderbird/thunderbird_installer.xml
+++ b/addons/thunderbird/thunderbird_installer.xml
@@ -75,8 +75,10 @@
{'menu':True}
-
-
+
+
+
+
diff --git a/addons/users_ldap/users_ldap.py b/addons/users_ldap/users_ldap.py
index bddaaeed6ae..7c3bd0d9c17 100644
--- a/addons/users_ldap/users_ldap.py
+++ b/addons/users_ldap/users_ldap.py
@@ -43,7 +43,7 @@ class CompanyLDAP(osv.osv):
'ldap_password': fields.char('LDAP password', size=64,
help=("The password of the user account on the LDAP server that is "
"used to query the directory.")),
- 'ldap_filter': fields.char('LDAP filter', size=64, required=True),
+ 'ldap_filter': fields.char('LDAP filter', size=256, required=True),
'ldap_base': fields.char('LDAP base', size=64, required=True),
'user': fields.many2one('res.users', 'Model User',
help="Model used for user creation"),