work on sales flow

This commit is contained in:
sonal arora
2020-09-06 11:48:16 +05:30
parent c6c3d2bee4
commit f74c57a32a
3 changed files with 16 additions and 8 deletions

View File

@@ -6,7 +6,7 @@ from odoo import api, fields, models, SUPERUSER_ID, _
PURCHASE_REQUISITION_STATES = [
('draft', 'New'),
('approval', 'Pending PC Validation'),
('approval', 'Submitted To PC'),
('validate_by_pc','Validated By PC'),
('manager_approval','Submitted To MGT'),
('approved','Approved By MGT'),
@@ -20,11 +20,21 @@ PURCHASE_REQUISITION_STATES = [
class purchase_requisition(models.Model):
_inherit = "purchase.requisition"
def _check_store_keeper(self):
has_vle_group = self.env.user.has_group(
'csc_administrator.group_vle_level')
self.state_blanket_order = self.state
state = fields.Selection(PURCHASE_REQUISITION_STATES,
'Status', tracking=True, required=True,
copy=False, default='draft')
state_blanket_order = fields.Selection(PURCHASE_REQUISITION_STATES, compute='_set_state')
# store_keeper_visibility = fields.Boolean("Visibility",default='_check_store_keeper')
# @api.depends('state')
# def _check_store_keeper(self):
# self.state_blanket_order = self.state
@api.depends('state')
def _set_state(self):

View File

@@ -15,9 +15,9 @@ class sale_order(models.Model):
('approved', 'Approved By MGT'),
('logistics_approval', 'Validated By LC'),
('logistics_approved', 'validated By LC'),
('credit_approval', 'Submitted By CC'),
('credit_approval', 'Submitted To CC'),
('sent', 'Quotation Sent'),
('sale', 'Sales Order'),
('sale', 'Validated By CC'),
('done', 'Locked'),
('reject','Rejected By MGT'),
('cancel', 'Cancelled'),

View File

@@ -30,13 +30,11 @@
<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">
<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'])]}"/>
<button name="action_logistics_approve" groups="MKS_Tradex_Backend_2.group_credit_controller" states="credit_approval" type="object" string="Validated By CC"/>
<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', ['sale'])]}"/>
</xpath>