@@ -674,9 +674,19 @@ class YuthonVacationReports(models.Model):
|
||||
'vacation_date': current_month_first,
|
||||
})
|
||||
|
||||
|
||||
def _update_leave_lines(self, report, allocations, number_of_hours_display):
|
||||
for alloc in allocations:
|
||||
existing_line = self.env['vacation.leave.line'].search([
|
||||
('workflow_record_id', '=', False),
|
||||
('vacation_id', '=', report.id),
|
||||
('employee_id', '=', report.employee_id.id),
|
||||
('update_type', '=', 'add'),
|
||||
('allocation_type', '=', 'allocation'),
|
||||
('update_lines', '=', number_of_hours_display),
|
||||
('is_void', '=', False)
|
||||
], limit=1)
|
||||
if existing_line:
|
||||
continue
|
||||
self.env['vacation.leave.line'].create({
|
||||
'vacation_id': report.id,
|
||||
'employee_id': report.employee_id.id,
|
||||
@@ -691,6 +701,19 @@ class YuthonVacationReports(models.Model):
|
||||
def _update_over_lines(self, report, allocations, number_of_hours_display):
|
||||
"""更新补休明细行"""
|
||||
for alloc in allocations:
|
||||
existing_line = self.env['vacation.leave.line'].search([
|
||||
('workflow_record_id', '=', False),
|
||||
('vacation_id', '=', report.id),
|
||||
('employee_id', '=', report.employee_id.id),
|
||||
('update_type', '=', 'add'),
|
||||
('allocation_type', '=', 'allocation'),
|
||||
('workday', '=', number_of_hours_display),
|
||||
('legal_day', '=', 0),
|
||||
('public_holidays', '=', 0),
|
||||
('meal_number', '=', 0),
|
||||
], limit=1)
|
||||
if existing_line:
|
||||
continue
|
||||
self.env['vacation.over.line'].create({
|
||||
'vacation_id': report.id,
|
||||
'employee_id': report.employee_id.id,
|
||||
|
||||
@@ -7,13 +7,14 @@ from odoo.exceptions import UserError, ValidationError
|
||||
class InheritPurchaseOrder(models.Model):
|
||||
# _inherit = 'purchase.order'
|
||||
_name = 'purchase.order'
|
||||
_inherit = ['purchase.order','sun.badge.menu.mixin']
|
||||
_inherit = ['purchase.order', 'soong.workflow.mixin']
|
||||
|
||||
json_display = fields.Char(
|
||||
string="物品详情",
|
||||
compute='_compute_json_display',
|
||||
store=True
|
||||
)
|
||||
work_end = fields.Boolean(string="结束")
|
||||
document_ids = fields.Many2many('ir.attachment', string="附件")
|
||||
|
||||
|
||||
|
||||
@@ -29,6 +29,8 @@
|
||||
<field name="arch" type="xml">
|
||||
<xpath expr="//field[@name='currency_id']" position="after">
|
||||
<field name="document_ids" widget="preview_many2many"/>
|
||||
<field name="is_back" invisible="1"/>
|
||||
<field name="work_end" invisible="1"/>
|
||||
</xpath>
|
||||
<xpath expr="//field[@name='partner_id']" position="attributes">
|
||||
<attribute name="domain">[('is_employee', '=', False)]</attribute>
|
||||
|
||||
Reference in New Issue
Block a user