diff options
| author | HafidBuroiroh <hafidburoiroh09@gmail.com> | 2026-03-06 14:24:00 +0700 |
|---|---|---|
| committer | HafidBuroiroh <hafidburoiroh09@gmail.com> | 2026-03-06 14:24:00 +0700 |
| commit | f687d197ead268040d7f396eb26ea0035a6dac35 (patch) | |
| tree | a8e9cf9efa0cf38a51db89badbe383b5e0857afb /indoteknik_custom/views | |
| parent | 8d953f913aceb97faa026253b65d6159759f5a62 (diff) | |
<hafid> change request sourcing job order
Diffstat (limited to 'indoteknik_custom/views')
| -rw-r--r-- | indoteknik_custom/views/ir_sequence.xml | 9 | ||||
| -rw-r--r-- | indoteknik_custom/views/sourcing.xml | 247 |
2 files changed, 215 insertions, 41 deletions
diff --git a/indoteknik_custom/views/ir_sequence.xml b/indoteknik_custom/views/ir_sequence.xml index 55e48300..818c5d30 100644 --- a/indoteknik_custom/views/ir_sequence.xml +++ b/indoteknik_custom/views/ir_sequence.xml @@ -241,6 +241,15 @@ <field name="active">True</field> </record> + <record id="seq_sourcing_job_order" model="ir.sequence"> + <field name="name">Sourcing Job Order</field> + <field name="code">sourcing.job.order</field> + <field name="prefix">SJO/%(year)s/</field> + <field name="padding">4</field> + <field name="number_next_actual">1</field> + <field name="number_increment">1</field> + </record> + <record id="seq_refund_sale_order" model="ir.sequence"> <field name="name">Refund Sales Order</field> <field name="code">refund.sale.order</field> diff --git a/indoteknik_custom/views/sourcing.xml b/indoteknik_custom/views/sourcing.xml index f3bb5b33..ebdbaaf7 100644 --- a/indoteknik_custom/views/sourcing.xml +++ b/indoteknik_custom/views/sourcing.xml @@ -65,8 +65,9 @@ <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" + <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"/> @@ -91,7 +92,7 @@ <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"> + <form string="Sourcing Job Order" create="0"> <header> <button name="action_cancel" string="Cancel" @@ -152,7 +153,7 @@ <field name="progress_status" decoration-info="progress_status in ['🟡 On Track', '🔵 Ontime']" decoration-success="'🟢' in progress_status" - decoration-danger="'🔴' in progress_status" + decoration-danger="'🔴' in progress_status" decoration-muted="'⚫' in progress_status"/> </group> </group> @@ -168,9 +169,9 @@ <field name="quantity"/> <field name="md_person_ids" widget="many2one_avatar_user"/> <field name="state" readonly="1" widget="badge" - decoration-warning="state in ('sourcing','sent')" - decoration-info="state == 'approve'" - decoration-success="state == 'done'" + 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"/> @@ -267,9 +268,9 @@ <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 in ('sourcing','sent')" - decoration-info="state == 'approve'" - decoration-success="state == 'done'" + decoration-warning="state == 'sourcing'" + decoration-info="state == 'sent'" + decoration-success="state == 'approve'" decoration-danger="state == 'cancel'"> <button name="action_reopen_cancel" type="object" @@ -424,15 +425,17 @@ decoration-info="state in ('sent','approve')"> <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="quantity"/> <field name="state" widget="badge" decoration-muted="state=='draft'" decoration-warning="state=='sourcing'" - decoration-success="state in ('done','convert')" + decoration-success="state== 'approve'" decoration-danger="state=='cancel'"/> <field name="budget" optional="hide"/> <field name="note" optional="hide"/> @@ -459,6 +462,48 @@ </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> @@ -478,14 +523,7 @@ class="btn-secondary" icon="fa-times" groups="indoteknik_custom.group_role_merchandiser" - attrs="{'invisible': [('state', 'in', ['cancel', 'done'])]}"/> - - <button name="action_convert" - string="Convert Lines" - type="object" - class="btn-success" - groups="indoteknik_custom.group_role_merchandiser" - attrs="{'invisible': [('state', '!=', 'approve')]}"/> + attrs="{'invisible': [('state', 'in', ['cancel', 'approve'])]}"/> <button name="action_ask_approval" string="Ask Approval" @@ -506,11 +544,34 @@ 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,done,cancel" attrs="{'invisible': [('state', '!=', 'cancel')]}"/> + statusbar_visible="draft,sourcing,sent,approve,cancel" attrs="{'invisible': [('state', '!=', 'cancel')]}"/> <field name="state" widget="statusbar" - statusbar_visible="draft,sourcing,sent,approve,done" attrs="{'invisible': [('state', '=', 'cancel')]}"/> + statusbar_visible="draft,sourcing,sent,approve" attrs="{'invisible': [('state', '=', 'cancel')]}"/> </header> <sheet > <widget name="web_ribbon" @@ -527,30 +588,44 @@ </h1> <group col="2"> <group> - <field name="create_uid" invisible="1"/> + <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="product_id" attrs="{'readonly': [('state', 'in', ['done', 'cancel', 'approve'])]}"/> - <field name="code" attrs="{'readonly': [('state', 'in', ['done', 'cancel', 'approve'])]}"/> - <field name="brand" required="1" attrs="{'readonly': [('state', 'in', ['done', 'cancel', 'approve'])]}"/> - <field name="product_name" required="1" attrs="{'readonly': [('state', 'in', ['done', 'cancel', 'approve'])]}"/> - <field name="descriptions" attrs="{'readonly': [('state', 'in', ['done', 'cancel', 'approve'])]}"/> - <field name="quantity" attrs="{'readonly': [('state', 'in', ['done', 'cancel', 'approve'])]}"/> - <field name="price" required="1" attrs="{'readonly': [('state', 'in', ['done', 'cancel', 'approve'])]}"/> + <field name="brand_id" attrs="{'readonly': [('state', 'in', ['cancel', 'approve'])]}"/> + <field name="product_id" attrs="{'readonly': [('state', 'in', ['cancel', 'approve'])]}"/> + <field name="descriptions_md" attrs="{'readonly': [('state', 'in', ['cancel', 'approve'])]}"/> + <field name="code" attrs="{'readonly': [('state', 'in', ['cancel', 'approve'])]}"/> + <field name="product_name_md" attrs="{'readonly': [('state', 'in', ['cancel', 'approve'])]}"/> + <field name="price" required="1" attrs="{'readonly': [('state', 'in', ['cancel', 'approve'])]}"/> <field name="now_price" force_save="1" readonly="1"/> - <field name="last_updated_price" readonly="1"/> - <field name="vendor_id" attrs="{'readonly': [('state', 'in', ['done', 'cancel', 'approve'])]}"/> - <field name="tax_id" attrs="{'readonly': [('state', 'in', ['done', 'cancel', 'approve'])]}"/> - <field name="subtotal" readonly="1" attrs="{'readonly': [('state', 'in', ['done', 'cancel', 'approve'])]}"/> - <field name="sla" attrs="{'readonly': [('state', 'in', ['done', 'cancel', 'approve'])]}"/> + <field name="last_updated_price" force_save="1"/> + <field name="vendor_id" attrs="{'readonly': [('state', 'in', ['cancel', 'approve'])]}"/> + <field name="tax_id" attrs="{'readonly': [('state', 'in', ['cancel', 'approve'])]}"/> + <field name="subtotal" readonly="1" attrs="{'readonly': [('state', 'in', ['cancel', 'approve'])]}"/> + <field name="product_category" attrs="{'readonly': [('state', 'in', ['cancel', 'approve'])]}"/> + <field name="product_type" attrs="{'readonly': [('state', 'in', ['cancel', 'approve'])]}"/> + <field name="product_class" widget="many2many_tags" attrs="{'readonly': [('state', 'in', ['cancel', 'approve'])]}"/> </group> <group> - <field name="product_category" attrs="{'readonly': [('state', 'in', ['done', 'cancel', 'approve'])]}"/> - <field name="product_type" attrs="{'readonly': [('state', 'in', ['done', 'cancel', 'approve'])]}"/> - <field name="product_class" widget="many2many_tags" attrs="{'readonly': [('state', 'in', ['done', 'cancel', 'approve'])]}"/> - <field name="note" attrs="{'readonly': [('state', 'in', ['done', 'cancel', 'approve'])]}"/> - <field name="budget" attrs="{'readonly': [('state', 'in', ['done', 'cancel', 'approve'])]}"/> - <field name="attachment_type" attrs="{'readonly': [('state', 'in', ['done', 'cancel', 'approve'])]}"/> + <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" readonly="1"/> + <field name="so_state" widget="badge" readonly="1" + decoration-success="so_state == 'sale'" + decoration-warning="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" @@ -568,7 +643,7 @@ </group> </group> <notebook> - <page string="Cancel Reason" attrs="{'invisible': [('state', 'in', ['done', 'approve'])]}"> + <page string="Cancel Reason" attrs="{'invisible': [('state', 'in', ['approve'])]}"> <group> <field name="reason"/> </group> @@ -614,4 +689,94 @@ 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"/> + + <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> + + </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="so_id"/> + <field name="order_id"/> + <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="show_salesperson" widget="many2one_avatar_user"/> + + <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="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</field> + <field name="view_id" ref="view_sjo_line_approval_tree"/> + <field name="search_view_id" ref="view_sjo_line_approval_search"/> + <field name="context"> + { + 'search_default_filter_sent': 1, + 'search_default_group_so': 1 + } + </field> + <field name="groups_id" eval="[(4, ref('indoteknik_custom.group_role_sales'))]"/> + </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> |
