[FIX] account_analytic_analysis: recurring invoice line description and yearly interval

the product_id_change name is reset if name is not passed to method args
the product_id_change call in account_analytic_view set name as false so it is reset each time the product is change
the yearly interval add a year to the next recurring date instead of one month
This commit is contained in:
Denis Ledoux 2014-05-23 11:16:46 +02:00
parent 2af03e1b6e
commit 7a3b7f7fe2
2 changed files with 4 additions and 2 deletions

View File

@ -82,7 +82,7 @@ class account_analytic_invoice_line(osv.osv):
if not name:
name = self.pool.get('product.product').name_get(cr, uid, [res.id], context=local_context)[0][1]
if res.description_sale:
result['name'] += '\n'+res.description_sale
name += '\n'+res.description_sale
result.update({'name': name or False,'uom_id': uom_id or res.uom_id.id or False, 'price_unit': price})
@ -750,6 +750,8 @@ class account_analytic_account(osv.osv):
new_date = next_date+relativedelta(days=+interval)
elif contract.recurring_rule_type == 'weekly':
new_date = next_date+relativedelta(weeks=+interval)
elif contract.recurring_rule_type == 'yearly':
new_date = next_date+relativedelta(years=+interval)
else:
new_date = next_date+relativedelta(months=+interval)
self.write(cr, uid, [contract.id], {'recurring_next_date': new_date.strftime('%Y-%m-%d')}, context=context)

View File

@ -166,7 +166,7 @@
<div attrs="{'invisible': [('recurring_invoices','=',False)]}">
<field name="recurring_invoice_line_ids">
<tree string="Account Analytic Lines" editable="bottom">
<field name="product_id" on_change="product_id_change(product_id, uom_id, quantity, name, parent.partner_id, price_unit, parent.pricelist_id, parent.company_id)"/>
<field name="product_id" on_change="product_id_change(product_id, uom_id, quantity, False, parent.partner_id, price_unit, parent.pricelist_id, parent.company_id)"/>
<field name="name"/>
<field name="quantity"/>
<field name="uom_id"/>