mirror of
https://github.com/frappe/erpnext.git
synced 2026-05-20 21:49:18 +00:00
[opportunity] not submittable
This commit is contained in:
@@ -119,10 +119,10 @@
|
||||
"no_copy": 1,
|
||||
"oldfieldname": "status",
|
||||
"oldfieldtype": "Select",
|
||||
"options": "Draft\nSubmitted\nQuotation\nLost\nCancelled\nReplied\nOpen",
|
||||
"options": "Open\nQuotation\nLost\nReplied",
|
||||
"permlevel": 0,
|
||||
"print_hide": 1,
|
||||
"read_only": 1,
|
||||
"read_only": 0,
|
||||
"reqd": 1
|
||||
},
|
||||
{
|
||||
@@ -406,17 +406,17 @@
|
||||
],
|
||||
"icon": "icon-info-sign",
|
||||
"idx": 1,
|
||||
"is_submittable": 1,
|
||||
"modified": "2015-04-02 22:03:52.841173",
|
||||
"is_submittable": 0,
|
||||
"modified": "2015-04-13 06:50:43.198407",
|
||||
"modified_by": "Administrator",
|
||||
"module": "CRM",
|
||||
"name": "Opportunity",
|
||||
"owner": "Administrator",
|
||||
"permissions": [
|
||||
{
|
||||
"amend": 1,
|
||||
"amend": 0,
|
||||
"apply_user_permissions": 1,
|
||||
"cancel": 1,
|
||||
"cancel": 0,
|
||||
"create": 1,
|
||||
"delete": 1,
|
||||
"email": 1,
|
||||
@@ -426,12 +426,12 @@
|
||||
"report": 1,
|
||||
"role": "Sales User",
|
||||
"share": 1,
|
||||
"submit": 1,
|
||||
"submit": 0,
|
||||
"write": 1
|
||||
},
|
||||
{
|
||||
"amend": 1,
|
||||
"cancel": 1,
|
||||
"amend": 0,
|
||||
"cancel": 0,
|
||||
"create": 1,
|
||||
"delete": 1,
|
||||
"email": 1,
|
||||
@@ -441,7 +441,7 @@
|
||||
"report": 1,
|
||||
"role": "Sales Manager",
|
||||
"share": 1,
|
||||
"submit": 1,
|
||||
"submit": 0,
|
||||
"write": 1
|
||||
}
|
||||
],
|
||||
|
||||
@@ -28,6 +28,10 @@ class Opportunity(TransactionBase):
|
||||
def set_subject(self, subject):
|
||||
self.title = subject
|
||||
|
||||
def after_insert(self):
|
||||
if self.lead:
|
||||
frappe.get_doc("Lead", self.lead).set_status(update=True)
|
||||
|
||||
def validate(self):
|
||||
self._prev = frappe._dict({
|
||||
"contact_date": frappe.db.get_value("Opportunity", self.name, "contact_date") if \
|
||||
@@ -51,15 +55,6 @@ class Opportunity(TransactionBase):
|
||||
from erpnext.accounts.utils import validate_fiscal_year
|
||||
validate_fiscal_year(self.transaction_date, self.fiscal_year, _("Opportunity Date"), self)
|
||||
|
||||
def on_submit(self):
|
||||
if self.lead:
|
||||
frappe.get_doc("Lead", self.lead).set_status(update=True)
|
||||
|
||||
def on_cancel(self):
|
||||
if self.has_quotation():
|
||||
frappe.throw(_("Cannot Cancel Opportunity as Quotation Exists"))
|
||||
self.set_status(update=True)
|
||||
|
||||
def declare_enquiry_lost(self,arg):
|
||||
if not self.has_quotation():
|
||||
frappe.db.set(self, 'status', 'Lost')
|
||||
|
||||
Reference in New Issue
Block a user