<field name="arch" type="xml">
<tree string="Dates of Inventories">
<field name="product_id"/>
- <field name="id"/>
<field name="create_date" />
</tree>
</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>
_description = "Dates of Inventories"
_auto = False
_columns = {
- 'id': fields.integer('Inventory Line Id', readonly=True),
- 'product_id': fields.integer('Product Id', readonly=True),
+ 'product_id': fields.many2one('product.product', 'Product Id', readonly=True),
'create_date': fields.datetime('Latest Date of Inventory'),
}
cr.execute("""
create or replace view report_stock_lines_date as (
select
- l.id as id,
+ p.id as id,
p.id as product_id,
max(l.create_date) as create_date
from
left outer join
stock_inventory_line l on (p.id=l.product_id)
where l.create_date is not null
- group by p.id,l.id
+ group by p.id
)""")
report_stock_lines_date()