Python 东南方。我很感激它Hanks@Eric我很高兴我帮助了你,抱歉我认为这是你需要的,我没有注意到你说hr.employee模型中存在此字段的部分 class FineAllocation(models.TransientModel): _name = 'fi

Python 东南方。我很感激它Hanks@Eric我很高兴我帮助了你,抱歉我认为这是你需要的,我没有注意到你说hr.employee模型中存在此字段的部分 class FineAllocation(models.TransientModel): _name = 'fi,python,odoo,odoo-12,odoo-13,Python,Odoo,Odoo 12,Odoo 13,东南方。我很感激它Hanks@Eric我很高兴我帮助了你,抱歉我认为这是你需要的,我没有注意到你说hr.employee模型中存在此字段的部分 class FineAllocation(models.TransientModel): _name = 'fine.allocation' _description = 'Fine Allocation' @api.model def action_allocate_fine(self): pass employee_ids = field


东南方。我很感激它Hanks@Eric我很高兴我帮助了你,抱歉我认为这是你需要的,我没有注意到你说hr.employee模型中存在此字段的部分
class FineAllocation(models.TransientModel):
_name = 'fine.allocation'
_description = 'Fine Allocation'

@api.model
def action_allocate_fine(self):
    pass

employee_ids = fields.Many2many('hr.employee','hr_employee_group_rel', 'deductions_id' 'Employees')
fine_amount = fields.Float(string='Fine Amount')
<record id="employee_fine_allocation_form" model="ir.ui.view">
        <field name="name">Employee Fine Allocation Form</field>
        <field name="model">fine.allocation</field>
        <field name="arch" type="xml">
            <form string="Employee Fine Allocation">
                <group>
                    <span colspan="4" nolabel="1">This wizard will allocate fines for all selected employee(s) equalling the input fine amount.</span>
                </group>

                <group colspan="4">
                    <separator string="Employees" colspan="4" />
                    <newline />
                    <field name="employee_ids" nolabel="1" />
                </group>

                <footer>
                    <button name="action_allocate_fine" string="Allocate Fines" type="object" class="btn-primary" />
                    <button string="Cancel" class="btn-secondary" special="cancel" />
                </footer>
            </form>
        </field>
    </record>
 <record id="view_employee_tree" model="ir.ui.view">
     <field name="name">hr.employee.tree</field>
     <field name="model">hr.employee</field>
     <field name="inherit_id" ref="hr.view_employee_tree"/>
     <field name="arch" type="xml">
         <tree>
             <field name="fine_amount"/>
         </tree>
     </field>
 </record>
 <record id="view_employee_tree_allocate_fine" model="ir.ui.view">
 <field name="name">hr.employee.tree.allocate.fine</field>
 <field name="model">hr.employee</field>
 <field name="arch" type="xml">
     <tree string="Employees" decoration-bf="message_needaction==True">
         <field name="name"/>
         <field name="work_phone" class="o_force_ltr"/>
         <field name="work_email"/>
         <field name="company_id" groups="base.group_multi_company"/>
         <field name="department_id"/>
         <field name="job_id"/>
         <field name="parent_id"/>
         <field name="coach_id" invisible="1"/>
         <field name="message_needaction" invisible="1"/>

         <field name="fine_amount"/>
     </tree>
 </field>
 </record>
<field name="employee_ids" nolabel="1" context="{'tree_view_ref': 'module_name.view_employee_tree_allocate_fine'}"/>
 <field name="employee_ids">
     <tree editable="bottom">
         <field name="name"/>
         <field name="work_phone" class="o_force_ltr"/>
         <field name="work_email"/>
         <field name="company_id" groups="base.group_multi_company"/>
         <field name="department_id"/>
         <field name="job_id"/>
         <field name="parent_id"/>
         <field name="coach_id" invisible="1"/>
         <field name="message_needaction" invisible="1"/>

         <field name="fine_amount"/>
     </tree>
 </field>
employee_ids = fields.Many2many('hr.employee', 'hr_employee_rel', 'payslip_id', 'Employees')
the “employees” column of the “hr_employee_rel” relationship does not exist
LINE 2: ...   INSERT INTO hr_employee_rel (payslip_id, Employees)...
psycopg2.errors.UndefinedColumn: ERROR: the column « deductions_idemployees » of the relation « hr_employee_group_rel » does not exist
LINE 2: ... INSERT INTO hr_employee_group_rel (deductions ...
employee_ids = fields.Many2many('hr.employee', 'hr_employee_fine_allocation_rel', 'payslip_id', string='Employees')
employee_ids = fields.Many2many('hr.employee', string='Employees')