[IMP] misc fixes related to on_changes and fields_view_get
bzr revid: fp@tinyerp.com-20111114213319-9sgjo9sy4sx1phd7
This commit is contained in:
parent
8d7176a11e
commit
4d5fb290d7
|
@ -1323,9 +1323,9 @@ class account_invoice_line(osv.osv):
|
|||
raise osv.except_osv(_('No Partner Defined !'),_("You must first select a partner !") )
|
||||
if not product:
|
||||
if type in ('in_invoice', 'in_refund'):
|
||||
return {'value': {'categ_id': False}, 'domain':{'product_uom':[]}}
|
||||
return {'value': {}, 'domain':{'product_uom':[]}}
|
||||
else:
|
||||
return {'value': {'price_unit': 0.0, 'categ_id': False}, 'domain':{'product_uom':[]}}
|
||||
return {'value': {'price_unit': 0.0}, 'domain':{'product_uom':[]}}
|
||||
part = self.pool.get('res.partner').browse(cr, uid, partner_id, context=context)
|
||||
fpos_obj = self.pool.get('account.fiscal.position')
|
||||
fpos = fposition_id and fpos_obj.browse(cr, uid, fposition_id, context=context) or False
|
||||
|
@ -1378,7 +1378,6 @@ class account_invoice_line(osv.osv):
|
|||
if res2:
|
||||
domain = {'uos_id':[('category_id','=',res2 )]}
|
||||
|
||||
result['categ_id'] = res.categ_id.id
|
||||
res_final = {'value':result, 'domain':domain}
|
||||
|
||||
if not company_id or not currency_id:
|
||||
|
|
|
@ -155,7 +155,7 @@ class crm_case_categ(osv.osv):
|
|||
"""Finds id for case object"""
|
||||
object_id = context and context.get('object_id', False) or False
|
||||
ids = self.pool.get('ir.model').search(cr, uid, [('model', '=', object_id)])
|
||||
return ids and ids[0]
|
||||
return ids and ids[0] or False
|
||||
|
||||
_defaults = {
|
||||
'object_id' : _find_object_id
|
||||
|
@ -241,6 +241,8 @@ class crm_base(object):
|
|||
address = self.pool.get('res.partner.address').browse(cr, uid, add)
|
||||
data['value'] = {'email_from': address and address.email or False ,
|
||||
'phone': address and address.phone or False}
|
||||
if 'phone' not in self._columns:
|
||||
del data['value']['phone']
|
||||
return data
|
||||
|
||||
def onchange_partner_id(self, cr, uid, ids, part, email=False):
|
||||
|
|
|
@ -1,13 +1,13 @@
|
|||
-
|
||||
In order to test hr module in OpenERP, I will create new Employee, Department and Job Position.
|
||||
-
|
||||
I create "R&D Department" in Department form.
|
||||
I create "RD Department" in Department form.
|
||||
-
|
||||
!record {model: hr.department, id: hr_department_rd0}:
|
||||
manager_id: base.user_root
|
||||
name: 'R & D'
|
||||
-
|
||||
Now, I create a new employee “Mark Johnson”, and select department as “R&D Department”.
|
||||
Now, I create a new employee “Mark Johnson”, and select department as “RD Department”.
|
||||
-
|
||||
!record {model: hr.employee, id: hr_employee_mark}:
|
||||
address_home_id: base.res_partner_address_1
|
||||
|
|
|
@ -334,7 +334,7 @@ class product_template(osv.osv):
|
|||
def onchange_uom(self, cursor, user, ids, uom_id,uom_po_id):
|
||||
if uom_id:
|
||||
return {'value': {'uom_po_id': uom_id}}
|
||||
return False
|
||||
return {}
|
||||
|
||||
def write(self, cr, uid, ids, vals, context=None):
|
||||
if 'uom_po_id' in vals:
|
||||
|
|
|
@ -75,11 +75,14 @@ class project(osv.osv):
|
|||
def onchange_partner_id(self, cr, uid, ids, part=False, context=None):
|
||||
partner_obj = self.pool.get('res.partner')
|
||||
if not part:
|
||||
return {'value':{'contact_id': False, 'pricelist_id': False}}
|
||||
return {'value':{'contact_id': False}}
|
||||
addr = partner_obj.address_get(cr, uid, [part], ['contact'])
|
||||
pricelist = partner_obj.read(cr, uid, part, ['property_product_pricelist'], context=context)
|
||||
pricelist_id = pricelist.get('property_product_pricelist', False) and pricelist.get('property_product_pricelist')[0] or False
|
||||
return {'value':{'contact_id': addr['contact'], 'pricelist_id': pricelist_id}}
|
||||
val = {'contact_id': addr['contact']}
|
||||
if pricelist_id in self._columns:
|
||||
pricelist = partner_obj.read(cr, uid, part, ['property_product_pricelist'], context=context)
|
||||
pricelist_id = pricelist.get('property_product_pricelist', False) and pricelist.get('property_product_pricelist')[0] or False
|
||||
val['pricelist_id'] = pricelist_id
|
||||
return {'value': val}
|
||||
|
||||
def _progress_rate(self, cr, uid, ids, names, arg, context=None):
|
||||
res = {}.fromkeys(ids, 0.0)
|
||||
|
|
|
@ -241,7 +241,6 @@
|
|||
<field name="project_id" ref="project.project_integrate_openerp"/>
|
||||
<field name="name">Training and Presentation</field>
|
||||
<field name="type_id" ref="project_tt_specification"/>
|
||||
<field name="date_start">2011-09-21</field>
|
||||
</record>
|
||||
|
||||
<!--
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
-
|
||||
!record {model: purchase.order, id: order_purchase1, view: False}:
|
||||
!record {model: purchase.order, id: order_purchase1}:
|
||||
partner_id: base.res_partner_asus
|
||||
invoice_method: order
|
||||
order_line:
|
||||
|
@ -11,7 +11,7 @@
|
|||
product_qty: 2.0
|
||||
|
||||
-
|
||||
!record {model: purchase.order, id: order_purchase2, view: False}:
|
||||
!record {model: purchase.order, id: order_purchase2}:
|
||||
partner_id: base.res_partner_3
|
||||
invoice_method: picking
|
||||
order_line:
|
||||
|
@ -19,7 +19,7 @@
|
|||
price_unit: 900
|
||||
|
||||
-
|
||||
!record {model: purchase.order, id: order_purchase3, view: False}:
|
||||
!record {model: purchase.order, id: order_purchase3}:
|
||||
partner_id: base.res_partner_desertic_hispafuentes
|
||||
order_line:
|
||||
- product_id: product.product_product_0
|
||||
|
@ -30,7 +30,7 @@
|
|||
product_qty: 5
|
||||
|
||||
-
|
||||
!record {model: purchase.order, id: order_purchase4, view: False}:
|
||||
!record {model: purchase.order, id: order_purchase4}:
|
||||
partner_id: base.res_partner_4
|
||||
order_line:
|
||||
- product_id: product.product_product_pc2
|
||||
|
@ -44,7 +44,7 @@
|
|||
product_qty: 15
|
||||
|
||||
-
|
||||
!record {model: purchase.order, id: order_purchase5, view: False}:
|
||||
!record {model: purchase.order, id: order_purchase5}:
|
||||
partner_id: base.res_partner_maxtor
|
||||
order_line:
|
||||
- product_id: product.product_product_cpu1
|
||||
|
@ -55,7 +55,7 @@
|
|||
product_qty: 10
|
||||
|
||||
-
|
||||
!record {model: purchase.order, id: order_purchase6, view: False}:
|
||||
!record {model: purchase.order, id: order_purchase6}:
|
||||
partner_id: base.res_partner_vickingdirect0
|
||||
order_line:
|
||||
- product_id: product.product_product_hdd2
|
||||
|
@ -66,7 +66,7 @@
|
|||
product_qty: 10
|
||||
|
||||
-
|
||||
!record {model: purchase.order, id: order_purchase7, view: False}:
|
||||
!record {model: purchase.order, id: order_purchase7}:
|
||||
partner_id: base.res_partner_desertic_hispafuentes
|
||||
order_line:
|
||||
- product_id: product.product_product_0
|
||||
|
|
|
@ -3,7 +3,7 @@
|
|||
-
|
||||
I create a procurement order.
|
||||
-
|
||||
!record {model: procurement.order, id: procurement_order_testcase0, view: False}:
|
||||
!record {model: procurement.order, id: procurement_order_testcase0}:
|
||||
location_id: stock.stock_location_stock
|
||||
name: Test scheduler for RFQ
|
||||
procure_method: make_to_order
|
||||
|
|
|
@ -2,7 +2,7 @@
|
|||
In order to test the Deposit wizard of sale module in the Open-ERP,
|
||||
I create a Sale Order for LG Viewty Smart for qty 100 having order_policy manual.
|
||||
-
|
||||
!record {model: sale.order, id: sale_order_so5, view: False}:
|
||||
!record {model: sale.order, id: sale_order_so5}:
|
||||
invoice_quantity: order
|
||||
order_line:
|
||||
- product_uom_qty: 100.0
|
||||
|
|
Loading…
Reference in New Issue