Bỏ qua để đến Nội dung
Menu
Câu hỏi này đã bị gắn cờ
2 Trả lời
6183 Lượt xem

EDIT: Simple mistake, I inherited "mrp.view_mrp_production_workcenter_form_view_filter", when I should have inherited "mrp_operations.view_mrp_production_workcenter_form_view_filter".

 

I am trying to add a "group by..." for customer to Work Orders and am having some trouble. Currently I have a customer field defined on each product (many2one) that then gets translated via fields.related to the Manufacturing Order and Work Order views. This is working without issue. I am trying to sort my Work Orders by customer now using "Group By...", but for some reason my code isn't working. If someone could check it out for me I'd really appreciate it.

   

My  current code:

 

    <record id="view_workcenter_customer_domain_search" model="ir.ui.view">

        <field name="name">workcenter.customer.domain.search</field>

        <field name="model">mrp.production.workcenter.line</field>

        <field name="inherit_id" ref="mrp.view_mrp_production_workcenter_form_view_filter"/>

        <field name="arch" type="xml">

            <xpath expr="//group/filter[@string='Date']" position="after">

                    <filter string="Customer" icon="terp-go-home" domain="[]" context="{'group_by':'customer_name'}"/>

            </xpath>

        </field>

    </record>

Ảnh đại diện
Huỷ bỏ

Define 'isn't working' - an error, the wrong result, no result ?

Tác giả

No errors, but no result at all.

Câu trả lời hay nhất

(FROM ALEX) Simple mistake, I inherited "mrp.view_mrp_production_workcenter_form_view_filter", when I should have inherited "mrp_operations.view_mrp_production_workcenter_form_view_filter".

Ảnh đại diện
Huỷ bỏ
Câu trả lời hay nhất

I don't know which version you're using, but I don't find 'Date' in the filter (v6.1). Maybe 'Late':

<xpath expr="//group/filter[@string='Late']" position="after">

...

Ảnh đại diện
Huỷ bỏ
Tác giả

I am trying to edit the "Group By..." section, not the normal filter section. I am not familiar with V6, so I don't know if that feature exists. It should work similarly though.