This question has been flagged

Hi, I'm trying to put a searchable field in POS Order Analysis to filter by TAX. So far I created 'tax_id' field of type many2many

class pos_order_report(osv.osv):
_name = "report.pos.order"
_description = "Point of Sale Orders Statistics"
_auto = False
_columns = {
   ...
   'tax_id': fields.many2many('account.tax','product_taxes_rel','prod_id','tax_id','Product Tax',readonly=True ),
   ...

and added it in the View:

        ...
        <record id="view_report_pos_order_tree" model="ir.ui.view">
        <field name="name">report.pos.order.tree</field>
        <field name="model">report.pos.order</field>
        <field name="arch" type="xml">
            <tree string="Point of Sale Analysis" create="false">
               ...
                <field name="tax_id" invisible="1"/>
                ...


        <record id="view_report_pos_order_search" model="ir.ui.view">
        <field name="name">report.pos.order.search</field>
        <field name="model">report.pos.order</field>
        <field name="arch" type="xml">
            <search string="Point of Sale Analysis">
                ...
                <field name="tax_id"/>
               ...

It let me search by Product Tax but it shows wrong results. What is the right approach for this? I'll appreciate any help. Thanks

Avatar
Discard

Did you get this resolved? How to add fields under init for example, if one need to add cost price & tax amount field - how these needs to be initialized?