diff options
Diffstat (limited to 'indoteknik_custom/views/sourcing.xml')
| -rw-r--r-- | indoteknik_custom/views/sourcing.xml | 802 |
1 files changed, 802 insertions, 0 deletions
diff --git a/indoteknik_custom/views/sourcing.xml b/indoteknik_custom/views/sourcing.xml new file mode 100644 index 00000000..cd1de5a4 --- /dev/null +++ b/indoteknik_custom/views/sourcing.xml @@ -0,0 +1,802 @@ +<?xml version="1.0" encoding="UTF-8"?> +<odoo> + <!-- Sales View --> + <record id="view_sourcing_job_order_search" model="ir.ui.view"> + <field name="name">sourcing.job.order.search</field> + <field name="model">sourcing.job.order</field> + <field name="arch" type="xml"> + <search string="Search Sourcing Job Order"> + <field name="state" string="Status"/> + <filter name="done" + string="Complete" + domain="[('state', '=', 'done')]" /> + <filter name="by_create_uid" + string="My Activity" + domain="[('create_uid', '=', uid)]"/> + </search> + </field> + </record> + + <record id="view_wizard_export_sjo_to_so_form" model="ir.ui.view"> + <field name="name">wizard.export.sjo.to.so.form</field> + <field name="model">wizard.export.sjo.to.so</field> + <field name="arch" type="xml"> + <form string="Export Products to SO"> + <group> + <field name="sjo_id" readonly="1"/> + <field name="line_ids" widget="many2many_tags" invisible="1"/> + <field name="product_ids" widget="many2many_tags" options="{'no_create': True}"/> + </group> + + <footer> + <button name="action_confirm" + string="Export to SO" + type="object" + class="btn-primary"/> + + <button string="Cancel" + class="btn-secondary" + special="cancel"/> + </footer> + </form> + </field> + </record> + + <record id="view_reopen_cancel_line_wizard" model="ir.ui.view"> + <field name="name">reopen.cancel.line.wizard.form</field> + <field name="model">reopen.cancel.line.wizard</field> + <field name="arch" type="xml"> + <form string="Reason Reopen"> + <group> + <field name="reason" placeholder="Alasan kenapa mau direopen..."/> + </group> + <footer> + <button name="action_confirm" + type="object" + string="Confirm Reopen" + class="btn-primary"/> + <button string="Cancel" special="cancel"/> + </footer> + </form> + </field> + </record> + + <record id="view_sourcing_job_order_tree" model="ir.ui.view"> + <field name="name">sourcing.job.order.tree</field> + <field name="model">sourcing.job.order</field> + <field name="arch" type="xml"> + <tree string="Sourcing Job Orders" create="0" + decoration-success="state=='done'" + decoration-info="state=='partial'" + decoration-danger="state=='cancel'" + decoration-warning="state=='taken'"> + <field name="is_priority" optional="hide" readonly="1"/> + <field name="name"/> + <field name="eta_sales" optional="hide"/> + <field name="eta_complete" optional="hide"/> + <!-- <field name="leads_id"/> --> + <field name="create_uid" widget="many2one_avatar_user"/> + <field name="md_user_id" widget="many2many_tags"/> + <field name="state" widget="badge"/> + <field name="create_date"/> + <field name="progress_status" + decoration-info="progress_status in ['🟡 On Track', '🔵 Ontime']" + decoration-success="'🟢' in progress_status" + decoration-danger="'🔴' in progress_status" + decoration-muted="'⚫' in progress_status"/> + </tree> + </field> + </record> + + <record id="view_sourcing_job_order_form" model="ir.ui.view"> + <field name="name">sourcing.job.order.form</field> + <field name="model">sourcing.job.order</field> + <field name="arch" type="xml"> + <form string="Sourcing Job Order" create="0"> + <header> + <button name="action_cancel" + string="Cancel" + type="object" + class="btn-secondary" + icon="fa-times" + groups="indoteknik_custom.group_role_merchandiser" + attrs="{'invisible': [('state', 'in', ['cancel', 'done'])]}"/> + + <field name="state" widget="statusbar" + statusbar_visible="draft,taken,partial,done,cancel" attrs="{'invisible': [('state', '!=', 'cancel')]}"/> + + <field name="state" widget="statusbar" + statusbar_visible="draft,taken,partial,done" attrs="{'invisible': [('state', '=', 'cancel')]}"/> + </header> + + <sheet> + <div class="oe_button_box" name="button_box"> + <button name="action_open_converted_products" + type="object" + class="oe_stat_button" + icon="fa-cubes" + attrs="{'invisible': [('converted_product_count', '=', 0)]}"> + <field name="converted_product_count" widget="statinfo" string="Products"/> + </button> + </div> + <widget name="web_ribbon" + title="COMPLETE" + bg_color="bg-success" + attrs="{'invisible': [('state', '!=', 'done')]}"/> + + <widget name="web_ribbon" + title="CANCEL" + bg_color="bg-danger" + attrs="{'invisible': [('state', '!=', 'cancel')]}"/> + <h1> + <field name="name" readonly="1"/> + </h1> + + <group> + <group> + <!-- <field name="leads_id" readonly="1"/> --> + <field name="eta_sales"/> + <field name="eta_complete" readonly="1"/> + <field name="has_price_in_lines" invisible="1"/> + <field name="so_id"/> + </group> + <group> + <field name="create_uid" readonly="1" widget="many2one_avatar_user"/> + <field name="md_user_id" widget="many2many_tags"/> + <field name="approval_sales" readonly="1"/> + <field name="progress_status" + decoration-info="progress_status in ['🟡 On Track', '🔵 Ontime']" + decoration-success="'🟢' in progress_status" + decoration-danger="'🔴' in progress_status" + decoration-muted="'⚫' in progress_status"/> + </group> + </group> + + <notebook> + <page string="Product Line" groups="indoteknik_custom.group_role_sales" + attrs="{'invisible': [('has_price_in_lines', '=', True)]}"> + <field name="line_sales_input_ids" attrs="{'readonly': [('state', '!=', 'draft')]}"> + <tree> + <field name="brand"/> + <field name="product_name"/> + <field name="descriptions"/> + <field name="quantity"/> + <field name="md_person_ids" widget="many2one_avatar_user"/> + <field name="state" readonly="1" widget="badge" + decoration-warning="state == 'sourcing'" + decoration-info="state == 'sent'" + decoration-success="state == 'approve'" + decoration-danger="state == 'cancel'"/> + <field name="note" optional="hide"/> + <field name="budget" optional="hide"/> + </tree> + <form string="Product Line"> + <group> + <field name="brand" required="1"/> + <small style="margin-top:-1.4rem; display:block;">*Masukkan merek produk. Jika tidak diketahui, dapat diisi dengan "No Brand".</small> + + <field name="product_name" required="1"/> + <small style="margin-top:-1.4rem; display:block;">*Isi nama produk secara jelas untuk mempermudah proses identifikasi saat sourcing.</small> + + <field name="descriptions" required="1"/> + + <field name="quantity"/> + <small style="margin-top:-1.4rem; display:block;">*Jumlah unit produk yang dibutuhkan.</small> + + <field name="note"/> + <small style="margin-top:-1.4rem; display:block;">*Catatan tambahan yang dapat membantu proses sourcing.</small> + + <field name="budget"/> + <small style="margin-top:-1.4rem; display:block;">*Perkiraan atau batas anggaran harga yang diharapkan.</small> + + <field name="attachment_type"/> + <small style="margin-top:-1.4rem; display:block;">*Lampiran referensi seperti gambar produk, katalog, atau dokumen spesifikasi yang mendukung proses sourcing.</small> + + <field name="product_attachment_pdf" + filename="product_attachment_filename" + attrs="{'invisible':[('attachment_type','!=','pdf')]}"/> + + <field name="product_attachment_img" + filename="product_attachment_filename" + widget="image" + attrs="{'invisible':[('attachment_type','!=','img')]}"/> + + <field name="product_attachment_other" + filename="product_attachment_filename" + attrs="{'invisible':[('attachment_type','!=','other')]}"/> + </group> + </form> + </field> + </page> + + <!-- MD EDIT --> + <!-- <page string="MD Lines" groups="indoteknik_custom.group_role_merchandiser"> + <field name="line_md_edit_ids"> + <tree + decoration-success="state in ('done', 'convert')" + decoration-danger="state=='cancel'" + decoration-warning="state=='sourcing'"> + <field name="selected" widget="boolean_toggle"/> + <field name="code"/> + <field name="brand"/> + <field name="product_name"/> + <field name="descriptions"/> + <field name="quantity"/> + <field name="price"/> + <field name="vendor_id"/> + <field name="tax_id"/> + <field name="subtotal"/> + <field name="state"/> + <field name="sla"/> + <button name="action_convert_to_product" + string="Convert" + type="object" + icon="fa-exchange" + attrs="{'invisible': [('state', '!=', 'done')]}"/> + <button name="action_cancel_line" + string="Unavailable" + type="object" + class="btn-danger" + groups="indoteknik_custom.group_role_merchandiser" + attrs="{'invisible': [('state', '=', 'cancel')]}"/> + </tree> + <form string="MD Line"> + <group> + <group> + <field name="code"/> + <field name="brand"/> + <field name="product_name"/> + <field name="descriptions"/> + <field name="quantity"/> + <field name="price"/> + <field name="vendor_id"/> + <field name="tax_id"/> + <field name="subtotal" readonly="1"/> + <field name="sla"/> + </group> + <group> + <field name="product_category"/> + <field name="product_type"/> + <field name="product_class" widget="many2many_tags"/> + <field name="note"/> + <field name="budget"/> + <field name="product_image" widget="image"/> + <field name="state" readonly="1" force_save="1"/> + <field name="reason" attrs="{'invisible': [('state', 'in', ['cancel', 'done', 'convert'])]}"/> + </group> + </group> + </form> + </field> + </page> --> + + <!-- SALES VIEW --> + <page string="Product Line" groups="indoteknik_custom.group_role_sales" attrs="{'invisible': [('has_price_in_lines', '=', False)]}"> + <field name="line_sales_view_ids"> + <tree create="0" delete="0" + decoration-warning="state == 'sourcing'" + decoration-info="state == 'sent'" + decoration-success="state == 'approve'" + decoration-danger="state == 'cancel'"> + <button name="action_reopen_cancel" + type="object" + string="Reopen" + class="btn-warning" + attrs="{ + 'invisible': [ + ('state','!=','cancel'), + ] + }"/> + + <field name="product_id" readonly="1"/> + <field name="code" readonly="1"/> + <field name="brand" readonly="1"/> + <field name="product_name" readonly="1"/> + <field name="descriptions" readonly="1"/> + <field name="quantity" readonly="1"/> + <field name="price" readonly="1"/> + <field name="vendor_id" readonly="1"/> + <field name="tax_id" readonly="1"/> + <field name="subtotal" readonly="1"/> + <field name="state" readonly="1" widget="badge" + decoration-warning="state in ('sourcing','sent')" + decoration-info="state == 'approve'" + decoration-success="state == 'done'" + decoration-danger="state == 'cancel'"/> + </tree> + </field> + </page> + + <page string="Cancel Reason" attrs="{'invisible': [('state', 'in', ['done'])]}"> + <group> + <field name="cancel_reason"/> + </group> + </page> + </notebook> + </sheet> + <div class="oe_chatter"> + <field name="message_follower_ids" widget="mail_followers"/> + <field name="message_ids" widget="mail_thread"/> + <field name="activity_ids" widget="mail_activity"/> + </div> + </form> + </field> + </record> + + <record id="action_wizard_export_sjo_to_so" model="ir.actions.act_window"> + <field name="name">Export Products to SO</field> + <field name="res_model">wizard.export.sjo.to.so</field> + <field name="view_mode">form</field> + <field name="view_id" ref="view_wizard_export_sjo_to_so_form"/> + <field name="target">new</field> + <field name="context">{'default_sjo_id': active_id}</field> + </record> + + <record id="action_sourcing_job_order_sales" model="ir.actions.act_window"> + <field name="name">Sourcing Job Orders</field> + <field name="res_model">sourcing.job.order</field> + <field name="view_mode">tree,form</field> + <field name="search_view_id" ref="view_sourcing_job_order_search"/> + <field name="context">{'search_default_by_create_uid': 1}</field> + <field name="groups_id" eval="[(4, ref('indoteknik_custom.group_role_sales'))]"/> + </record> + + <menuitem id="menu_sourcing_job_order_sales" + name="Sourcing Job Orders" + parent="indoteknik_custom.menu_monitoring_in_sale" + action="action_sourcing_job_order_sales" + groups="indoteknik_custom.group_role_sales" + sequence="102"/> + + <!-- MD Views --> + <record id="view_sourcing_job_order_line_search" model="ir.ui.view"> + <field name="name">sourcing.job.order_line.search</field> + <field name="model">sourcing.job.order.line</field> + <field name="arch" type="xml"> + <search string="Search MD Job"> + <field name="state" string="Status"/> + <filter name="untaken" + string="Untaken" + domain="[('state', '=', 'draft')]" /> + <filter name="my_job" + string="My Job" + domain="[('md_person_ids', '=', uid), ('state', '=', 'sourcing')]"/> + </search> + </field> + </record> + + <record id="view_sjo_template_wizard" model="ir.ui.view"> + <field name="name">sjo.template.wizard.form</field> + <field name="model">sourcing.job.order.line.template.wizard</field> + <field name="arch" type="xml"> + <form string="Import Sourcing Job Order Line"> + <group string="Download Template"> + <field name="file" filename="filename" readonly="1"/> + <field name="filename" invisible="1"/> + + <button name="action_generate_template" + string="Download Template" + type="object" + class="btn-secondary"/> + </group> + + <separator string="Import Excel"/> + + <group> + <field name="order_id" required="1"/> + <field name="excel_file" filename="excel_filename"/> + <field name="excel_filename" invisible="1"/> + </group> + + <footer> + <button name="action_import_excel" + string="Import" + type="object" + class="btn-primary"/> + + <button string="Close" special="cancel"/> + </footer> + + </form> + </field> + </record> + + <record id="action_import_sjo_line_server" model="ir.actions.server"> + <field name="name">Import Line</field> + <field name="model_id" ref="model_sourcing_job_order_line"/> + <field name="binding_model_id" ref="model_sourcing_job_order_line"/> + <field name="binding_view_types">list</field> + <field name="state">code</field> + + <field name="code"> + action = { + 'type': 'ir.actions.act_window', + 'name': 'Import SJO Line', + 'res_model': 'sourcing.job.order.line.template.wizard', + 'view_mode': 'form', + 'target': 'new', + 'context': {'default_order_id': env.context.get('active_id')} + } + </field> + </record> + + <record id="view_sourcing_job_order_line_tree" model="ir.ui.view"> + <field name="name">sourcing.job.order.line.tree</field> + <field name="model">sourcing.job.order.line</field> + <field name="arch" type="xml"> + <tree string="Sourcing Job Order" + decoration-warning="state=='sourcing'" + decoration-success="state== 'approve'" + decoration-danger="state=='cancel'" + decoration-info="state == 'sent'"> + <field name="order_id" /> + <field name="md_person_ids" widget="many2one_avatar_user"/> + <field name="show_salesperson" widget="many2one_avatar_user"/> + <field name="brand"/> + <field name="product_name"/> + <field name="quantity"/> + <field name="subtotal"/> + <field name="descriptions"/> + <field name="attachment_type" /> + <field name="state" widget="badge" + decoration-muted="state=='draft'" + decoration-warning="state=='sourcing'" + decoration-success="state== 'approve'" + decoration-danger="state=='cancel'"/> + <field name="budget" optional="hide"/> + <field name="note" optional="hide"/> + </tree> + </field> + </record> + + <record id="view_reject_sourcing_wizard" model="ir.ui.view"> + <field name="name">reject.sourcing.wizard.form</field> + <field name="model">sourcing.reject.wizard</field> + <field name="arch" type="xml"> + <form string="Alasan Reject"> + <group> + <field name="reason" placeholder="Isi alasan reject..."/> + </group> + <footer> + <button name="action_confirm_reject" + type="object" + string="Confirm Reject" + class="btn-primary"/> + <button string="Cancel" special="cancel"/> + </footer> + </form> + </field> + </record> + + <record id="view_sjo_give_wizard_form" model="ir.ui.view"> + <field name="name">sjo.give.wizard.form</field> + <field name="model">sjo.give.wizard</field> + <field name="arch" type="xml"> + <form string="Give SJO Line"> + <group> + <field name="md_id"/> + </group> + <footer> + <button string="Confirm" + type="object" + name="action_confirm" + class="btn-primary"/> + <button string="Cancel" + special="cancel" + class="btn-secondary"/> + </footer> + </form> + </field> + </record> + + <record id="view_sjo_reject_give_wizard_form" model="ir.ui.view"> + <field name="name">sjo.reject.give.wizard.form</field> + <field name="model">sjo.reject.give.wizard</field> + <field name="arch" type="xml"> + <form string="Reject SJO Line"> + <group> + <field name="reason" placeholder="Alasan reject..."/> + </group> + <footer> + <button name="action_confirm" + string="Confirm Reject" + type="object" + class="btn-danger"/> + <button string="Cancel" + class="btn-secondary" + special="cancel"/> + </footer> + </form> + </field> + </record> + + <record id="view_sourcing_job_order_line_form" model="ir.ui.view"> + <field name="name">sourcing.job.order.line.form</field> + <field name="model">sourcing.job.order.line</field> + <field name="arch" type="xml"> + <form string="Sourcing Job" create="0"> + <header> + <button name="action_take" + string="Take" + type="object" + class="btn-primary" + icon="fa-hand-paper-o" + attrs="{'invisible': [('state', '!=', 'draft')]}"/> + + <button name="action_cancel" + string="Cancel" + type="object" + class="btn-secondary" + icon="fa-times" + groups="indoteknik_custom.group_role_merchandiser" + attrs="{'invisible': [('state', 'in', ['cancel', 'approve'])]}"/> + + <button name="action_ask_approval" + string="Ask Approval" + type="object" + groups="indoteknik_custom.group_role_merchandiser" + attrs="{'invisible': [('state', '!=', 'sourcing')]}"/> + + <button name="action_reject_approval" + string="Reject" + type="object" + groups="indoteknik_custom.group_role_sales" + attrs="{'invisible': [('state', '!=', 'sent')]}"/> + + <button name="action_approve_approval" + string="Approve" + class="btn-primary" + type="object" + groups="indoteknik_custom.group_role_sales" + attrs="{'invisible': [('state', '!=', 'sent')]}"/> + + <button name="action_open_give_wizard" + type="object" + string="Give to Other" + class="btn-primary" + attrs="{'invisible': ['|', '|', ('state', '!=', 'sourcing'), ('is_md_person', '=', False), ('is_given', '=', True)]}"/> + + <button name="action_take_given" + type="object" + string="Take" + class="btn-primary" + attrs="{'invisible': ['|', + ('is_given','=',False), + ('is_receiver','=',False) + ]}"/> + + <button name="action_open_reject_given_wizard" + type="object" + string="Reject" + attrs="{'invisible': ['|', + ('is_given','=',False), + ('is_receiver','=',False) + ]}"/> + + <field name="state" widget="statusbar" + statusbar_visible="draft,sourcing,sent,approve,cancel" attrs="{'invisible': [('state', '!=', 'cancel')]}"/> + + <field name="state" widget="statusbar" + statusbar_visible="draft,sourcing,sent,approve" attrs="{'invisible': [('state', '=', 'cancel')]}"/> + </header> + <sheet > + <widget name="web_ribbon" + title="COMPLETE" + bg_color="bg-success" + attrs="{'invisible': [('state', '!=', 'approve')]}"/> + + <widget name="web_ribbon" + title="CANCEL" + bg_color="bg-danger" + attrs="{'invisible': [('state', '!=', 'cancel')]}"/> + <h1> + <field name="order_id" readonly="1"/> + </h1> + <group col="2"> + <group> + <separator string="MD Edit"/> + <field name="is_md_person" invisible="1"/> + <field name="is_given" invisible="1"/> + <field name="is_receiver" invisible="1"/> + <field name="md_person_ids" widget="many2one_avatar_user" readonly="1"/> + <field name="brand_id" attrs="{'readonly': [('state', 'in', ['sent', 'cancel', 'approve'])]}"/> + <field name="product_id" attrs="{'readonly': [('state', 'in', ['sent', 'cancel', 'approve'])]}"/> + <field name="descriptions_md" attrs="{'readonly': [('state', 'in', ['sent', 'cancel', 'approve'])]}"/> + <field name="code" attrs="{'readonly': [('state', 'in', ['sent', 'cancel', 'approve'])]}"/> + <field name="product_name_md" attrs="{'readonly': [('state', 'in', ['sent', 'cancel', 'approve'])]}"/> + <field name="price" required="1" attrs="{'readonly': [('state', 'in', ['sent', 'cancel', 'approve'])]}"/> + <field name="now_price" force_save="1" readonly="1"/> + <field name="last_updated_price" force_save="1"/> + <field name="vendor_id" attrs="{'readonly': [('state', 'in', ['sent', 'cancel', 'approve'])]}"/> + <field name="tax_id" attrs="{'readonly': [('state', 'in', ['sent', 'cancel', 'approve'])]}"/> + <field name="subtotal" readonly="1" attrs="{'readonly': [('state', 'in', ['sent', 'cancel', 'approve'])]}"/> + <field name="product_category" attrs="{'readonly': [('state', 'in', ['sent', 'cancel', 'approve'])]}"/> + <field name="product_type" attrs="{'readonly': [('state', 'in', ['sent', 'cancel', 'approve'])]}"/> + <field name="product_class" widget="many2many_tags" attrs="{'readonly': [('state', 'in', ['sent', 'cancel', 'approve'])]}"/> + </group> + + <group> + <separator string="Sales Input"/> + <field name="create_uid" widget="many2one_avatar_user" readonly="1"/> + <field name="show_salesperson" widget="many2one_avatar_user" readonly="1"/> + <field name="so_id"/> + <field name="so_state" widget="badge" readonly="1" + decoration-success="so_state == 'sale'" + decoration-info="so_state == 'draft'" + decoration-danger="so_state == 'cancel'"/> + <field name="brand" readonly="1"/> + <field name="product_name" readonly="1"/> + <field name="descriptions" readonly="1"/> + <field name="quantity" readonly="1"/> + <field name="sla" readonly="1"/> + <field name="note" readonly="1"/> + <field name="budget" readonly="1"/> + <field name="attachment_type" readonly="1"/> + + <field name="product_attachment_pdf" + filename="product_attachment_filename" + widget="pdf_viewer" + attrs="{'invisible':[('attachment_type','!=','pdf')]}"/> + + <field name="product_attachment_img" + filename="product_attachment_filename" + widget="image" + attrs="{'invisible':[('attachment_type','!=','img')]}"/> + + <field name="product_attachment_other" + filename="product_attachment_filename" + attrs="{'invisible':[('attachment_type','!=','other')]}"/> + </group> + </group> + <notebook> + <page string="Cancel Reason" attrs="{'invisible': [('state', 'in', ['approve'])]}"> + <group> + <field name="reason" attrs="{'readonly': [('state', 'in', ['sent', 'cancel', 'approve'])]}"/> + </group> + </page> + </notebook> + </sheet> + <div class="oe_chatter"> + <field name="message_follower_ids" widget="mail_followers"/> + <field name="message_ids" widget="mail_thread"/> + <field name="activity_ids" widget="mail_activity"/> + </div> + </form> + </field> + </record> + + <record id="action_sourcing_job_order_line_multi_take" model="ir.actions.server"> + <field name="name">Take Selected Jobs</field> + <field name="model_id" ref="model_sourcing_job_order_line"/> + <field name="binding_model_id" ref="model_sourcing_job_order_line"/> + <field name="binding_type">action</field> + <field name="state">code</field> + <field name="code">action = records.action_multi_take()</field> + <field name="groups_id" eval="[(4, ref('indoteknik_custom.group_role_merchandiser'))]"/> + </record> + + <record id="action_sourcing_job_order_md" model="ir.actions.act_window"> + <field name="name">Sourcing Job Orders</field> + <field name="res_model">sourcing.job.order.line</field> + <field name="view_mode">tree,form</field> + <field name="search_view_id" ref="view_sourcing_job_order_line_search"/> + <field name="context">{ + 'search_default_untaken': 1, + 'search_default_my_job': 1, + 'order': "CASE state WHEN 'draft' THEN 1 WHEN 'sourcing' THEN 2 WHEN 'sent' THEN 3 WHEN 'approve' THEN 4 WHEN 'cancel' THEN 5 END, id desc" + } + </field> + <field name="groups_id" eval="[(4, ref('indoteknik_custom.group_role_merchandiser'))]"/> + </record> + + <menuitem id="menu_md_root" + name="MD" + parent="crm.crm_menu_root" + sequence="80"/> + + <menuitem id="menu_sourcing_job_order_md" + name="Sourcing Job" + parent="indoteknik_custom.menu_monitoring_in_sale" + action="action_sourcing_job_order_md" + groups="indoteknik_custom.group_role_merchandiser" + sequence="91"/> + + <!-- Approval Per line sales --> + <record id="view_sjo_line_approval_search" model="ir.ui.view"> + <field name="name">sourcing.job.order.line.approval.search</field> + <field name="model">sourcing.job.order.line</field> + <field name="arch" type="xml"> + <search string="Search Sourcing Approval"> + + <field name="product_name"/> + <field name="brand"/> + <field name="so_id"/> + <field name="show_salesperson"/> + + <filter name="filter_sent" + string="Sent" + domain="[('state','=','sent')]"/> + + <group expand="0" string="Group By"> + <filter name="group_so" + string="Sales Order" + context="{'group_by':'so_id'}"/> + </group> + + <filter name="filter_my_line" + string="My Line" + domain="[('show_salesperson','=',uid)]"/> + + </search> + </field> + </record> + + <record id="view_sjo_line_approval_tree" model="ir.ui.view"> + <field name="name">sourcing.job.order.line.approval.tree</field> + <field name="model">sourcing.job.order.line</field> + <field name="arch" type="xml"> + <tree string="Approval Sourcing Line" + create="0" + edit="0" + delete="0" + decoration-warning="state in ('sourcing','sent')" + decoration-success="state == 'approve'" + decoration-danger="state == 'cancel'"> + <field name="order_id"/> + <field name="md_person_ids" widget="many2one_avatar_user" readonly="1"/> + <field name="so_id"/> + <field name="show_salesperson" widget="many2one_avatar_user"/> + <field name="so_state" widget="badge" + decoration-success="so_state == 'sale'" + decoration-info="so_state == 'draft'" + decoration-danger="so_state == 'cancel'"/> + <field name="code"/> + <field name="brand"/> + <field name="product_name"/> + <field name="quantity"/> + <field name="price"/> + <field name="vendor_id"/> + <field name="subtotal"/> + + <field name="state" + widget="badge" + decoration-warning="state in ('sourcing','sent')" + decoration-success="state == 'approve'" + decoration-danger="state == 'cancel'"/> + </tree> + </field> + </record> + + <record id="action_multi_approve_sjo_line" model="ir.actions.server"> + <field name="name">Approve Selected Lines</field> + <field name="model_id" ref="model_sourcing_job_order_line"/> + <field name="binding_model_id" ref="model_sourcing_job_order_line"/> + <field name="binding_view_types">list</field> + <field name="state">code</field> + <field name="groups_id" eval="[(4, ref('indoteknik_custom.group_role_sales'))]"/> + <field name="code"> + records.action_multi_approve() + </field> + </record> + + <record id="action_sourcing_line_approval" model="ir.actions.act_window"> + <field name="name">Approval Sourcing Line</field> + <field name="res_model">sourcing.job.order.line</field> + <field name="view_mode">tree,form</field> + <field name="search_view_id" ref="view_sjo_line_approval_search"/> + <field name="domain">[('state','in',('sent','approve'))]</field> + <field name="context"> + { + 'search_default_filter_sent': 1, + 'search_default_filter_my_line': 1, + 'search_default_group_so': 1 + } + </field> + </record> + + <menuitem id="menu_sourcing_line_approval" + name="Approval Sourcing Line" + parent="indoteknik_custom.menu_monitoring_in_sale" + action="action_sourcing_line_approval" + sequence="110" + groups="indoteknik_custom.group_role_sales"/> +</odoo> |
