user = user_pool.browse(cr, uid, uid)
if type in ('cash', 'bank') and currency and user.company_id.currency_id.id != currency:
view_id = 'account_journal_bank_view_multi'
-
data_id = obj_data.search(cr, uid, [('model','=','account.journal.view'), ('name','=',view_id)])
data = obj_data.browse(cr, uid, data_id[0], context=context)
<group colspan="4" col="6">
<field name="name" select="1"/>
<field name="code" select="1"/>
- <field name="type" on_change="onchange_type(type, currency)"/>
+ <field name="type" on_change="onchange_type(type, currency, context)"/>
</group>
<notebook colspan="4">
<page string="General Information">
'user_id': fields.many2one('res.users', 'Salesman', readonly=True),
'price_total': fields.float('Total Price', readonly=True),
'delay': fields.float('Commitment Delay', digits=(16,2), readonly=True),
- 'price_average': fields.float('Average Price', readonly=True,group_operator="avg"),
'categ_id': fields.many2one('product.category','Category of Product', readonly=True),
'nbr': fields.integer('# of Lines', readonly=True),
'state': fields.selection([
end) as uom_name,
sum(l.product_uom_qty/u.factor) as product_uom_qty,
sum(l.product_uom_qty*l.price_unit) as price_total,
- (sum(l.product_uom_qty*l.price_unit)/sum(l.product_uom_qty/u.factor)*count(l.product_id))::decimal(16,2) as price_average,
pt.categ_id, l.order_id
from
sale_order_line l
el.uom_name,
el.product_uom_qty,
el.price_total,
- el.price_average,
el.categ_id,
el.order_id,
s.date_order,
<field name="product_uom_qty" sum="# of Qty"/>
<field name="shipped_qty_1" sum="Shipped Qty"/>
<field name="uom_name" invisible="not context.get('set_visible',False)"/>
- <field name="price_average" sum="Average Price"/>
<field name="price_total" sum="Total Price"/>
<field name="delay" sum="Commitment Delay"/>
<field name="state" invisible="1"/>