work on sales flow

This commit is contained in:
sonal arora
2020-09-06 11:01:52 +05:30
parent 79d5143d31
commit c6c3d2bee4
2 changed files with 17 additions and 19 deletions

View File

@@ -11,11 +11,11 @@ class sale_order(models.Model):
state = fields.Selection([
('draft', 'new'),
('approval', 'Submmited To MGT'),
('approval', 'Submitted To MGT'),
('approved', 'Approved By MGT'),
('logistics_approval', 'Validated By Logistic'),
('logistics_approved', 'validated by logistic'),
('credit_approval', 'Validated By CC'),
('logistics_approval', 'Validated By LC'),
('logistics_approved', 'validated By LC'),
('credit_approval', 'Submitted By CC'),
('sent', 'Quotation Sent'),
('sale', 'Sales Order'),
('done', 'Locked'),

View File

@@ -5,15 +5,8 @@
<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_confirm'][2]" position="replace">-->
<!-- -->
<!-- <button name="action_confirm" groups="MKS_Tradex_Backend_2.group_credit_controller" string="Sale Confirm" class="btn-primary" type="object" attrs="{'invisible': [('state', 'not in', ['sale'])]}"/>-->
<!-- </xpath>-->
<xpath expr="//button[@name='action_confirm'][2]" position="replace">
<button name="action_credit_approval" groups="MKS_Tradex_Backend_2.group_credit_controller" string="Validated By CC" class="btn-primary" type="object" attrs="{'invisible': [('state', 'not in', ['logistics_approval'])]}"/>
<button name="action_confirm" groups="MKS_Tradex_Backend_2.group_sale_logistics,MKS_Tradex_Backend_2.group_credit_controller" string="Create SO" class="btn-primary" type="object" attrs="{'invisible': [('state', 'not in', ['credit_approval'])]}"/>
</xpath>
<xpath expr="//button[@name='action_quotation_send']" position="after">
<button name="action_manager_approval" groups = "sales_team.group_sale_manager" string="Approved By MGT" type="object" attrs="{'invisible': [('state', 'not in', ['approval'])]}" class="btn-primary"/>
@@ -34,11 +27,16 @@
<xpath expr="//button[@name='action_confirm']" position="after">
<button name="action_logistics_approval" groups="sales_team.group_sale_salesman" states="approved" type="object" string="Validated By Logistic"/>
<button name="action_logistics_approval" groups="sales_team.group_sale_salesman" states="approved" type="object" string="Validated By LC"/>
</xpath>
<xpath expr="//button[@name='action_confirm']" position="after">
<!-- <xpath expr="//button[@name='action_confirm']" position="after">
<button name="action_logistics_approve" groups="MKS_Tradex_Backend_2.group_sale_logistics" states="logistics_approval" type="object" string="Confirm"/>
</xpath> -->
<xpath expr="//button[@name='action_confirm'][2]" position="replace">
<button name="action_credit_approval" groups="MKS_Tradex_Backend_2.group_credit_controller" string="Submit To CC" class="btn-primary" type="object" attrs="{'invisible': [('state', 'not in', ['logistics_approval'])]}"/>
<button name="action_confirm" groups="MKS_Tradex_Backend_2.group_sale_logistics,MKS_Tradex_Backend_2.group_credit_controller" string="Create SO" class="btn-primary" type="object" attrs="{'invisible': [('state', 'not in', ['credit_approval'])]}"/>
</xpath>