优化采购和销售
This commit is contained in:
@@ -10,7 +10,7 @@
|
|||||||
""",
|
""",
|
||||||
'category': 'sf',
|
'category': 'sf',
|
||||||
'website': 'https://www.sf.jikimo.com',
|
'website': 'https://www.sf.jikimo.com',
|
||||||
'depends': ['account', 'base', 'mrp_workorder', 'sale', 'purchase', 'sales_team'],
|
'depends': ['base', 'mrp_workorder', 'sale', 'purchase', 'sales_team'],
|
||||||
'data': [
|
'data': [
|
||||||
'security/group_security.xml',
|
'security/group_security.xml',
|
||||||
'security/ir.model.access.csv',
|
'security/ir.model.access.csv',
|
||||||
|
|||||||
@@ -10,11 +10,12 @@
|
|||||||
""",
|
""",
|
||||||
'category': 'sf',
|
'category': 'sf',
|
||||||
'website': 'https://www.sf.jikimo.com',
|
'website': 'https://www.sf.jikimo.com',
|
||||||
'depends': ['sale', 'sale_management', 'web_widget_model_viewer', 'sf_base'],
|
'depends': ['sale', 'sale_management', 'web_widget_model_viewer', 'sf_base', 'account', 'purchase'],
|
||||||
'data': [
|
'data': [
|
||||||
'security/group_security.xml',
|
'security/group_security.xml',
|
||||||
'security/ir.model.access.csv',
|
'security/ir.model.access.csv',
|
||||||
'wizard/sale_order_wizard_views.xml',
|
'wizard/sale_order_wizard_views.xml',
|
||||||
|
'wizard/purchase_order_wizard_views.xml',
|
||||||
'views/sale_team.xml',
|
'views/sale_team.xml',
|
||||||
'views/sale_order_view.xml',
|
'views/sale_order_view.xml',
|
||||||
'views/res_partner_view.xml',
|
'views/res_partner_view.xml',
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
import datetime
|
import datetime
|
||||||
import base64
|
import base64
|
||||||
from odoo import models, fields, api
|
from odoo import models, fields, api, _
|
||||||
from odoo.exceptions import UserError
|
from odoo.exceptions import UserError
|
||||||
|
|
||||||
|
|
||||||
@@ -91,12 +91,40 @@ class ResaleOrderLine(models.Model):
|
|||||||
class RePurchaseOrder(models.Model):
|
class RePurchaseOrder(models.Model):
|
||||||
_inherit = 'purchase.order'
|
_inherit = 'purchase.order'
|
||||||
|
|
||||||
check_status = fields.Selection([('unchecked', '未审核'), ('checked', '已审核')], '审核状态', default='unchecked')
|
check_status = fields.Selection([('pending', '待审核'), ('approved', '已审核'), ('fail', '不通过')], '审核状态')
|
||||||
|
remark = fields.Text('备注')
|
||||||
|
|
||||||
|
def write(self, vals):
|
||||||
|
if self.env.user.has_group('sf_base.group_purchase_director'):
|
||||||
|
if vals.get('check_status'):
|
||||||
|
if vals['check_status'] in ('pending', False):
|
||||||
|
vals['check_status'] = 'approved'
|
||||||
|
return super().write(vals)
|
||||||
|
|
||||||
|
@api.model_create_multi
|
||||||
|
def create(self, vals_list):
|
||||||
|
# res = super().create(vals_list)
|
||||||
|
if self.env.user.has_group('sf_base.group_purchase'):
|
||||||
|
view = self.env.ref('sf_sale.action_purchase_order_submit_wizard')
|
||||||
|
return {
|
||||||
|
'name': _('确认?'),
|
||||||
|
'type': 'ir.actions.act_window',
|
||||||
|
'view_mode': 'form',
|
||||||
|
'res_model': 'purchase.order.wizard',
|
||||||
|
'views': [(view.id, 'form')],
|
||||||
|
'view_id': view.id,
|
||||||
|
'target': 'new',
|
||||||
|
'context': dict(self.env.context),
|
||||||
|
}
|
||||||
|
res = super().create(vals_list)
|
||||||
|
return res
|
||||||
|
|
||||||
|
|
||||||
class ResPartnerToSale(models.Model):
|
class ResPartnerToSale(models.Model):
|
||||||
_inherit = 'res.partner'
|
_inherit = 'res.partner'
|
||||||
|
|
||||||
|
purchase_user_id = fields.Many2one('res.users', '采购员')
|
||||||
|
|
||||||
@api.constrains('name')
|
@api.constrains('name')
|
||||||
def _check_name(self):
|
def _check_name(self):
|
||||||
obj = self.sudo().search([('name', '=', self.name), ('id', '!=', self.id)])
|
obj = self.sudo().search([('name', '=', self.name), ('id', '!=', self.id)])
|
||||||
@@ -131,7 +159,13 @@ class ResPartnerToSale(models.Model):
|
|||||||
|
|
||||||
@api.onchange('user_id')
|
@api.onchange('user_id')
|
||||||
def _get_salesman(self):
|
def _get_salesman(self):
|
||||||
self.user_id = self.env.user.id
|
if self.customer_rank > 0:
|
||||||
|
self.user_id = self.env.user.id
|
||||||
|
|
||||||
|
@api.onchange('purchase_user_id')
|
||||||
|
def _get_purchaseman(self):
|
||||||
|
if self.supplier_rank > 0:
|
||||||
|
self.purchase_user_id = self.env.user.id
|
||||||
|
|
||||||
|
|
||||||
class ResUserToSale(models.Model):
|
class ResUserToSale(models.Model):
|
||||||
@@ -145,4 +179,14 @@ class ResUserToSale(models.Model):
|
|||||||
elif self.env.user.has_group('sf_base.group_sale_salemanager'):
|
elif self.env.user.has_group('sf_base.group_sale_salemanager'):
|
||||||
domain = [('id', '=', self.env.user.id)]
|
domain = [('id', '=', self.env.user.id)]
|
||||||
return self._search(domain, limit=limit, access_rights_uid=name_get_uid)
|
return self._search(domain, limit=limit, access_rights_uid=name_get_uid)
|
||||||
|
elif self._context.get('supplier_rank'):
|
||||||
|
if self.env.user.has_group('sf_base.group_purchase_director'):
|
||||||
|
domain = [('supplier_rank', '>', 0)]
|
||||||
|
elif self.env.user.has_group('sf_base.group_purchase'):
|
||||||
|
supplier = self.env['res.partner'].search(
|
||||||
|
[('supplier_rank', '>', 0), ('purchase_user_id', '=', self.env.user.id)])
|
||||||
|
if supplier:
|
||||||
|
ids = [t.id for t in supplier]
|
||||||
|
domain = [('id', 'in', ids)]
|
||||||
|
return self._search(domain, limit=limit, access_rights_uid=name_get_uid)
|
||||||
return super()._name_search(name, args, operator, limit, name_get_uid)
|
return super()._name_search(name, args, operator, limit, name_get_uid)
|
||||||
|
|||||||
@@ -51,6 +51,14 @@ access_mrp_bom_byproduct_group_purchase_director,mrp_bom_byproduct_group_purchas
|
|||||||
access_mrp_bom_byproduct_group_sale_salemanager,mrp_bom_byproduct_group_sale_salemanager,mrp.model_mrp_bom_byproduct,sf_base.group_sale_salemanager,1,0,0,0
|
access_mrp_bom_byproduct_group_sale_salemanager,mrp_bom_byproduct_group_sale_salemanager,mrp.model_mrp_bom_byproduct,sf_base.group_sale_salemanager,1,0,0,0
|
||||||
access_mrp_bom_byproduct_group_sale_director,mrp_bom_byproduct_group_sale_director,mrp.model_mrp_bom_byproduct,sf_base.group_sale_director,1,1,1,0
|
access_mrp_bom_byproduct_group_sale_director,mrp_bom_byproduct_group_sale_director,mrp.model_mrp_bom_byproduct,sf_base.group_sale_director,1,1,1,0
|
||||||
|
|
||||||
|
access_purchase_order_line_group_purchase,purchase_order_line_group_purchase,purchase_stock.model_purchase_order_line,sf_base.group_purchase,1,1,1,0
|
||||||
|
access_purchase_order_line_group_purchase_director,purchase_order_line_group_purchase_director,purchase_stock.model_purchase_order_line,sf_base.group_purchase_director,1,1,1,0
|
||||||
|
access_purchase_order_line_group_sale_salemanager,purchase_order_line_group_sale_salemanager,purchase_stock.model_purchase_order_line,sf_base.group_sale_salemanager,1,0,0,0
|
||||||
|
access_purchase_order_line_group_sale_director,purchase_order_line_group_sale_director,purchase_stock.model_purchase_order_line,sf_base.group_sale_director,1,1,1,0
|
||||||
|
|
||||||
|
access_purchase_order_wizard_group_purchase,purchase_order_wizard_group_purchase,model_purchase_order_wizard,sf_base.group_purchase,1,1,1,0
|
||||||
|
access_purchase_order_wizard_group_purchase_director,purchase_order_wizard_group_purchase_director,model_purchase_order_wizard,sf_base.group_purchase_director,1,1,1,0
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
|
@@ -6,45 +6,51 @@
|
|||||||
<field name="model">purchase.order</field>
|
<field name="model">purchase.order</field>
|
||||||
<field name="inherit_id" ref="purchase.purchase_order_form"/>
|
<field name="inherit_id" ref="purchase.purchase_order_form"/>
|
||||||
<field name="arch" type="xml">
|
<field name="arch" type="xml">
|
||||||
<!-- <xpath expr="//form/header/button[@name='button_confirm[1]']" position="after">-->
|
<field name="currency_id" position="after">
|
||||||
<!-- <field name="check_status" invisible="1"/>-->
|
<field name="check_status"/>
|
||||||
<!-- <button name="action_check" string="审核" type="object"-->
|
<field name="state"/>
|
||||||
<!-- attrs="{'invisible': [('check_status','=', 'checked')]}"-->
|
<field name="remark"/>
|
||||||
<!-- class="oe_highlight"/>-->
|
</field>
|
||||||
<!-- </xpath>-->
|
<xpath expr="//form/header/button[@name='action_rfq_send'][1]" position="after">
|
||||||
<!-- <xpath expr="//form/header/button[@name='button_confirm'][2]" position="attributes">-->
|
<button name="sf_sale.action_purchase_order_check_wizard" string="审核" type="action"
|
||||||
<!-- <attribute name="attrs">{'invisible': [('check_status', '=', 'unchecked'),('state', 'in',-->
|
context="{'default_order_id':active_id}" groups="sf_base.group_purchase_director"
|
||||||
<!-- ['draft'])]}-->
|
attrs="{'invisible': ['&',('check_status','in', ['approved']),('state', 'in', ['draft','send'])]}"
|
||||||
<!-- </attribute>-->
|
class="oe_highlight"/>
|
||||||
<!-- </xpath>-->
|
</xpath>
|
||||||
<!-- <xpath expr="//form/header/button[@name='button_confirm[2]']" position="after">-->
|
<xpath expr="//form/header/button[@name='button_confirm'][2]" position="replace">
|
||||||
<!-- <field name="check_status" invisible="1"/>-->
|
<button name="button_confirm" type="object" context="{'validate_analytic': True}"
|
||||||
<!-- <button name="action_check" string="审核" type="object"-->
|
string="确认订单" id="draft_confirm"
|
||||||
<!-- attrs="{'invisible': [('check_status','=', 'checked')]}"-->
|
attrs="{'invisible': ['&',('check_status','in', ['approved',False,'fail']),('state', 'in', ['draft'])]}"
|
||||||
<!-- class="oe_highlight"/>-->
|
/>
|
||||||
<!-- </xpath>-->
|
</xpath>
|
||||||
<!-- <xpath expr="//form/header/button[@name='action_rfq_send[1]']" position="attributes">-->
|
<!-- <xpath expr="//form/header/button[@name='button_confirm[2]']" position="after">-->
|
||||||
<!-- <attribute name="groups">sf_base.group_purchase</attribute>-->
|
<!-- <field name="check_status" invisible="1"/>-->
|
||||||
<!-- </xpath>-->
|
<!-- <button name="action_check" string="审核" type="object"-->
|
||||||
<!-- <xpath expr="//form/header/button[@name='action_rfq_send[2]']" position="attributes">-->
|
<!-- attrs="{'invisible': [('check_status','=', 'checked')]}"-->
|
||||||
<!-- <attribute name="groups">sf_base.group_purchase</attribute>-->
|
<!-- class="oe_highlight"/>-->
|
||||||
<!-- </xpath>-->
|
<!-- </xpath>-->
|
||||||
<!-- <xpath expr="//form/header/button[@name='print_quotation[1]']" position="attributes">-->
|
<!-- <xpath expr="//form/header/button[@name='action_rfq_send[1]']" position="attributes">-->
|
||||||
<!-- <attribute name="groups">sf_base.group_purchase</attribute>-->
|
<!-- <attribute name="groups">sf_base.group_purchase</attribute>-->
|
||||||
<!-- </xpath>-->
|
<!-- </xpath>-->
|
||||||
<!-- <xpath expr="//form/header/button[@name='print_quotation[2]']" position="attributes">-->
|
<!-- <xpath expr="//form/header/button[@name='action_rfq_send[2]']" position="attributes">-->
|
||||||
<!-- <attribute name="groups">sf_base.group_purchase</attribute>-->
|
<!-- <attribute name="groups">sf_base.group_purchase</attribute>-->
|
||||||
<!-- </xpath>-->
|
<!-- </xpath>-->
|
||||||
|
<!-- <xpath expr="//form/header/button[@name='print_quotation[1]']" position="attributes">-->
|
||||||
|
<!-- <attribute name="groups">sf_base.group_purchase</attribute>-->
|
||||||
|
<!-- </xpath>-->
|
||||||
|
<!-- <xpath expr="//form/header/button[@name='print_quotation[2]']" position="attributes">-->
|
||||||
|
<!-- <attribute name="groups">sf_base.group_purchase</attribute>-->
|
||||||
|
<!-- </xpath>-->
|
||||||
<xpath expr="//form/header/button[@name='button_approve']" position="attributes">
|
<xpath expr="//form/header/button[@name='button_approve']" position="attributes">
|
||||||
<attribute name="groups">sf_base.group_purchase</attribute>
|
<attribute name="groups">sf_base.group_purchase</attribute>
|
||||||
</xpath>
|
</xpath>
|
||||||
|
|
||||||
<!-- <xpath expr="//form/header/button[@name='action_create_invoice[1]']" position="attributes">-->
|
<!-- <xpath expr="//form/header/button[@name='action_create_invoice[1]']" position="attributes">-->
|
||||||
<!-- <attribute name="groups">sf_base.group_purchase</attribute>-->
|
<!-- <attribute name="groups">sf_base.group_purchase</attribute>-->
|
||||||
<!-- </xpath>-->
|
<!-- </xpath>-->
|
||||||
<!-- <xpath expr="//form/header/button[@name='action_create_invoice[2]']" position="attributes">-->
|
<!-- <xpath expr="//form/header/button[@name='action_create_invoice[2]']" position="attributes">-->
|
||||||
<!-- <attribute name="groups">sf_base.group_purchase</attribute>-->
|
<!-- <attribute name="groups">sf_base.group_purchase</attribute>-->
|
||||||
<!-- </xpath>-->
|
<!-- </xpath>-->
|
||||||
<xpath expr="//form/header/button[@name='confirm_reminder_mail']" position="attributes">
|
<xpath expr="//form/header/button[@name='confirm_reminder_mail']" position="attributes">
|
||||||
<attribute name="groups">sf_base.group_purchase</attribute>
|
<attribute name="groups">sf_base.group_purchase</attribute>
|
||||||
</xpath>
|
</xpath>
|
||||||
@@ -64,5 +70,19 @@
|
|||||||
</xpath>
|
</xpath>
|
||||||
</field>
|
</field>
|
||||||
</record>
|
</record>
|
||||||
|
|
||||||
|
<record id="view_purchase_order_kpis_tree_inherit_sf" model="ir.ui.view">
|
||||||
|
<field name="name">purchase.order.tree.inherit.sf</field>
|
||||||
|
<field name="model">purchase.order</field>
|
||||||
|
<field name="inherit_id" ref="purchase.purchase_order_kpis_tree"/>
|
||||||
|
<field name="arch" type="xml">
|
||||||
|
<field name="state" position="after">
|
||||||
|
<field name="check_status" widget="badge"
|
||||||
|
decoration-success="check_status == 'approved'"
|
||||||
|
decoration-warning="check_status == 'pending'"
|
||||||
|
decoration-danger="check_status == 'fail'"/>
|
||||||
|
</field>
|
||||||
|
</field>
|
||||||
|
</record>
|
||||||
</data>
|
</data>
|
||||||
</odoo>
|
</odoo>
|
||||||
@@ -6,30 +6,82 @@
|
|||||||
<field name="model">res.partner</field>
|
<field name="model">res.partner</field>
|
||||||
<field name="inherit_id" ref="base.view_partner_form"/>
|
<field name="inherit_id" ref="base.view_partner_form"/>
|
||||||
<field name="arch" type="xml">
|
<field name="arch" type="xml">
|
||||||
<field name="vat" position="replace">
|
<field name="vat" position="after">
|
||||||
<field name="vat" attrs="{'required' : [('company_type', '=', 'company')]}"/>
|
<field name="customer_rank" invisible="1"/>
|
||||||
|
<field name="supplier_rank" invisible="1"/>
|
||||||
|
</field>
|
||||||
|
<field name="vat" position="attributes">
|
||||||
|
<attribute name="required">1</attribute>
|
||||||
</field>
|
</field>
|
||||||
<field name="email" position="replace">
|
<field name="email" position="replace">
|
||||||
<field name="email" required="1"/>
|
<field name="email" attrs="{'required' : [('customer_rank','>', 0)]}"/>
|
||||||
</field>
|
</field>
|
||||||
<field name="mobile" position="attributes">
|
<field name="mobile" position="attributes">
|
||||||
<attribute name="attrs">{'required': [('phone', '=', False),('company_type','=', 'company')]}
|
<attribute name="attrs">{'required': [('phone', '=', False)]}
|
||||||
</attribute>
|
</attribute>
|
||||||
</field>
|
</field>
|
||||||
<field name="phone" position="attributes">
|
<field name="phone" position="attributes">
|
||||||
<attribute name="attrs">{'required': [('mobile', '=', False),('company_type','=', 'company')]}
|
<attribute name="attrs">{'required': [('mobile', '=', False)]}
|
||||||
|
</attribute>
|
||||||
|
</field>
|
||||||
|
<field name="street" position="attributes">
|
||||||
|
<attribute name="attrs">{'required': [('supplier_rank','>', 0)]}
|
||||||
|
</attribute>
|
||||||
|
</field>
|
||||||
|
<field name="street2" position="attributes">
|
||||||
|
<attribute name="attrs">{'required': [('supplier_rank','>', 0)]}
|
||||||
|
</attribute>
|
||||||
|
</field>
|
||||||
|
<field name="city" position="attributes">
|
||||||
|
<attribute name="attrs">{'required': [('supplier_rank','>', 0)]}
|
||||||
|
</attribute>
|
||||||
|
</field>
|
||||||
|
<field name="country_id" position="attributes">
|
||||||
|
<attribute name="attrs">{'required': [('supplier_rank','>', 0)]}
|
||||||
</attribute>
|
</attribute>
|
||||||
</field>
|
</field>
|
||||||
<xpath expr="//group[@name='sale']/field[@name='user_id']" position="replace">
|
<xpath expr="//group[@name='sale']/field[@name='user_id']" position="replace">
|
||||||
<field name="user_id" widget="many2one_avatar_user" context="{'is_sale': True }"
|
<field name="user_id" widget="many2one_avatar_user" context="{'is_sale': True }"
|
||||||
attrs="{'required' : [('company_type', '=', 'company')]}"/>
|
attrs="{'required' : [('customer_rank','>', 0)],'readonly': [('supplier_rank','>', 0)]}"/>
|
||||||
</xpath>
|
</xpath>
|
||||||
<field name="category_id" position="attributes">
|
<field name="category_id" position="attributes">
|
||||||
<attribute name="attrs">{'required': [('company_type', '=', 'company')]}</attribute>
|
<attribute name="required">1</attribute>
|
||||||
|
<!-- <attribute name="attrs">{'required': ['|',('customer_rank','>', 0),('supplier_rank','>', 0)]}</attribute>-->
|
||||||
</field>
|
</field>
|
||||||
</field>
|
</field>
|
||||||
</record>
|
</record>
|
||||||
|
|
||||||
|
<record model="ir.ui.view" id="view_partner_property_form_inherit_sf">
|
||||||
|
<field name="name">res.partner.property.form.inherit.sf</field>
|
||||||
|
<field name="model">res.partner</field>
|
||||||
|
<field name="inherit_id" ref="account.view_partner_property_form"/>
|
||||||
|
<field name="arch" type="xml">
|
||||||
|
<field name="property_supplier_payment_term_id" position="before">
|
||||||
|
<field name="purchase_user_id" context="{'supplier_rank': supplier_rank }"
|
||||||
|
widget="many2one_avatar_user"
|
||||||
|
attrs="{'required' : [('supplier_rank','>', 0)],'readonly': [('customer_rank','>', 0)]}"/>
|
||||||
|
</field>
|
||||||
|
</field>
|
||||||
|
</record>
|
||||||
|
|
||||||
|
<record model="ir.ui.view" id="view_partner_property_form_inherit_sf">
|
||||||
|
<field name="name">res.partner.property.form.inherit.sf</field>
|
||||||
|
<field name="model">res.partner</field>
|
||||||
|
<field name="inherit_id" ref="base.view_partner_tree"/>
|
||||||
|
<field name="arch" type="xml">
|
||||||
|
<field name="function" position="before">
|
||||||
|
<field name="customer_rank" invisible="1"/>
|
||||||
|
<field name="supplier_rank" invisible="1"/>
|
||||||
|
</field>
|
||||||
|
<field name="user_id" position="attributes">
|
||||||
|
<attribute name="attrs">{'invisible': [('customer_rank','=', 0)]}
|
||||||
|
</attribute>
|
||||||
|
</field>
|
||||||
|
<field name="user_id" position="before">
|
||||||
|
<field name="purchase_user_id" widget="many2one_avatar_user"
|
||||||
|
attrs="{'invisible' : [('supplier_rank','=', 0)]}"/>
|
||||||
|
</field>
|
||||||
|
</field>
|
||||||
|
</record>
|
||||||
</data>
|
</data>
|
||||||
</odoo>
|
</odoo>
|
||||||
@@ -1 +1,2 @@
|
|||||||
from . import sale_order_wizard
|
from . import sale_order_wizard
|
||||||
|
from . import purchase_order_wizard
|
||||||
|
|||||||
25
sf_sale/wizard/purchase_order_wizard.py
Normal file
25
sf_sale/wizard/purchase_order_wizard.py
Normal file
@@ -0,0 +1,25 @@
|
|||||||
|
# -*- coding: utf-8 -*-
|
||||||
|
from odoo import models, api, fields
|
||||||
|
from odoo.exceptions import UserError
|
||||||
|
|
||||||
|
|
||||||
|
class PurchaseOrderWizard(models.TransientModel):
|
||||||
|
_name = 'purchase.order.wizard'
|
||||||
|
_description = '采购向导'
|
||||||
|
|
||||||
|
order_id = fields.Many2one('purchase.order')
|
||||||
|
# check_state = fields.Selection([('pass', '通过'), ('back', '退回')], '处理意见', default='pass')
|
||||||
|
check_audit = fields.Text('审核意见')
|
||||||
|
|
||||||
|
def submit(self):
|
||||||
|
self.order_id.check_status = 'approved'
|
||||||
|
self.order_id.remark = self.check_audit
|
||||||
|
|
||||||
|
def back(self):
|
||||||
|
if not self.check_audit:
|
||||||
|
raise UserError('请输入原因')
|
||||||
|
else:
|
||||||
|
self.order_id.write({'check_status': 'fail', 'remark': self.check_audit})
|
||||||
|
|
||||||
|
def confirm(self):
|
||||||
|
self.order_id.check_status = 'pending'
|
||||||
54
sf_sale/wizard/purchase_order_wizard_views.xml
Normal file
54
sf_sale/wizard/purchase_order_wizard_views.xml
Normal file
@@ -0,0 +1,54 @@
|
|||||||
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
|
<odoo>
|
||||||
|
<record model="ir.ui.view" id="purchase_order_check_wizard_form_view">
|
||||||
|
<field name="name">purchase.order.check.wizard.form.view</field>
|
||||||
|
<field name="model">purchase.order.wizard</field>
|
||||||
|
<field name="arch" type="xml">
|
||||||
|
<form>
|
||||||
|
<field name="order_id" invisible="True"/>
|
||||||
|
<group>
|
||||||
|
<!-- <field name="check_state" widget="radio" options="{'horizontal': true}" required="True" string=""/>-->
|
||||||
|
<field name="check_audit" placeholder="原因.." nolabel="1" colspan="2"/>
|
||||||
|
</group>
|
||||||
|
<footer>
|
||||||
|
<button string="通过" name="submit" type="object" class="oe_highlight"/>
|
||||||
|
<button string="退回" name="back" type="object" class="btn btn-secondary"/>
|
||||||
|
<!-- <button string="提交" name="submit" type="object" class="oe_highlight"/>-->
|
||||||
|
<!-- <button string="取消" class="btn btn-secondary" special="cancel"/>-->
|
||||||
|
</footer>
|
||||||
|
</form>
|
||||||
|
</field>
|
||||||
|
</record>
|
||||||
|
|
||||||
|
<record id="action_purchase_order_check_wizard" model="ir.actions.act_window">
|
||||||
|
<field name="name">审核</field>
|
||||||
|
<field name="res_model">purchase.order.wizard</field>
|
||||||
|
<field name="view_mode">form</field>
|
||||||
|
<field name="target">new</field>
|
||||||
|
</record>
|
||||||
|
|
||||||
|
<record model="ir.ui.view" id="purchase_order_submit_wizard_form_view">
|
||||||
|
<field name="name">purchase.order.submit.wizard.form.view</field>
|
||||||
|
<field name="model">purchase.order.wizard</field>
|
||||||
|
<field name="arch" type="xml">
|
||||||
|
<form>
|
||||||
|
<field name="order_id" invisible="True"/>
|
||||||
|
<div>
|
||||||
|
提交后不可更改,是否确定提交?
|
||||||
|
</div>
|
||||||
|
<footer>
|
||||||
|
<button string="确认" name="confirm" type="object" class="oe_highlight"/>
|
||||||
|
<button string="取消" class="btn btn-secondary" special="cancel"/>
|
||||||
|
</footer>
|
||||||
|
</form>
|
||||||
|
</field>
|
||||||
|
</record>
|
||||||
|
|
||||||
|
<record id="action_purchase_order_submit_wizard" model="ir.actions.act_window">
|
||||||
|
<field name="name">提交</field>
|
||||||
|
<field name="res_model">purchase.order.wizard</field>
|
||||||
|
<field name="view_mode">form</field>
|
||||||
|
<field name="target">new</field>
|
||||||
|
</record>
|
||||||
|
|
||||||
|
</odoo>
|
||||||
Reference in New Issue
Block a user