Ir al contenido
Menú
Se marcó esta pregunta

I am adding some monetary amounts to the Stock.Picking / Stock.Move reports.

I get the following error:

  File "/usr/lib/python2.7/dist-packages/openerp/addons/base/ir/ir_qweb.py", line 1001, in _format
    precision = int(round(math.log10(display.rounding)))
QWebException: 'int' object has no attribute 'rounding'
While trying:

 <span class="text-right" t-esc="move.order_price" t-esc-options="{&quot;widget&quot;: &quot;monetary&quot;, &quot;display_currency&quot;: &quot;1&quot;}"/>


move.order_price has been added to the model and it is basically sale order line's price_subtotal; while move is the iteration over stock moves in the qweb report

Note that as I am not in invoice or sale order I lack currency_id and therefore I am hardcoding "1" Euro to the report.


class StockMove(models.Model):
    _inherit = 'stock.move'
    order_price = fields.Float(string="Purchase subtotal", related='purchase_line_id.price_subtotal')

 


Any help is really welcomed,

Avatar
Descartar
Publicaciones relacionadas Respuestas Vistas Actividad
1
feb 16
9623
3
feb 16
5635
1
feb 16
3735
1
sept 23
3333
4
may 23
10525