acc_sale_view.xml 27.8 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 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 467 468 469 470 471 472 473 474 475 476 477 478 479 480 481 482 483 484 485 486 487 488 489
<?xml version="1.0" encoding="utf-8"?>
<openerp>
    <data>
        <record id="view_order_form_inherit" model="ir.ui.view">
            <field name="name">sale.order.form.inherit</field>
            <field name="model">sale.order</field>
            <field name="inherit_id" ref="sale.view_order_form"/>
            <field name="arch" type="xml">
                <xpath expr="//button[@name='action_quotation_send'][1]" position="attributes">
                    <attribute name="invisible">1</attribute>
                </xpath>
                <xpath expr="//button[@name='action_quotation_send'][2]" position="attributes">
                    <attribute name="invisible">1</attribute>
                </xpath>
                <xpath expr="//button[@name='action_quotation_send'][3]" position="attributes">
                    <attribute name="invisible">1</attribute>
                </xpath>
                <xpath expr="//button[@name='action_quotation_send'][4]" 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='preview_sale_order']" position="attributes">
                    <attribute name="invisible">1</attribute>
                </xpath>
                <xpath expr="//button[@name='action_confirm'][1]" position="attributes">
                    <attribute name="invisible">1</attribute>
                </xpath>
                <xpath expr="//button[@name='action_confirm'][2]" position="attributes">
                    <attribute name="invisible">1</attribute>
                </xpath>
                <xpath expr="//button[@name='preview_sale_order']" position="after">
                    <!-- <button name="certain" string="确认合同" type="object" states="draft" class="oe_highlight" groups="base.group_user"/> -->
                    <button name="confirm" confirm='请确认仓库信息字段选择正确,需生产制造订单应选择"上海挚锦科技生产仓库(苏州)"!' string="提交审批" type="object" states="draft" class="oe_highlight" groups="base.group_user"/>
                    <!-- <button name="boss_accept" string="管理部审批" type="object" states="confirm" class="oe_highlight" groups="acct_base.acc_manage_info_group"/> -->
                    <button name="action_confirm" string="确认订单" type="object" class="oe_highlight" attrs="{'invisible': [('state', 'not in', ['confirm'])]}" groups="acct_base.acc_commerce_manager_group"/>
                    <button name="add_new_bom" confirm='是否确认进行物料清单变更!' states="sale" string="物料清单变更" type="object" groups="acct_base.acc_commerce_manager_group"/>   
                </xpath>
                <xpath expr="//field[@name='state']" position="attributes">
                    <attribute name="statusbar_visible">draft,confirm,sale</attribute>
                </xpath>
                <xpath expr="//field[@name='partner_id']" position="after" >
                    <field name="contact_id" context="{'sale_choose_contact':'sale_choose_contact','partner_id':partner_id}"/>
                    <field name="title"/>
                    <field name="user_id" string="负责人"/>
                    <field name="bomupdate_time"/>
                    <field name="transfer"/>
                    <field name="sale_commission"/>
                    <field name="in_country"/>
                    <field name="tax_id"/>
                    <field name="partner_ponumber"/>
                    <field name="transaction_mode"/>
                    <field name="transaction_rule"/>
                    <field name="delivery_time"/>
                    <field name="sale_company"/>
                    <field name="discount"/>
                    <!-- <field name="unovo_project_id" attrs="{'invisible': [('order_type', '!=', 'returns')]}" on_change="onchange_unovo_project_id(unovo_project_id, order_type)" options="{'no_create': True}"/> -->
                </xpath>
                <xpath expr="//field[@name='payment_term_id']" position="after">
                    <field name="is_makepo"/>
                    <field name="purchase_charge_person"/>
                    <field name="delivery_address"/>
                    <field name="warehouse_id"/>         
                    <field name="is_invoice"/>
                    <field name="is_purchasing"/>
                    <field name="purchase_date"/>
                    <field name="po_number"/>
                    <field name="before_purchase_id" readonly="1"/>
                    <field name="acc_quotation_id" readonly="1"/>
                    <field name="origin_sale_order_id"/>
                    <!-- <field name="is_send"/> -->
                    <field name="send_date"/>
                    <field name="is_pay"/>
                    <field name="send_status"/>
                    <field name="wait_change"/>
                    <!-- <field name="validity_date"/> -->
                </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="brand"/>
                </xpath>

                <xpath expr="/form/sheet/notebook/page[@name='order_lines']" position="after">
                    <page string="报价单明细">
                        <field name="quotation_line">
                            <tree string="报价单明细" editable="bottom">
                                <field name="product_id" options="{'no_create': True, 'no_open': True}"/>
                                <field name="acc_code"/>
                                <field name="product_model"/>
                                <field name="brand"/>                           
                                <field name="product_qty"/>
                                <field name="description"/>
                                <field name="price_unit"/>
                                <field name="product_uom"/>
                                <!-- <field name="taxes_id" widget="many2many_tags" domain="[('type_tax_use','!=','sale')]"/> -->
                                <field name="price_subtotal"/>
                            </tree>
                        </field>
                        <group class="oe_subtotal_footer oe_right">
                            <field name="quo_amount_untaxed" />
                            <field name="quo_amount_tax" />
                            <field name="discount"/>
                            <div class="oe_subtotal_footer_separator oe_inline">
                                <label for="quo_amount_total"/>
                            </div>
                            <field name="quo_amount_total" nolabel="1" class="oe_subtotal_footer_separator" />
                        </group>
                    </page>
                </xpath>
                <xpath expr="//field[@name='amount_tax']" position="after" >
                    <!-- <field name="discount" widget="monetary" options="{'currency_field': 'currency_id'}"/> -->
                    <field name="discount"/>
                </xpath>
                <xpath expr="/form/sheet/notebook/page[@name='order_lines']" position="after">
                    <page string="合同相关信息" name="acc_information">
                            <group>
                                <group string="合同相关信息" name="acc_information">
                                    <field name="origin_country"/>
                                    <field name="port_shipment"/>
                                    <field name="destination_port"/>
                                    <field name="destination_address"/>
                                    <field name="shipping_method"/>
                                </group>
                            </group>
                        </page>
                        <page string="物料清单记录">
                            <field name="bom_line">
                                <tree string="物料清单记录">
                                    <field name="mrp_bom_id"/>
                                    <field name="code"/>                            
                                    <field name="product_qty"/>
                                    <field name="gen_date"/>
                                    <field name="acc_type"/>
                                    <!-- <field name="is_active"/> -->
                                </tree>
                            </field>
                        </page>
                </xpath>                       
            </field>
        </record>

        <record id="acc_sale_order_tree_inherit" model="ir.ui.view">
            <field name="name">sale.order.tree.inherit</field>
            <field name="model">sale.order</field>
            <field name="inherit_id" ref="sale.view_order_tree"/>
            <field name="arch" type="xml">
                <xpath expr="//field[@name='amount_total']" position="after">
                    <field name="is_invoice"/>
                    <field name="send_status"/>   
                </xpath>
                <xpath expr="//field[@name='invoice_status']" position="attributes" >
                    <attribute name="invisible">1</attribute>
                </xpath>
            </field>
        </record>

        <record id="action_sale_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>

        <!-- 自定义报价单搜索视图 -->
        <record id="acc_sale_order_view_search_inherit_quotation" model="ir.ui.view">
            <field name="name">acc.sale.order.search.inherit.quotation</field>
            <field name="model">sale.order</field>
            <field name="mode">primary</field>
            <field name="inherit_id" ref="sale.view_sales_order_filter"/>
            <field name="arch" type="xml">
                <xpath expr="//filter[@name='my_sale_orders_filter']" position="replace">
                    <separator/>
                    <filter string="所有报价单" name="my_quotation" domain="[('state','=','draft')]"/>
                    <separator/>
                    <filter string="报价单" name="draft" domain="[('state','in',('draft', 'sent'))]"/>
                    <filter string="销售订单" name="sales" domain="[('state','in',('sale','done'))]"/>
                    <separator/>
                    <filter string="单据日期" name="filter_order_date" date="date_order"/>
                </xpath>
            </field>
        </record>

        <!-- 自定义报价单 -->
        <record id="action_acc_quotations" model="ir.actions.act_window">
            <field name="name">报价单</field>
            <field name="type">ir.actions.act_window</field>
            <field name="res_model">sale.order</field>
            <field name="view_mode">tree,kanban,form,calendar,pivot,graph,activity</field>
            <field name="help" type="html">
              <p class="o_view_nocontent_smiling_face">
                Create a new quotation, the first step of a new sale!
              </p><p>
                Once the quotation is confirmed by the customer, it becomes a sales order.<br/> You will be able to create an invoice and collect the payment.
              </p>
            </field>
        </record>

        <!-- <record id="action_acc_boss_order" model="ir.actions.act_window">
            <field name="name">待管理部审批销售单</field>
            <field name="type">ir.actions.act_window</field>
            <field name="res_model">sale.order</field>
            <field name="view_mode">tree,kanban,form,calendar,pivot,graph,activity</field>
            <field name="domain">[('state','=','confirm')]</field>
        </record> -->

        <record id="action_acc_manager_order" model="ir.actions.act_window">
            <field name="name">待提交销售订单</field>
            <field name="type">ir.actions.act_window</field>
            <field name="res_model">sale.order</field>
            <field name="view_mode">tree,kanban,form,calendar,pivot,graph,activity</field>
            <field name="domain">[('state','=','draft')]</field>
            <!-- <field name="search_view_id" ref="acc_sale_order_view_search_inherit_quotation"/> -->
            <!-- <field name="context">{'search_default_my_quotation': 1}</field> -->
        </record>

        <!-- <menuitem id="menu_acc_boss_sale_order"
                action="action_acc_boss_order"
                parent="sale.sale_order_menu"
                sequence="3" name="待管理部审批销售单"/> -->

        <menuitem id="menu_acc_manager_sale_order"
                action="action_acc_manager_order"
                parent="sale.sale_order_menu"
                sequence="0" name="待提交销售订单"/>

        <!-- <record id="action_acc_certain_order" model="ir.actions.act_window">
            <field name="name">已确认销售单</field>
            <field name="type">ir.actions.act_window</field>
            <field name="res_model">sale.order</field>
            <field name="view_mode">tree,kanban,form,calendar,pivot,graph,activity</field>
            <field name="domain">[('state','=','certain')]</field>
        </record>

        <menuitem id="menu_acc_certain_sale_order"
                action="action_acc_certain_order"
                parent="sale.sale_order_menu"
                sequence="0" name="已确认销售单"/> -->
        <record id="action_acc_change_sale_order" model="ir.actions.act_window">
            <field name="name">需变更销售订单</field>
            <field name="type">ir.actions.act_window</field>
            <field name="res_model">sale.order</field>
            <field name="view_mode">tree,kanban,form,calendar,pivot,graph,activity</field>
            <field name="domain">[('wait_change','=','no')]</field>
        </record>

        <menuitem id="menu_acc_change_sale_order"
                action="action_acc_change_sale_order"
                parent="sale.sale_order_menu"
                sequence="5" name="需变更销售订单"/>

        <record id="action_acc_confirm_order" model="ir.actions.act_window">
            <field name="name">待确认销售订单</field>
            <field name="type">ir.actions.act_window</field>
            <field name="res_model">sale.order</field>
            <field name="view_mode">tree,kanban,form,calendar,pivot,graph,activity</field>
            <field name="domain">[('state','=','confirm')]</field>
        </record>

        <menuitem id="menu_acc_confirm_sale_order"
                action="action_acc_confirm_order"
                parent="sale.sale_order_menu"
                sequence="1" name="待确认销售订单"/>

        <record id="action_acc_all_order" model="ir.actions.act_window">
            <field name="name">已完成销售订单</field>
            <field name="type">ir.actions.act_window</field>
            <field name="res_model">sale.order</field>
            <field name="view_mode">tree,kanban,form,calendar,pivot,graph,activity</field>
            <field name="domain">[('state','=','sale')]</field>
        </record>

        <menuitem id="menu_acc_all_sale_order"
                action="action_acc_all_order"
                parent="sale.sale_order_menu"
                sequence="4" name="已完成销售订单"/>

        <!-- <menuitem id="menu_acc_sale_quotations"
                action="action_acc_quotations"
                parent="sale.sale_order_menu"
                sequence="2" name="所有销售单" groups="sales_team.group_sale_salesman"/> -->


        <!-- 挚锦报价单 -->
        <record model="ir.ui.view" id="acc_quotation_form">
            <field name="name">Acc Quotation</field>
            <field name="model">acc.quotation</field>
            <field name="arch" type="xml">
                <form string="Acc Quotation" version="12.0">
                    <header>
                        <!-- <button name="draft_button" states="draft" string="提交审批" type="object" groups="purchase.group_purchase_user"/> -->
                        <button name="create_so" confirm='是否确认生成销售单!' attrs="{'invisible': [('is_createso', '=', True)]}" string="创建销售单" type="object"/>
                        <!-- <button name="draft_sent" states="sent" string="设为草稿" type="object"/> -->
                        <button name="certain" states="draft,sent" string="确认报价单" type="object"/>
                        <button name="cancel_draft" states="cancel" string="设为草稿" type="object"/>
                        <button name="sent" confirm='是否发送报价短信给客户!' states="draft" string="短信通知客户" type="object"/>
                        <button name="cancel" confirm='是否取消报价单!' states="sent" string="取消" type="object"/>
                        <!-- <button name='make_acccode' type='object' string='test'/> -->
                        <field name="state" widget="statusbar" statusbar_visible="draft,sent,done,cancel" statusbar_colors='{"draft":"red"}'/>
                    </header>
                    <sheet>
                        <div class="oe_title">
                            <h1><field name="name"/></h1>
                        </div>
                        <group>
                            <group>
                                <field name="partner_id"/>
                                <field name="contact_id" context="{'sale_choose_contact':'sale_choose_contact','partner_id':partner_id}"/>
                                <field name="customer_state" />
                                <field name="pricelist_id" />
                                <field name="currency_id"/>
                                <field name="tax_id"/>
                                <!-- <field name="purchase_type" /> -->
                                <field name="title"/>
                                <field name="gen_date"/>
                                <field name="last_date"/>
                                <field name="user_id"/>
                                <field name="transfer"/>
                                <field name="delivery_time"/>
                                <field name="crm_lead_id"/>
                            </group>
                            <group>
                                <field name="sale_commission" />
                                <field name="in_country" />
                                <field name="purchase_charge_person" />
                                <field name="transaction_mode"/>
                                <field name="transaction_rule"/>
                                <field name="sale_company" />
                                <field name="sale_order"/>
                                <field name="is_createso"/>
                                <field name="discount" />
                                <field name="ship_fee"/>
                                <!-- <field name="transaction_rule"/> -->
                            </group>
                        </group>
                        <notebook colspan="4">
                            <page string="挚锦报价单明细">
                                <field name="accquotation_line">
                                    <tree string="挚锦报价单明细" editable="bottom">
                                        <field name="product_id" options="{'no_create': True, 'no_open': True}"/>
                                        <field name="acc_code"/>
                                        <field name="product_model"/>
                                        <field name="brand"/>
                                        <field name="product_qty"/>
                                        <field name="description"/>
                                        <field name="price_unit"/>
                                        <field name="product_uom"/>
                                        <!-- <field name="taxes_id" widget="many2many_tags" domain="[('type_tax_use','!=','sale')]"/> -->
                                        <field name="price_subtotal"/>
                                    </tree>
                                </field>

                                <group class="oe_subtotal_footer oe_right" groups="purchase.group_purchase_user">
                                    <field name="amount_untaxed" widget="monetary" options="{'currency_field': 'currency_id'}"/>
                                    <field name="amount_tax" widget="monetary" options="{'currency_field': 'currency_id'}"/>
                                    <field name="discount" widget="monetary" options="{'currency_field': 'currency_id'}"/>
                                    <div class="oe_subtotal_footer_separator oe_inline">
                                        <label for="amount_total"/>
                                    </div>
                                    <field name="amount_total" nolabel="1" widget="monetary" options="{'currency_field': 'currency_id'}" class="oe_subtotal_footer_separator" />
                                </group>

                            </page>
                            <page string="合同相关信息" name="quo_information">
                                <group>
                                    <group string="合同相关信息" name="quo_information">
                                        <field name="origin_country"/>
                                        <field name="port_shipment"/>
                                        <field name="destination_port"/>
                                        <field name="destination_address"/>
                                        <field name="shipping_method"/>
                                    </group>
                                </group>
                            </page>
                            <page string="挚锦报价单日志">
                                <field name="log_line">
                                    <tree string="挚锦报价单日志">
                                        <field name="user_id"/>
                                        <field name="gen_date"/>                        
                                        <field name="amount_total"/>
                                    </tree>
                                </field>
                            </page>
                        </notebook>
                    </sheet>
                    <div class="oe_chatter">
                        <field name="message_follower_ids" widget="mail_followers"/>
                        <field name="message_ids" widget="mail_thread"/>
                    </div>
                </form>
            </field>
        </record>

        <record model="ir.ui.view" id="acc_quotation_tree">
            <field name="name">Acc Quotation</field>
            <field name="model">acc.quotation</field>
            <field name="arch" type="xml">
                <!-- <tree colors="grey:state == 'done'" string="Demand Purchase"> -->
                <tree string="Acc Quotation">
                    <field name="name"/>
                    <field name="partner_id"/>
                    <field name="title" />
                    <field name="user_id"/>
                    <field name="gen_date"/>
                    <field name="sale_order"/>
                    <field name="customer_state"/>
                    <field name="state"/>
                </tree>
            </field>
        </record>

        <record model="ir.actions.act_window" id="action_acc_quotation1">
            <field name="name">挚锦报价单</field>
            <field name="type">ir.actions.act_window</field>
            <field name="res_model">acc.quotation</field>
            <field name="view_type">form</field>
            <field name="view_mode">tree,form</field>
            <!-- <field name="search_view_id" ref="demand_purchase_search"/> -->
            <field name="domain">[]</field>
            <field name="context">{}</field>
        </record>

        <record id="sale_action_acc_quotations_new" model="ir.actions.act_window">
            <field name="name">挚锦报价单</field>
            <field name="res_model">acc.quotation</field>
            <field name="view_mode">form,tree</field>
            <field name="domain">[('crm_lead_id', '=', active_id)]</field>
            <field name="context">{'search_default_crm_lead_id': active_id, 'default_crm_lead_id': active_id}</field>
        </record>

        <!-- 刷新销售单到货状态定时任务 -->
        <data noupdate="1">
            <record id="ir_cron_acc_fresh_so_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_sale_order"/>
                <field name="code">model._fresh_so_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>

        <!-- <menuitem id="menu_acc_sale_quotations"
                action="action_acc_quotations"
                parent="sale.sale_order_menu"
                sequence="2" name="所有销售单" groups="sales_team.group_sale_salesman"/> -->
        <!-- <menuitem id="menu_acc_boss_sale_order"
                action="action_acc_quotations"
                parent="sale.sale_order_menu"
                sequence="1" name="所有销售单" groups="sales_team.group_sale_salesman"/> -->

        <!-- <menuitem id="menu_crm_acc_sale_quotations"
                action="action_acc_quotations"
                parent="crm.crm_menu_sales"
                sequence="1" name="报价单" groups="sales_team.group_sale_salesman"/> -->

        <menuitem id="menu_zhijing_acc_sale_quotation"
                action="action_acc_quotation1"
                parent="sale.sale_order_menu"
                sequence="0" name="报价单" groups="acct_base.acc_commerce_level_group"/>

        <menuitem id="menu_sale_other_management" name="其他信息"
            parent="sale.sale_menu_root" sequence="60" />

        <!-- <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_sale_partner_other_form" name="联系人" parent="menu_sale_other_management" action="action_sale_partner_other_form" groups="sales_team.group_sale_salesman" sequence="10"/> -->

    </data>
</openerp>