Skip to Content
Menu
This question has been flagged

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
Discard
Related Posts Replies Views Activity
1
Feb 16
8583
3
Feb 16
4590
1
Feb 16
2951
1
Sep 23
1799
4
May 23
8694