acc_purchase_view.xml
21.0 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
<?xml version="1.0" encoding="utf-8"?>
<openerp>
<data>
<record id="purchase_order_form_inherit" model="ir.ui.view">
<field name="name">purchase.order.form.inherit</field>
<field name="model">purchase.order</field>
<field name="inherit_id" ref="purchase.purchase_order_form"/>
<field name="arch" type="xml">
<xpath expr="//button[@name='action_rfq_send'][1]" position="attributes">
<attribute name="invisible">1</attribute>
</xpath>
<xpath expr="//button[@name='action_rfq_send'][2]" position="attributes">
<attribute name="invisible">1</attribute>
</xpath>
<xpath expr="//button[@name='action_rfq_send'][3]" position="attributes">
<attribute name="invisible">1</attribute>
</xpath>
<xpath expr="//button[@name='print_quotation'][1]" position="attributes">
<attribute name="invisible">1</attribute>
</xpath>
<xpath expr="//button[@name='print_quotation'][2]" position="attributes">
<attribute name="invisible">1</attribute>
</xpath>
<xpath expr="//button[@name='button_confirm'][1]" position="attributes">
<attribute name="invisible">1</attribute>
</xpath>
<xpath expr="//button[@name='button_confirm'][2]" position="attributes">
<attribute name="invisible">1</attribute>
</xpath>
<!-- <xpath expr="//button[@name='action_view_invoice'][1]" position="attributes">
<attribute name="invisible">1</attribute>
</xpath>
<xpath expr="//button[@name='action_view_invoice'][2]" position="attributes">
<attribute name="invisible">1</attribute>
</xpath> -->
<xpath expr="//button[@name='action_view_invoice'][2]" position="after">
<!-- <button name="export_purchase_record" string="导出询价单信息" type="object" states="draft" class="oe_highlight" groups="base.group_user"/> -->
<button name="export_purchase_record" string="导出物料信息" type="object" class="oe_highlight" states="draft,confirm,purchase" groups="base.group_user"/>
<button name="%(purchase_separate_wizard)d" type="action" states="purchase" string="分批账单" class="oe_highlight" groups="purchase.group_purchase_user"/>
<button name="update_newinfo" string="更新产品信息" type="object" states="draft" class="oe_highlight" groups="base.group_user"/>
<button name="fresh_merge_line" string="合并重复产品" type="object" states="draft" class="oe_highlight" groups="base.group_user"/>
<button name="check_before_qty" string="数量校对" type="object" states="draft" class="oe_highlight" groups="base.group_user"/>
<button name="confirm" string="提交审批" type="object" states="draft" class="oe_highlight" groups="base.group_user"/>
<button name="pomanager" string="采购经理审批" type="object" states="confirm" class="oe_highlight" groups="acct_base.acc_commerce_manager_group"/>
<button name="boss_accept" string="管理部审批" type="object" states="pomanager" class="oe_highlight" groups="acct_base.acc_manage_info_group"/>
<button name="button_draft" string="拒绝" type="object" states="confirm" class="oe_highlight" groups="acct_base.acc_commerce_manager_group"/>
<button name="button_draft" string="拒绝" type="object" states="pomanager" class="oe_highlight" groups="acct_base.acc_manage_info_group"/>
<button name="button_draft" string="取消" type="object" states="confirm,pomanager" class="oe_highlight" groups="base.group_user"/>
<button name="button_approve" string="确认订单" type="object" class="oe_highlight" attrs="{'invisible': [('state', 'not in', ['boss'])]}" groups="acct_base.acc_commerce_manager_group"/>
</xpath>
<xpath expr="//field[@name='state']" position="attributes">
<attribute name="statusbar_visible">draft,confirm,pomanager,boss,purchase</attribute>
</xpath>
<!-- <button name="print_quotation" string="Print RFQ" type="object" states="draft" class="oe_highlight" groups="base.group_user"/> -->
<xpath expr="//field[@name='partner_ref']" position="after" >
<field name="contact_id" context="{'choose_contact':'choose_contact','partner_id':partner_id}"/>
<field name="title"/>
<!-- <button class="oe_stat_button" name="export_purchase_record" string="导出" type="object"/> -->
<field name="charge_person"/>
<field name="traffic_rule"/>
<field name="delivery_time" placeholder="填写格式如(1-2周,1-2weeks,1-2天,1-2days)"/>
<field name="product_state"/>
<field name="payment_state"/>
<field name="paid_rate"/>
<field name="delivery_address"/>
<field name="picking_type_id"/>
<field name="merge_info"/>
</xpath>
<xpath expr="//field[@name='date_order']" position="after" >
<field name="crm_ponumber"/>
<field name="purchase_way"/>
<field name="purchase_type"/>
<field name="purchase_company" options="{'no_create': True, 'no_open': True}"/>
<field name="quality_state"/>
<field name="payment_rule"/>
<field name="end_date"/>
<field name="forcast_date"/>
<field name="demand_purchase"/>
<field name="before_purchase_id"/>
<field name="origin_order"/>
<field name="is_excipients"/>
<field name="en_name" invisible='1'/>
<field name="ship_fee"/>
<!-- <field name="discount_amount"/> -->
<field name="discount_type"/>
<!-- <font attrs="{'invisible': ['|', ('discount_type', '!=', 'discount')]}" style="line-height:34px;">折扣比例:</font> -->
<field name="discount_rate" attrs="{'invisible': ['|', ('discount_type', '!=', 'discount')],'required':[('discount_type', '=', 'discount')]}" style="width:18%"/>
<field name="minus_amount" attrs="{'invisible': ['|', ('discount_type', '!=', 'minusprice')],'required':[('discount_type', '=', 'minusprice')]}" style="width:18%;"/>
</xpath>
<xpath expr="//field[@name='amount_tax']" position="after" >
<field name="discount_amount" widget="monetary" options="{'currency_field': 'currency_id'}"/>
</xpath>
<!-- <xpath expr="/form/sheet/notebook/page[@name='purchase_delivery_invoice']" position="after">
<page string="付款记录">
<field name="purchase_payrecord_line">
<tree string="付款记录" editable="bottom">
<field name="pay_amount"/>
<field name="pay_datetime"/>
<field name="pay_user"/>
</tree>
</field>
</page>
</xpath> -->
</field>
</record>
<record id="purchase_order_tree_inherit" model="ir.ui.view">
<field name="name">purchase.order.tree.inherit</field>
<field name="model">purchase.order</field>
<field name="inherit_id" ref="purchase.purchase_order_tree"/>
<field name="arch" type="xml">
<xpath expr="//field[@name='name']" position="after" >
<field name="title"/>
<field name="product_state"/>
<field name="payment_state"/>
<field name="forcast_date"/>
<field name="purchase_way" invisible='1'/>
</xpath>
<xpath expr="//field[@name='date_planned']" position="attributes" >
<attribute name="invisible">1</attribute>
</xpath>
<xpath expr="//field[@name='user_id']" position="attributes" >
<attribute name="invisible">1</attribute>
</xpath>
<xpath expr="//field[@name='origin']" position="attributes" >
<attribute name="invisible">1</attribute>
</xpath>
</field>
</record>
<!-- 采购单增加搜索条件视图 -->
<record id="acc_purchase_order_search_view" model="ir.ui.view">
<field name="name">acc.purchase.order.search</field>
<field name="model">purchase.order</field>
<field name="mode">primary</field>
<field name="inherit_id" ref="purchase.view_purchase_order_filter"/>
<field name="arch" type="xml">
<xpath expr="//filter[@name='activities_my']" position="after">
<separator/>
<field name="title" string="标题" filter_domain="[('title','ilike',self)]"/>
<field name="charge_person" string="负责人"/>
<field name="origin_order" string="项目号(源销售单)"/>
<field name="before_purchase_id" string="源待确认询价单"/>
<field name="order_line" string="产品编码" filter_domain="[('order_line.product_id.acc_code', 'ilike', self)]"/>
<separator/>
<filter name="product_state" string="未到货" domain="[('product_state','=', 'new')]"/>
<filter name="product_state" string="部分到货" domain="[('product_state','=', 'part')]"/>
<filter name="product_state" string="全部到货" domain="[('product_state','=', 'all')]"/>
<filter name="product_state" string="取消订单" domain="[('product_state','=', 'cancel')]"/>
<filter name="payment_state" string="部分已付" domain="[('payment_state','=', 'part_pay')]"/>
<filter name="payment_state" string="未付" domain="[('payment_state','=', 'nopay')]"/>
<filter name="payment_state" string="全部付清" domain="[('payment_state','=', 'allpay')]"/>
</xpath>
</field>
</record>
<record id="acc_purchase_rfq" model="ir.actions.act_window">
<field name="name">询价单</field>
<field name="type">ir.actions.act_window</field>
<field name="res_model">purchase.order</field>
<field name="view_mode">tree,kanban,form,pivot,graph,calendar,activity</field>
<field name="search_view_id" ref="acc_purchase_order_search_view"/>
<field name="help" type="html">
<p class="o_view_nocontent_smiling_face">
Create a request for quotation
</p><p>
The quotation contains the history of the discussion
you had with your vendor.
</p>
</field>
</record>
<record id="wait_acc_purchase_pomanger1" model="ir.actions.act_window">
<field name="name">待采购经理审批采购单</field>
<field name="type">ir.actions.act_window</field>
<field name="res_model">purchase.order</field>
<field name="view_mode">tree,kanban,form,pivot,graph,calendar,activity</field>
<field name="search_view_id" ref="acc_purchase_order_search_view"/>
<field name="domain">[('state','=','confirm')]</field>
</record>
<record id="wait_acc_purchase_boss1" model="ir.actions.act_window">
<field name="name">待管理部审批采购单</field>
<field name="type">ir.actions.act_window</field>
<field name="res_model">purchase.order</field>
<field name="view_mode">tree,kanban,form,pivot,graph,calendar,activity</field>
<field name="search_view_id" ref="acc_purchase_order_search_view"/>
<field name="domain">[('state','=','pomanager')]</field>
</record>
<record id="wait_acc_purchase_manager1" model="ir.actions.act_window">
<field name="name">待确认采购单</field>
<field name="type">ir.actions.act_window</field>
<field name="res_model">purchase.order</field>
<field name="view_mode">tree,kanban,form,pivot,graph,calendar,activity</field>
<field name="search_view_id" ref="acc_purchase_order_search_view"/>
<field name="domain">[('state','=','boss')]</field>
</record>
<!-- <menuitem action="purchase_rfq" id="menu_purchase_rfq"
parent="purchase.menu_procurement_management"
sequence="0"/> -->
<menuitem id="menu_acc_purchase_rfq" name="询价单" parent="purchase.menu_procurement_management" action="acc_purchase_rfq" sequence="1"/>
<menuitem id="menu_wait_acc_purchase_pomanager1" name="已提交采购单" parent="purchase.menu_procurement_management" action="wait_acc_purchase_pomanger1" sequence="1"/>
<menuitem id="menu_wait_acc_purchase_boss1" name="需管理部审核采购单" parent="purchase.menu_procurement_management" action="wait_acc_purchase_boss1" sequence="1"/>
<menuitem id="menu_wait_acc_purchase_queren1" name="待确认采购单" parent="purchase.menu_procurement_management" action="wait_acc_purchase_manager1" sequence="1"/>
<record id="acc_purchase_form_action" model="ir.actions.act_window">
<field name="name">采购订单</field>
<field name="type">ir.actions.act_window</field>
<field name="res_model">purchase.order</field>
<field name="view_mode">tree,kanban,form,pivot,graph,calendar,activity</field>
<field name="domain">[('state','in',('purchase', 'done'))]</field>
<field name="search_view_id" ref="acc_purchase_order_search_view"/>
<field name="help" type="html">
<p class="o_view_nocontent_smiling_face">
Create a quotation
</p><p>
It will be converted into a purchase order.
</p>
</field>
</record>
<menuitem id="menu_acc_purchase_form_action" name="采购订单" parent="purchase.menu_procurement_management" action="acc_purchase_form_action" sequence="2"/>
<!--purchase模块-->
<record id="purchase_acc_form_view" model="ir.ui.view">
<field name="name">purchase.acc.form</field>
<field name="model">purchase.order</field>
<field name="inherit_id" ref="purchase.purchase_order_form"/>
<field name="arch" type="xml">
<!-- <xpath expr="/form/sheet/notebook/page/field/tree/field[@name='product_id']" position="attributes">
<attribute name="string">名称</attribute>
</xpath> -->
<xpath expr="/form/sheet/notebook/page/field/tree/field[@name='name']" position="attributes">
<attribute name="string">规格型号</attribute>
</xpath>
<xpath expr="/form/sheet/notebook/page/field/tree/field[@name='name']" position="after">
<field name="acc_code"/>
<field name="partner_code"/>
<field name="forcast_date"/>
<!-- <field name="f_date"/> -->
</xpath>
<!-- <xpath expr="/form/sheet/notebook/page/field/tree/field[@name='product_uom']" position="attributes">
<attribute name="string">单位</attribute>
</xpath> -->
<xpath expr="//field[@name='date_planned']" position="attributes">
<attribute name="invisible">1</attribute>
</xpath>
<xpath expr="/form/sheet/notebook/page/field/tree/field[@name='company_id']" position="attributes">
<attribute name="invisible">1</attribute>
</xpath>
<!-- <xpath expr="//field[@name='account_analytic_id']" position="attributes">
<attribute name="invisible">1</attribute>
</xpath> -->
</field>
</record>
<!-- 刷新采购单付款到货状态定时任务 -->
<data noupdate="1">
<record id="ir_cron_acc_fresh_po_state" model="ir.cron">
<field name="name">更新采购单付款到货状态</field>
<field name="interval_number">1</field>
<field name="interval_type">days</field>
<field name="numbercall">-1</field>
<field name="model_id" ref="model_purchase_order"/>
<field name="code">model._fresh_po_state()</field>
<field name="state">code</field>
<field eval="True" name="doall"/>
<!-- <field eval="'excipients.product'" name="model"/> -->
<!-- <field eval="'_check_need_purchase'" name="function"/> -->
<field eval="0" name="priority"/>
<field name="active" eval="True"/>
</record>
</data>
<!-- product.template搜索视图 -->
<!-- <record id="acc_product_template_search_view" model="ir.ui.view">
<field name="name">acc.product.template.search</field>
<field name="model">product.template</field>
<field name="mode">primary</field>
<field name="inherit_id" ref="product.product_template_search_view"/>
<field name="arch" type="xml">
<xpath expr="//filter[@name='inactive']" position="after">
<separator/>
<field name="brand" string="品牌" filter_domain="[('brand','ilike',self)]"/>
<field name="partner_id" string="供应商"/>
<field name="product_model" string="产品型号" filter_domain="[('product_model','ilike',self)]"/>
</xpath>
</field>
</record>
<record id="product_acc_action_puchased" model="ir.actions.act_window">
<field name="name">Products</field>
<field name="type">ir.actions.act_window</field>
<field name="res_model">product.template</field>
<field name="view_type">form</field>
<field name="view_mode">kanban,tree,form,activity</field>
<field name="context">{"search_default_filter_to_purchase":1, "purchase_product_template": 1}</field>
<field name="search_view_id" ref="acc_product_template_search_view"/>
<field name="view_id" eval="False"/>
<field name="help" type="html">
<p class="o_view_nocontent_smiling_face">
Create a new product
</p><p>
You must define a product for everything you purchase,
whether it's a physical product, a consumable or services.
</p>
</field>
</record>
<menuitem id="menu_purchase_acc_product_template" name="产品" parent="purchase.menu_procurement_management" action="product_acc_action_puchased" groups="purchase.group_purchase_user" sequence="100"/> -->
<record id="action_purchase_partner_other_form" model="ir.actions.act_window">
<field name="name">contacts</field>
<field name="type">ir.actions.act_window</field>
<field name="res_model">res.partner</field>
<field name="view_type">form</field>
<field name="view_mode">kanban,tree,form</field>
<!-- <field name="domain">[('supplier','!=',1),('customer','!=',1),('is_company','!=',1)]</field>
<field name="context">{'default_customer':0, 'default_customer':0, 'default_is_company': False, 'search_default_is_company':False,}</field> -->
<field name="domain">[('is_company','!=',1)]</field>
<field name="context">{'default_is_company': False, 'search_default_is_company':False,}</field>
<field name="filter" eval="True"/>
</record>
<!-- <menuitem id="menu_purchase_other_management" name="其他信息"
parent="purchase.menu_purchase_root" sequence="3" />
<menuitem id="menu_purchase_uom_form_action" name="计量单位" parent="menu_purchase_other_management" action="uom.product_uom_form_action" groups="purchase.group_purchase_user" sequence="50"/>
<menuitem id="menu_purchase_partner_other_form" name="联系人" parent="menu_purchase_other_management" action="action_purchase_partner_other_form" groups="purchase.group_purchase_user" sequence="49"/> -->
</data>
</openerp>