fix
bzr revid: fp@fp-laptop-20101010193031-rdigl91djqkdiy9w
This commit is contained in:
parent
9ee997e7b7
commit
56e1d1784b
|
@ -38,7 +38,7 @@
|
|||
<field name="purchase_tax" groups="base.group_extended"/>
|
||||
</group>
|
||||
<group colspan="4" attrs="{'invisible':[('charts','!=','configurable')]}">
|
||||
<separator col="4" colspan="4" string="Bank and Cost Account"/>
|
||||
<separator col="4" colspan="4" string="Bank and Cash Accounts"/>
|
||||
<field colspan="4" mode="tree" height="200" name="bank_accounts_id" nolabel="1" widget="one2many_list">
|
||||
<form string="">
|
||||
<field name="acc_name"/>
|
||||
|
|
|
@ -55,7 +55,7 @@
|
|||
<notebook>
|
||||
<page string="Line">
|
||||
<field name="product_id" on_change="product_id_change(product_id, uos_id, quantity, name, parent.type, parent.partner_id, parent.fiscal_position, price_unit, parent.address_invoice_id, parent.currency_id, {'company_id': parent.company_id})"/>
|
||||
<field name="uos_id" widget="selection" on_change="uos_id_change(product_id, uos_id, quantity, name, parent.type, parent.partner_id, parent.fiscal_position, price_unit, parent.address_invoice_id, parent.currency_id, {'company_id': parent.company_id})"/>
|
||||
<field name="uos_id" on_change="uos_id_change(product_id, uos_id, quantity, name, parent.type, parent.partner_id, parent.fiscal_position, price_unit, parent.address_invoice_id, parent.currency_id, {'company_id': parent.company_id})"/>
|
||||
<field name="quantity"/>
|
||||
<field name="price_unit"/>
|
||||
<field name="discount" groups="base.group_extended"/>
|
||||
|
|
|
@ -276,9 +276,12 @@ class product_template(osv.osv):
|
|||
return res and res[0] or False
|
||||
|
||||
def _default_category(self, cr, uid, context={}):
|
||||
print '_default_categ', context
|
||||
if 'categ_id' in context and context['categ_id']:
|
||||
return context['categ_id']
|
||||
return False
|
||||
md = self.pool.get('ir.model.data')
|
||||
res = md.get_object_reference(cr, uid, 'product', 'cat0') or False
|
||||
return res and res[1] or False
|
||||
|
||||
def onchange_uom(self, cursor, user, ids, uom_id,uom_po_id):
|
||||
if uom_id and uom_po_id:
|
||||
|
@ -289,15 +292,10 @@ class product_template(osv.osv):
|
|||
return {'value': {'uom_po_id': uom_id}}
|
||||
return False
|
||||
|
||||
def _get_categ(self, cursor, user, context={}):
|
||||
md = self.pool.get('ir.model.data')
|
||||
return md._get_id(cr, uid, 'product', 'cat0') or False
|
||||
|
||||
_defaults = {
|
||||
'company_id': lambda s,cr,uid,c: s.pool.get('res.company')._company_default_get(cr, uid, 'product.template', context=c),
|
||||
'type': lambda *a: 'product',
|
||||
'list_price': lambda *a: 1,
|
||||
'categ_id': _get_categ,
|
||||
'cost_method': lambda *a: 'standard',
|
||||
'supply_method': lambda *a: 'buy',
|
||||
'standard_price': lambda *a: 1,
|
||||
|
|
Loading…
Reference in New Issue