Skip to Content
Meniu
Trebuie să fiți înregistrat pentru a interacționa cu comunitatea.
Această întrebare a fost marcată
1 Răspunde
1038 Vizualizări

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.

Imagine profil
Abandonează
Cel mai bun răspuns

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

Imagine profil
Abandonează
Related Posts Răspunsuri Vizualizări Activitate
1
iul. 25
1792
1
iul. 25
1033
1
mar. 25
1174
2
aug. 24
1987
1
dec. 23
10942