Technical Mailing lijst archieven

technical@mail.odoo.com

Avatar

Re: Is there any way to customize the view return by clicking "Add an item"?

door
Ecosoft Co. LTD, Kitti Upariphutthiphong
- 12-02-2019 22:30:20
Hi, 

I think you can try adding domain here?

<field name="employee_ids" nolabel="1" domain="[('xxx', '=', 'yyy')]/>

Can you?

On Tue, Nov 6, 2018 at 1:10 PM meng xiaolin <mxl85@hotmail.com> wrote:

Here is the scenario: in hr payroll module, when you clicking Generate payslip, a wizard will be opened and you can click “Add an item” to select employees, and the tree of employee will popup, what I am trying to do is :

1, Is it possible to put a domain on many2many field ‘employee_ids’ so that the rows of the tree view will be filtered by this domain?

2, when you clicking “Add an item”, the tree view of ‘hr.employee’ will pop up, is it possible I could change the action window or the tree view of this button without affecting the default tree view and action window of hr.employee module. In other words, there are two action window and tree view of ‘hr.employe’,  one is what you get in hr.employee module’s menus, and the other you get from whenever a many2many filed is used to refer to ‘hr.employee‘。

Thanks.

--------------------------------------------------------------------------------------------------------------------

<?xml version="1.0" encoding="utf-8"?>

<odoo>

 

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

            <field name="name">hr_payroll_payslip_employees</field>

            <field name="model">hr.payslip.employees</field>

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

                <form string="Payslips by Employees">

                    <header>

                        <button icon="fa-cogs" string="Generate" name="compute_sheet" type="object" class="oe_highlight"  />

                    </header>

                    <group>

                        <label colspan="4" nolabel="1" string="This wizard will generate payslips for all selected employee(s) based on the dates and credit note specified on Payslips Run." />

                    </group>

                    <group colspan="4" >

                        <separator string="Employees" colspan="4"/>

                        <newline/>

                        <field name="employee_ids" nolabel="1"/>

                    </group>

               </form>

            </field>

        </record>

 

        <record id="action_hr_payslip_by_employees" model="ir.actions.act_window">

            <field name="name">Generate Payslips</field>

            <field name="res_model">hr.payslip.employees</field>

            <field name="view_type">form</field>

            <field name="view_mode">tree,form</field>

            <field name="view_id" ref="view_hr_payslip_by_employees"/>

            <field name="target">new</field>

        </record>

 

</odoo>

_______________________________________________
Mailing-List: https://www.odoo.com/groups/technical-62
Post to: mailto:technical@mail.odoo.com
Unsubscribe: https://www.odoo.com/groups?unsubscribe