mirror of
https://gitlab.com/sonalarora/tra_backend.git
synced 2025-12-17 18:29:08 +02:00
work on sales flow
This commit is contained in:
@@ -6,7 +6,7 @@ from odoo import api, fields, models, SUPERUSER_ID, _
|
|||||||
|
|
||||||
PURCHASE_REQUISITION_STATES = [
|
PURCHASE_REQUISITION_STATES = [
|
||||||
('draft', 'New'),
|
('draft', 'New'),
|
||||||
('approval', 'Pending PC Validation'),
|
('approval', 'Submitted To PC'),
|
||||||
('validate_by_pc','Validated By PC'),
|
('validate_by_pc','Validated By PC'),
|
||||||
('manager_approval','Submitted To MGT'),
|
('manager_approval','Submitted To MGT'),
|
||||||
('approved','Approved By MGT'),
|
('approved','Approved By MGT'),
|
||||||
@@ -20,11 +20,21 @@ PURCHASE_REQUISITION_STATES = [
|
|||||||
class purchase_requisition(models.Model):
|
class purchase_requisition(models.Model):
|
||||||
_inherit = "purchase.requisition"
|
_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,
|
state = fields.Selection(PURCHASE_REQUISITION_STATES,
|
||||||
'Status', tracking=True, required=True,
|
'Status', tracking=True, required=True,
|
||||||
copy=False, default='draft')
|
copy=False, default='draft')
|
||||||
|
|
||||||
state_blanket_order = fields.Selection(PURCHASE_REQUISITION_STATES, compute='_set_state')
|
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')
|
@api.depends('state')
|
||||||
def _set_state(self):
|
def _set_state(self):
|
||||||
|
|||||||
@@ -15,9 +15,9 @@ class sale_order(models.Model):
|
|||||||
('approved', 'Approved By MGT'),
|
('approved', 'Approved By MGT'),
|
||||||
('logistics_approval', 'Validated By LC'),
|
('logistics_approval', 'Validated By LC'),
|
||||||
('logistics_approved', 'validated By LC'),
|
('logistics_approved', 'validated By LC'),
|
||||||
('credit_approval', 'Submitted By CC'),
|
('credit_approval', 'Submitted To CC'),
|
||||||
('sent', 'Quotation Sent'),
|
('sent', 'Quotation Sent'),
|
||||||
('sale', 'Sales Order'),
|
('sale', 'Validated By CC'),
|
||||||
('done', 'Locked'),
|
('done', 'Locked'),
|
||||||
('reject','Rejected By MGT'),
|
('reject','Rejected By MGT'),
|
||||||
('cancel', 'Cancelled'),
|
('cancel', 'Cancelled'),
|
||||||
|
|||||||
@@ -30,13 +30,11 @@
|
|||||||
<button name="action_logistics_approval" groups="sales_team.group_sale_salesman" states="approved" type="object" string="Validated By LC"/>
|
<button name="action_logistics_approval" groups="sales_team.group_sale_salesman" states="approved" type="object" string="Validated By LC"/>
|
||||||
</xpath>
|
</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">
|
<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_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_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', ['credit_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', ['sale'])]}"/>
|
||||||
</xpath>
|
</xpath>
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user