[MERGE] forward port of branch saas-3 up to 4c7e078
This commit is contained in:
commit
31527c9a36
|
@ -846,18 +846,20 @@ result = rules.NET > categories.NET * 0.10''',
|
|||
rule = self.browse(cr, uid, rule_id, context=context)
|
||||
if rule.amount_select == 'fix':
|
||||
try:
|
||||
return rule.amount_fix, eval(rule.quantity, localdict), 100.0
|
||||
return rule.amount_fix, float(eval(rule.quantity, localdict)), 100.0
|
||||
except:
|
||||
raise osv.except_osv(_('Error!'), _('Wrong quantity defined for salary rule %s (%s).')% (rule.name, rule.code))
|
||||
elif rule.amount_select == 'percentage':
|
||||
try:
|
||||
return eval(rule.amount_percentage_base, localdict), eval(rule.quantity, localdict), rule.amount_percentage
|
||||
return (float(eval(rule.amount_percentage_base, localdict)),
|
||||
float(eval(rule.quantity, localdict)),
|
||||
rule.amount_percentage)
|
||||
except:
|
||||
raise osv.except_osv(_('Error!'), _('Wrong percentage base or quantity defined for salary rule %s (%s).')% (rule.name, rule.code))
|
||||
else:
|
||||
try:
|
||||
eval(rule.amount_python_compute, localdict, mode='exec', nocopy=True)
|
||||
return localdict['result'], 'result_qty' in localdict and localdict['result_qty'] or 1.0, 'result_rate' in localdict and localdict['result_rate'] or 100.0
|
||||
return float(localdict['result']), 'result_qty' in localdict and localdict['result_qty'] or 1.0, 'result_rate' in localdict and localdict['result_rate'] or 100.0
|
||||
except:
|
||||
raise osv.except_osv(_('Error!'), _('Wrong python code defined for salary rule %s (%s).')% (rule.name, rule.code))
|
||||
|
||||
|
|
|
@ -36,7 +36,7 @@
|
|||
<tr class="oe_timesheet_total">
|
||||
<td>
|
||||
<div class="oe_timesheet_weekly_adding_tot">
|
||||
<div class="oe_timesheet_weekly_adding"><button class="oe_timesheet_button_add">Add a Line</button></div>
|
||||
<div t-if="!widget.get('effective_readonly')" class="oe_timesheet_weekly_adding"><button class="oe_timesheet_button_add">Add a Line</button></div>
|
||||
<div class="oe_timesheet_weekly_tottot"><span>Total</span></div>
|
||||
</div>
|
||||
</td>
|
||||
|
|
|
@ -1095,6 +1095,8 @@ class purchase_order_line(osv.osv):
|
|||
context_partner.update( {'lang': lang, 'partner_id': partner_id} )
|
||||
product = product_product.browse(cr, uid, product_id, context=context_partner)
|
||||
#call name_get() with partner in the context to eventually match name and description in the seller_ids field
|
||||
if not name or not uom_id:
|
||||
# The 'or not uom_id' part of the above condition can be removed in master. See commit message of the rev. introducing this line.
|
||||
dummy, name = product_product.name_get(cr, uid, product_id, context=context_partner)[0]
|
||||
if product.description_purchase:
|
||||
name += '\n' + product.description_purchase
|
||||
|
|
|
@ -237,7 +237,7 @@
|
|||
<page string="Products">
|
||||
<field name="order_line">
|
||||
<tree string="Purchase Order Lines" editable="bottom">
|
||||
<field name="product_id" on_change="onchange_product_id(parent.pricelist_id,product_id,0,False,parent.partner_id, parent.date_order,parent.fiscal_position,date_planned,name,False,parent.state,context)"/>
|
||||
<field name="product_id" on_change="onchange_product_id(parent.pricelist_id,product_id,0,False,parent.partner_id, parent.date_order,parent.fiscal_position,date_planned,False,False,parent.state,context)"/>
|
||||
<field name="name"/>
|
||||
<field name="date_planned"/>
|
||||
<field name="company_id" groups="base.group_multi_company" options="{'no_create': True}"/>
|
||||
|
@ -419,7 +419,7 @@
|
|||
<sheet>
|
||||
<group>
|
||||
<group>
|
||||
<field name="product_id" on_change="onchange_product_id(parent.pricelist_id,product_id,0,False,parent.partner_id, parent.date_order,parent.fiscal_position,date_planned,name,False,'draft',context)"/>
|
||||
<field name="product_id" on_change="onchange_product_id(parent.pricelist_id,product_id,0,False,parent.partner_id, parent.date_order,parent.fiscal_position,date_planned,False,False,'draft',context)"/>
|
||||
<label for="product_qty"/>
|
||||
<div>
|
||||
<field name="product_qty" on_change="onchange_product_id(parent.pricelist_id,product_id,product_qty,product_uom,parent.partner_id,parent.date_order,parent.fiscal_position,date_planned,name,False,'draft',context)" class="oe_inline"/>
|
||||
|
|
|
@ -237,10 +237,10 @@ class purchase_order_line(osv.osv):
|
|||
_inherit = 'purchase.order.line'
|
||||
def onchange_product_id(self,cr, uid, ids, pricelist, product, qty, uom,
|
||||
partner_id, date_order=False, fiscal_position_id=False, date_planned=False,
|
||||
name=False, price_unit=False, state='draft', notes=False, context=None):
|
||||
name=False, price_unit=False, state='draft', context=None):
|
||||
warning = {}
|
||||
if not product:
|
||||
return {'value': {'price_unit': price_unit or 0.0, 'name': name or '', 'notes': notes or '', 'product_uom' : uom or False}, 'domain':{'product_uom':[]}}
|
||||
return {'value': {'price_unit': price_unit or 0.0, 'name': name or '', 'product_uom' : uom or False}, 'domain':{'product_uom':[]}}
|
||||
product_obj = self.pool.get('product.product')
|
||||
product_info = product_obj.browse(cr, uid, product)
|
||||
title = False
|
||||
|
|
|
@ -226,6 +226,7 @@
|
|||
var item = false;
|
||||
if (record) {
|
||||
item = record.attributes;
|
||||
this.dataset.select_id(record.get('id'));
|
||||
} else {
|
||||
record = this.make_empty_record(false);
|
||||
this.records.add(record, {
|
||||
|
|
Loading…
Reference in New Issue