base_currency_id = self.pool.get('res.company').browse(cr, uid, groupby['__domain'][0][2], context=context).currency_id.id
elif inner_groupby[0] == 'pricelist_id':
base_currency_id = self.pool.get('product.pricelist').browse(cr, uid, groupby['__domain'][0][2], context=context).currency_id.id
- else :
- base_currency_id = groupby['__domain'][0][2]
user = self.pool.get('res.users').browse(cr, uid, uid, context=context)
value = self.pool.get('res.currency').compute(cr, uid, base_currency_id, user.company_id.currency_id.id, groupby.get(value_field, 0))
section_result[month]['value'] = section_result[month]['value'] + value
groupby_begin = (month_begin + relativedelta.relativedelta(months=-4)).strftime(tools.DEFAULT_SERVER_DATE_FORMAT)
for id in ids:
created_domain = [('section_id', '=', id), ('state', 'not in', ['draft', 'cancel']), ('date', '>=', groupby_begin)]
- res[id] = self.__get_bar_values(cr, uid, obj, created_domain, ['price_total', 'date','currency_id'], 'price_total', ['date','currency_id'], context=context)
+ res[id] = self.__get_bar_values(cr, uid, obj, created_domain, ['date'], 'user_currency_price_total', 'date', context=context)
return res
def _compute_amounts_in_user_currency(self, cr, uid, ids, field_names, args, context=None):
}
def action_forecast(self, cr, uid, id, value, context=None):
- return self.write(cr, uid, [id], {'invoiced_forecast': int(value)}, context=context)
+ return self.write(cr, uid, [id], {'invoiced_forecast': int(float(value))}, context=context)
def write(self, cr, uid, ids, vals, context=None):
currency_obj = self.pool.get('res.currency')
<field name="res_model">account.invoice.report</field>
<field name="view_type">form</field>
<field name="view_mode">tree,graph</field>
- <field name="domain">[('state','=','paid'),('section_id', '=', active_id)]</field>
+ <field name="domain">[('section_id', '=', active_id)]</field>
<field name="context">{'search_default_month':1}</field>
<field name="help">From this report, you can have an overview of the amount invoiced to your customer. The tool search can also be used to personalise your Invoices reports and so, match this analysis to your needs.</field>
</record>