diff options
| author | Mustufa Rangwala <mra@tinyerp.com> | 2008-11-04 10:59:09 +0530 |
|---|---|---|
| committer | Mustufa Rangwala <mra@tinyerp.com> | 2008-11-04 10:59:09 +0530 |
| commit | da8aa7411aef2f2b962b2b67b73563dce4c45bee (patch) | |
| tree | c10dfcfcefa2e45c3643a79a2c03999df1ca3fe3 | |
| parent | 7460c0e716763d5a4d3350bac3fca941dad7ad76 (diff) | |
changes for postgres view on stock module
bzr revid: mra@tinyerp.com-20081104052909-p92082i0d8qvqrt1
| -rw-r--r-- | addons/stock/report_stock_view.xml | 18 | ||||
| -rw-r--r-- | addons/stock/stock.py | 10 |
2 files changed, 21 insertions, 7 deletions
diff --git a/addons/stock/report_stock_view.xml b/addons/stock/report_stock_view.xml index 2753d84974a..1b921098df9 100644 --- a/addons/stock/report_stock_view.xml +++ b/addons/stock/report_stock_view.xml @@ -73,17 +73,31 @@ <field name="type">tree</field> <field name="arch" type="xml"> <tree string="Dates of Inventories"> - <field name="id"/> <field name="product_id"/> + <field name="id"/> <field name="create_date" /> </tree> </field> </record> + <record model="ir.ui.view" id="report_stock_lines_date_form"> + <field name="name">report.stock.lines.date.form</field> + <field name="model">report.stock.lines.date</field> + <field name="type">form</field> + <field name="arch" type="xml"> + <form string="Dates of Inventories"> + <field name="product_id" select="1"/> + <field name="id" select="2"/> + <field name="create_date" select="1" /> + </form> + </field> + </record> + <record model="ir.actions.act_window" id="action_stock_line_date"> <field name="name">Dates of Inventories</field> <field name="res_model">report.stock.lines.date</field> - <field name="view_mode">tree</field> + <field name="view_type">form</field> + <field name="view_mode">tree,form</field> </record> <menuitem parent="next_id_61" action="action_stock_line_date" id="menu_report_stock_line_date"/> diff --git a/addons/stock/stock.py b/addons/stock/stock.py index b98f3cecc2b..b4ad96196ec 100644 --- a/addons/stock/stock.py +++ b/addons/stock/stock.py @@ -1,7 +1,7 @@ # -*- encoding: utf-8 -*- ############################################################################## # -# OpenERP, Open Source Management Solution +# OpenERP, Open Source Management Solution # Copyright (C) 2004-2008 Tiny SPRL (<http://tiny.be>). All Rights Reserved # $Id$ # @@ -1359,15 +1359,15 @@ class report_stock_lines_date(osv.osv): _description = "Dates of Inventories" _auto = False _columns = { - 'id': fields.integer('Id',size=20), - 'product_id':fields.integer('Product Id',size=20), + 'id': fields.integer('Inventory Line Id', readonly=True), + 'product_id':fields.integer('Product Id', readonly=True), 'create_date': fields.datetime('Latest Date of Inventory'), } def init(self, cr): cr.execute(""" create or replace view report_stock_lines_date as ( select - p.id as id, + l.id as id, p.id as product_id, max(l.create_date) as create_date from @@ -1375,7 +1375,7 @@ class report_stock_lines_date(osv.osv): left outer join stock_inventory_line l on (p.id=l.product_id) where l.create_date is not null - group by p.id + group by p.id,l.id )""") report_stock_lines_date() # vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4: |
