parent
4ec2704522
commit
da33e07d81
|
@ -378,6 +378,13 @@ class mrp_production(osv.osv):
|
|||
}
|
||||
_order = 'date_planned asc, priority desc';
|
||||
|
||||
def location_id_change(self, cr, uid, ids, src, dest, context={}):
|
||||
if dest:
|
||||
return {}
|
||||
if src:
|
||||
return {'value': {'location_dest_id': src}}
|
||||
return {}
|
||||
|
||||
def product_id_change(self, cr, uid, ids, product):
|
||||
if not product:
|
||||
return {}
|
||||
|
|
|
@ -308,7 +308,7 @@
|
|||
<field name="name">Bill of Materials Structure</field>
|
||||
<field name="type">ir.actions.act_window</field>
|
||||
<field name="res_model">mrp.bom</field>
|
||||
<field name="domain">[('id','in',active_ids)]</field>
|
||||
<field name="domain">[('id','=',active_id)]</field>
|
||||
<field name="view_type">tree</field>
|
||||
<field name="view_id" ref="mrp_bom_tree_view"/>
|
||||
</record>
|
||||
|
@ -416,8 +416,8 @@
|
|||
|
||||
<notebook colspan="4">
|
||||
<page string="Consumed Products">
|
||||
<field name="location_src_id" select="2"/>
|
||||
<field name="location_dest_id"/>
|
||||
<field name="location_src_id" select="2" domain="[('usage','=','internal')]" on_change="location_id_change(location_src_id,location_dest_id)"/>
|
||||
<field name="location_dest_id" domain="[('usage','=','internal')]"/>
|
||||
<field name="bom_id" select="2" domain="[('product_id','=',product_id),('bom_id','=',False)]"/>
|
||||
<field name="origin" select="1"/>
|
||||
<newline/>
|
||||
|
|
|
@ -228,7 +228,7 @@ class purchase_order(osv.osv):
|
|||
return {'value':{'partner_address_id': False}}
|
||||
addr = self.pool.get('res.partner').address_get(cr, uid, [part], ['default'])
|
||||
pricelist = self.pool.get('res.partner').property_get(cr, uid,
|
||||
part,property_pref=['property_product_pricelist_purchase']).get('property_product_pricelist_purchase',False)
|
||||
part,property_pref=['property_product_pricelist_purchase']).get('property_product_pricelist_purchase',False)
|
||||
return {'value':{'partner_address_id': addr['default'], 'pricelist_id': pricelist}}
|
||||
|
||||
def wkf_approve_order(self, cr, uid, ids):
|
||||
|
@ -419,11 +419,11 @@ class purchase_order_line(osv.osv):
|
|||
|
||||
def product_id_change(self, cr, uid, ids, pricelist, product, qty, uom,
|
||||
partner_id, date_order=False):
|
||||
prod= self.pool.get('product.product').browse(cr, uid,product)
|
||||
if not pricelist:
|
||||
raise osv.except_osv(_('No Pricelist !'), _('You have to select a pricelist in the purchase form !\nPlease set one before choosing a product.'))
|
||||
if not product:
|
||||
return {'value': {'price_unit': 0.0, 'name':'','notes':'', 'product_uom' : False}, 'domain':{'product_uom':[]}}
|
||||
prod= self.pool.get('product.product').browse(cr, uid,product)
|
||||
lang=False
|
||||
if partner_id:
|
||||
lang=self.pool.get('res.partner').read(cr, uid, partner_id)['lang']
|
||||
|
@ -452,9 +452,9 @@ class purchase_order_line(osv.osv):
|
|||
if partner_id:
|
||||
taxep_id = self.pool.get('res.partner').property_get(cr, uid,partner_id,property_pref=['property_account_supplier_tax']).get('property_account_supplier_tax',False)
|
||||
if taxep_id:
|
||||
taxep=self.pool.get('account.tax').browse(cr, uid,taxep_id)
|
||||
taxep=self.pool.get('account.tax').browse(cr, uid,taxep_id)
|
||||
if not taxep or not taxep.id:
|
||||
res['value']['taxes_id'] = [x.id for x in product.taxes_id]
|
||||
res['value']['taxes_id'] = [x.id for x in prod['supplier_taxes_id']]
|
||||
else:
|
||||
res5 = [taxep.id]
|
||||
for t in taxes:
|
||||
|
|
Loading…
Reference in New Issue