Skip to Content
Menu
This question has been flagged
1 Reply
949 Views

Hello,

I want to add a measure Tax in the following model:

The value displayed will be the tax amount for the product:
For e.g. In this product form, customer taxes is 15 % and sales price is Rs 7.50, tax amount will be 1.13 (1.125 rounded to 2 d.p.)


Thanks.

Avatar
Discard
Best Answer

Hi,

You can override _select and _group_by functions to add the tax field to the pos order report.


You can find the following example in the pos_hr module:


class PosOrderReport(models.Model):

    _inherit = "report.pos.order"


    employee_id = fields.Many2one(

                'hr.employee', string='Employee', readonly=True)


    def _select(self):

        return super(PosOrderReport, self)._select() + ',s.employee_id AS employee_id'


    def _group_by(self):

        return super(PosOrderReport, self)._group_by() + ',s.employee_id'


Hope it helps

Avatar
Discard
Related Posts Replies Views Activity
0
Mar 25
856
1
Mar 25
985
2
Aug 24
1760
0
Aug 24
1597
1
Dec 23
10758