审批二开
This commit is contained in:
@@ -0,0 +1,4 @@
|
||||
# -*- coding: utf-8 -*-
|
||||
# Part of Odoo. See LICENSE file for full copyright and licensing details.
|
||||
|
||||
from . import models
|
||||
@@ -0,0 +1,21 @@
|
||||
# -*- coding: utf-8 -*-
|
||||
# Part of Odoo. See LICENSE file for full copyright and licensing details.
|
||||
{
|
||||
'name': 'Tianhe Approvals',
|
||||
'version': '1.0',
|
||||
'category': 'Human Resources/Approvals',
|
||||
'sequence': 190,
|
||||
'summary': 'Create and validate approvals requests',
|
||||
'description': """
|
||||
""",
|
||||
'depends': ['yuthon_approval'],
|
||||
'data': [
|
||||
'security/ir.model.access.csv',
|
||||
'data/approval_category_type_data.xml',
|
||||
'views/tianhe_purchase_work_approval.xml',
|
||||
|
||||
],
|
||||
'application': True,
|
||||
'installable': True,
|
||||
'license': 'OEEL-1',
|
||||
}
|
||||
@@ -0,0 +1,25 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<odoo>
|
||||
<data>
|
||||
<!-- 天河投资办公室 - 采购办公用品 -->
|
||||
<record id="approval_category_data_tianhe_purchase_work_approval" model="approval.category">
|
||||
<field name="name">采购办公用品</field>
|
||||
<field name="category_type_number">purchase_work_approval</field>
|
||||
<field name="model_name">approval.request</field>
|
||||
<!-- <field name="image" type="base64" file="approvals/static/src/img/Suitcase.png"/>-->
|
||||
<field name="sequence">1</field>
|
||||
<field name="has_date">no</field>
|
||||
<field name="has_period">no</field>
|
||||
<field name="has_product">required</field>
|
||||
<field name="has_quantity">no</field>
|
||||
<field name="has_amount">no</field>
|
||||
<field name="has_reference">no</field>
|
||||
<field name="has_partner">no</field>
|
||||
<field name="has_payment_method">no</field>
|
||||
<field name="has_location">no</field>
|
||||
<field name="requirer_document">optional</field>
|
||||
<field name="approval_minimum">1</field>
|
||||
<field name="manager_approval">approver</field>
|
||||
</record>
|
||||
</data>
|
||||
</odoo>
|
||||
@@ -0,0 +1,5 @@
|
||||
# -*- coding: utf-8 -*-
|
||||
# Part of Odoo. See LICENSE file for full copyright and licensing details.
|
||||
|
||||
from . import tianhe_purchase_work_approval
|
||||
from . import inherit_approval_category
|
||||
@@ -0,0 +1,36 @@
|
||||
# -*- coding: utf-8 -*-
|
||||
from odoo import api, fields, models, tools, _
|
||||
|
||||
|
||||
class ApprovalCategory(models.Model):
|
||||
_inherit = 'approval.category'
|
||||
_description = 'tian he 审批框架拓展'
|
||||
|
||||
def create_request(self):
|
||||
self.ensure_one()
|
||||
if not self.category_type_number:
|
||||
return {
|
||||
"type": "ir.actions.act_window",
|
||||
"res_model": "approval.request",
|
||||
"views": [[False, "form"]],
|
||||
"context": {
|
||||
'default_name': _('New') if self.automated_sequence else self.name,
|
||||
'default_category_id': self.id,
|
||||
'default_request_owner_id': self.env.user.id,
|
||||
'default_request_status': 'new'
|
||||
},
|
||||
}
|
||||
else:
|
||||
form_str = 'tianhe_approvals.approvals_category_type_code_%s' % self.category_type_number
|
||||
approvals_form_id = self.env.ref(form_str).id or ''
|
||||
return {
|
||||
"type": "ir.actions.act_window",
|
||||
"res_model": self.model_name,
|
||||
"views": [[approvals_form_id, "form"]],
|
||||
"context": {
|
||||
'default_name': _('New') if self.automated_sequence else self.name,
|
||||
'default_category_id': self.id,
|
||||
'default_request_owner_id': self.env.user.id,
|
||||
'default_request_status': 'new'
|
||||
},
|
||||
}
|
||||
@@ -0,0 +1,15 @@
|
||||
# -*- coding: utf-8 -*-
|
||||
from odoo import api, fields, models, tools, _
|
||||
from odoo.exceptions import ValidationError
|
||||
|
||||
|
||||
class TianHePurchaseApproval(models.Model):
|
||||
_inherit = "approval.request"
|
||||
_description = '天河采购审批单'
|
||||
|
||||
# approvals_department_id 部门
|
||||
# date_confirm 确认日期
|
||||
# purchase_work_notice = fields.Text(string="采购原由")
|
||||
# 产品明细,设备名称,型号,单价,数量,小计,库存,备注
|
||||
|
||||
|
||||
@@ -0,0 +1,2 @@
|
||||
id,name,model_id:id,group_id:id,perm_read,perm_write,perm_create,perm_unlink
|
||||
|
||||
|
@@ -0,0 +1,34 @@
|
||||
<?xml version="1.0" encoding="UTF-8" ?>
|
||||
<odoo>
|
||||
<record id="approvals_category_type_code_purchase_work_approval" model="ir.ui.view">
|
||||
<field name="name">approvals.category.type.code.purchase.work.approval</field>
|
||||
<field name="model">approval.request</field>
|
||||
<field name="inherit_id" ref="approvals.approval_request_view_form"/>
|
||||
<field name="arch" type="xml">
|
||||
<xpath expr="//field[@name='company_id']" position="after">
|
||||
<field name="approvals_department_id"/>
|
||||
</xpath>
|
||||
<xpath expr="//page[@name='description']" position="attributes">
|
||||
<attribute name="string">采购原由</attribute>
|
||||
</xpath>
|
||||
<xpath expr="//page[@name='products']" position="replace">
|
||||
<page string="采购清单" name="products" invisible="has_product == 'no'">
|
||||
<!-- 未知功能,暂留 -->
|
||||
<!-- contex"{'tree_view_ref': 'approvals.approval_product_line_view_tree', 'kanban_view_ref': 'approvals.approval_product_kanban_mobile_view'}"-->
|
||||
<field name="product_line_ids" readonly="request_status != 'new'">
|
||||
<tree editable="bottom" string="采购清单">
|
||||
<field name="company_id" column_invisible="True"/>
|
||||
<field name="product_id" string="设备名称"/>
|
||||
<field name="product_id" string="设备型号"/>
|
||||
<field name="product_id" string="单价"/>
|
||||
<field name="product_id" string="数量"/>
|
||||
<field name="product_id" string="小计"/>
|
||||
<field name="product_id" string="库存"/>
|
||||
<field name="product_id" string="备注"/>
|
||||
</tree>
|
||||
</field>
|
||||
</page>
|
||||
</xpath>
|
||||
</field>
|
||||
</record>
|
||||
</odoo>
|
||||
@@ -5,7 +5,7 @@ from odoo.exceptions import ValidationError
|
||||
|
||||
class DemoApprovalRequest(models.Model):
|
||||
_inherit = "approval.request"
|
||||
_description = '默认审批 approval.request'
|
||||
_description = '默认审批'
|
||||
|
||||
demo1 = fields.Char(string="demo1")
|
||||
demo2 = fields.Char(string="demo2")
|
||||
|
||||
Reference in New Issue
Block a user