[IMP] Picking wave report controller for calling report for pickings
bzr revid: jco@openerp.com-20140314151320-0e33my2ux3mfj1p2
This commit is contained in:
parent
0645597438
commit
6dbb3a86db
|
@ -239,6 +239,7 @@ class report(osv.Model):
|
|||
|
||||
action = {
|
||||
'type': 'ir.actions.report.xml',
|
||||
'ids': ids,
|
||||
'report_name': report.report_name,
|
||||
'report_type': report.report_type,
|
||||
'report_file': report.report_file,
|
||||
|
|
|
@ -787,7 +787,8 @@ class stock_picking(osv.osv):
|
|||
'model': 'stock.picking',
|
||||
'ids': ids,
|
||||
}
|
||||
return {'type': 'ir.actions.report.xml', 'report_name': 'stock.picking.list', 'datas': datas, 'nodestroy': True}
|
||||
return self.get_action(cr, uid, ids, context=context)
|
||||
#{'type': 'ir.actions.report.xml', 'report_name': 'stock.picking.list', 'datas': datas, 'nodestroy': True}
|
||||
|
||||
def do_print_picking(self, cr, uid, ids, context=None):
|
||||
'''This function prints the picking list'''
|
||||
|
|
|
@ -8,7 +8,7 @@
|
|||
<field name="arch" type="xml">
|
||||
<form string="Choose your date" version="7.0">
|
||||
<p class="oe_gray" attrs="{'invisible': [('choose_date', '=', False)]}">
|
||||
Choose the date for wich you want to get the stock valuation of your products.
|
||||
Choose the date for which you want to get the stock valuation of your products.
|
||||
|
||||
This will filter the stock operation that weren't done at the selected date, to retreive the quantity
|
||||
you had, and gives you the inventory value according to the standard price used at that time.
|
||||
|
@ -49,7 +49,7 @@
|
|||
<field name="company_id" groups="base.group_multi_company"/>
|
||||
<field name="date"/>
|
||||
<field name="quantity" sum="# of Products "/>
|
||||
<field name="inventory_value"/>
|
||||
<field name="inventory_value" sum="Total Value"/>
|
||||
</tree>
|
||||
</field>
|
||||
</record>
|
||||
|
|
|
@ -21,5 +21,6 @@
|
|||
|
||||
import stock_picking_wave
|
||||
import wizard
|
||||
import controllers
|
||||
|
||||
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
|
||||
|
|
|
@ -34,6 +34,7 @@ This module adds the picking wave option in warehouse management.
|
|||
'stock_picking_wave_view.xml',
|
||||
'stock_picking_wave_sequence.xml',
|
||||
'wizard/picking_to_wave_view.xml',
|
||||
'stock_picking_wave_reports.xml',
|
||||
],
|
||||
'demo': [
|
||||
'stock_picking_wave_demo.xml',
|
||||
|
|
|
@ -0,0 +1 @@
|
|||
import main
|
|
@ -0,0 +1,16 @@
|
|||
from openerp.addons.web import http
|
||||
from openerp.addons.web.http import request
|
||||
|
||||
|
||||
class picking_wave_report(http.Controller):
|
||||
@http.route('/report/stock_picking_wave.report_pickingwave/<ids>', type='http', auth='user',
|
||||
website=True, multilang=True)
|
||||
def report_picking_wave(self, ids):
|
||||
self.cr, self.uid, self.pool = request.cr, request.uid, request.registry
|
||||
ids = [int(i) for i in ids.split(',')]
|
||||
picking_wave_obj = self.pool["stock.picking.wave"]
|
||||
wave = picking_wave_obj.browse(self.cr, self.uid, ids[0])
|
||||
docargs = {
|
||||
'docs': wave.picking_ids,
|
||||
}
|
||||
return request.registry['report'].render(self.cr, self.uid, [], 'stock.report_picking', docargs)
|
|
@ -31,22 +31,8 @@ class stock_picking_wave(osv.osv):
|
|||
'''
|
||||
This function print the report for all picking_ids associated to the picking wave
|
||||
'''
|
||||
picking_ids = []
|
||||
for wave in self.browse(cr, uid, ids, context=context):
|
||||
picking_ids += [picking.id for picking in wave.picking_ids]
|
||||
if not picking_ids:
|
||||
raise osv.except_osv(_('Error!'), _('Nothing to print.'))
|
||||
datas = {
|
||||
'ids': picking_ids,
|
||||
'model': 'stock.picking',
|
||||
'form': self.read(cr, uid, picking_ids, context=context)
|
||||
}
|
||||
return {
|
||||
'type': 'ir.actions.report.xml',
|
||||
'report_name': context.get('report', 'stock.picking.list'),
|
||||
'datas': datas,
|
||||
'nodestroy': True
|
||||
}
|
||||
context = context or {}
|
||||
return self.pool.get("report").get_action(cr, uid, [], 'stock_picking_wave.report_pickingwave', context=context)
|
||||
|
||||
def create(self, cr, uid, vals, context=None):
|
||||
if vals.get('name', '/') == '/':
|
||||
|
|
|
@ -0,0 +1,12 @@
|
|||
<openerp>
|
||||
<data>
|
||||
<report
|
||||
id="action_report_print_picking_wave"
|
||||
model="stock.picking.wave"
|
||||
report_type="qweb-pdf"
|
||||
string="Associated pickings"
|
||||
name="stock_picking_wave.report_pickingwave"
|
||||
file="stock_picking_wave.report_pickingwave"
|
||||
/>
|
||||
</data>
|
||||
</openerp>
|
Loading…
Reference in New Issue