summaryrefslogtreecommitdiff
path: root/indoteknik_custom/views/sourcing.xml
diff options
context:
space:
mode:
Diffstat (limited to 'indoteknik_custom/views/sourcing.xml')
-rw-r--r--indoteknik_custom/views/sourcing.xml141
1 files changed, 126 insertions, 15 deletions
diff --git a/indoteknik_custom/views/sourcing.xml b/indoteknik_custom/views/sourcing.xml
index 582a1b3f..839b7bfb 100644
--- a/indoteknik_custom/views/sourcing.xml
+++ b/indoteknik_custom/views/sourcing.xml
@@ -5,8 +5,9 @@
<field name="model">sourcing.job.order</field>
<field name="arch" type="xml">
<search string="Search Sourcing Job Order">
- <field name="state" string="Name"/>
+ <field name="state" string="Status"/>
<field name="user_id" string="MD Person"/>
+
<filter name="my_job"
string="My Sourcing Job"
domain="[('user_id', '=', uid), ('state', '=', 'taken')]"/>
@@ -16,6 +17,9 @@
<filter name="done"
string="Complete"
domain="[('state', '=', 'done')]" />
+ <filter name="by_create_uid"
+ string="Created by Me"
+ domain="[('create_uid', '=', uid)]"/>
</search>
</field>
</record>
@@ -23,19 +27,48 @@
<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" default_order="state asc, create_date desc"
+ <tree string="Sourcing Job Orders"
decoration-success="state=='done'"
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="user_id" widget="many2one_avatar_user"/>
<field name="state" widget="badge"/>
+ <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"/>
<field name="create_date"/>
</tree>
</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>
+ <group>
+ <field name="line_ids" widget="many2many_tags"/>
+ </group>
+
+ <footer>
+ <button string="Export"
+ type="object"
+ name="action_confirm"
+ class="btn-primary"/>
+ <button string="Cancel" class="btn-secondary" special="cancel"/>
+ </footer>
+ </form>
+ </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>
@@ -93,6 +126,13 @@
groups="indoteknik_custom.group_role_merchandiser"
attrs="{'invisible': [('can_approve_takeover', '=', False)]}"/>
+ <button name="action_confirm_after_approval"
+ string="Confirm"
+ type="object"
+ class="btn-primary"
+ groups="indoteknik_custom.group_role_merchandiser"
+ attrs="{'invisible': ['|', ('approval_sales', '!=', 'approve'), ('state', '=', 'done')]}"/>
+
<button name="action_convert_all_lines"
string="Convert Lines"
type="object"
@@ -113,6 +153,13 @@
class="btn-danger"
groups="indoteknik_custom.group_role_merchandiser"
attrs="{'invisible': [('can_approve_takeover', '=', False)]}"/>
+
+ <button name="action_export_to_so"
+ string="Insert to SO"
+ type="object"
+ class="btn-primary"
+ groups="indoteknik_custom.group_role_merchandiser"
+ attrs="{'invisible': ['|', ('state', '!=', 'done'), ('so_id','=', False)]}"/>
<field name="state" widget="statusbar"
statusbar_visible="draft,taken,done,cancel"
@@ -146,6 +193,7 @@
<group>
<!-- <field name="leads_id"/> -->
<field name="eta_sales"/>
+ <field name="eta_complete" readonly="1"/>
<field name="so_id"/>
<field name="is_creator_same_user" invisible="1"/>
<field name="takeover_request" invisible="1"/>
@@ -158,17 +206,38 @@
<field name="create_uid" readonly="1" widget="many2one_avatar_user"/>
<field name="user_id" readonly="1" widget="many2one_avatar_user"/>
<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)]}">
+ <page string="Product Line" groups="indoteknik_custom.group_role_sales"
+ attrs="{'invisible': [('has_price_in_lines', '=', True)]}">
<field name="line_sales_input_ids">
- <tree editable="bottom">
+ <tree>
+ <field name="brand"/>
<field name="product_name"/>
<field name="descriptions"/>
<field name="quantity"/>
+ <field name="note" optional="hide"/>
+ <field name="budget" optional="hide"/>
+ <field name="product_image" optional="hide"/>
</tree>
+ <form string="Product Line">
+ <group>
+ <field name="brand" placeholder="Jika tidak mengetahui Brandnya isi saja *No Brand" required="1"/>
+ <field name="product_name"/>
+ <field name="descriptions" required="1"/>
+ <field name="quantity"/>
+ <field name="note"/>
+ <field name="budget"/>
+ <field name="product_image"/>
+ </group>
+ </form>
</field>
</page>
@@ -179,7 +248,9 @@
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"/>
@@ -194,11 +265,18 @@
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"/>
@@ -212,8 +290,11 @@
<field name="product_category"/>
<field name="product_type"/>
<field name="product_class" widget="many2many_tags"/>
- <field name="state"/>
- <field name="reason" attrs="{'invisible': [('state', '!=', 'cancel')]}"/>
+ <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>
@@ -225,6 +306,7 @@
<field name="line_sales_view_ids">
<tree>
<field name="code" readonly="1"/>
+ <field name="brand"/>
<field name="product_name" readonly="1"/>
<field name="descriptions" readonly="1"/>
<field name="quantity" readonly="1"/>
@@ -257,6 +339,22 @@
</field>
</record>
+ <record id="view_sourcing_reject_wizard_form" model="ir.ui.view">
+ <field name="name">sourcing.reject.wizard.form</field>
+ <field name="model">sourcing.reject.wizard</field>
+ <field name="arch" type="xml">
+ <form string="Reason for Reject">
+ <group>
+ <field name="reason" placeholder="Tuliskan alasan penolakan..." nolabel="1"/>
+ </group>
+ <footer>
+ <button string="Confirm Reject" type="object" name="action_confirm_reject" class="btn-primary"/>
+ <button string="Cancel" special="cancel" class="btn-secondary"/>
+ </footer>
+ </form>
+ </field>
+ </record>
+
<record id="action_sourcing_job_order_multi_take" model="ir.actions.server">
<field name="name">Take Selected Jobs</field>
<field name="model_id" ref="model_sourcing_job_order"/>
@@ -277,17 +375,22 @@
<field name="groups_id" eval="[(4, ref('indoteknik_custom.group_role_merchandiser'))]"/>
</record>
- <record id="action_sourcing_job_order" model="ir.actions.act_window">
+ <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</field>
<field name="view_mode">tree,form</field>
<field name="search_view_id" ref="view_sourcing_job_order_search"/>
<field name="context">{'search_default_untaken': 1, 'search_default_my_job': 1}</field>
- <field name="help" type="html">
- <p class="o_view_nocontent_smiling_face">
- Buat Sourcing Job Order baru di sini ✨
- </p>
- </field>
+ <field name="groups_id" eval="[(4, ref('indoteknik_custom.group_role_merchandiser'))]"/>
+ </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_md_root"
@@ -295,9 +398,17 @@
parent="crm.crm_menu_root"
sequence="80"/>
- <menuitem id="menu_sourcing_job_order"
- name="Sourcing Job Order"
+ <menuitem id="menu_sourcing_job_order_md"
+ name="Sourcing Job Orders"
parent="menu_md_root"
- action="action_sourcing_job_order"
+ action="action_sourcing_job_order_md"
+ groups="indoteknik_custom.group_role_merchandiser"
sequence="90"/>
+
+ <menuitem id="menu_sourcing_job_order_sales"
+ name="Sourcing Job Orders"
+ parent="menu_md_root"
+ action="action_sourcing_job_order_sales"
+ groups="indoteknik_custom.group_role_sales"
+ sequence="91"/>
</odoo>