[Enhance] Subscription module (#10089)

* [Enhance] Subscription module

* Added view documents from the subscription form

* Test cases

* documentation

* UI Test cases, fixes

* Removed child table in the subscription

* Provision to make subscription from the document, added subscription in the dashboard for the sales and buying flow

* added patch to make subscription from the recurring data

* Rename field subscriptio to subscription_id, added new test cases, remove recurring_document from controller

* renamed subscription_id to subscription
This commit is contained in:
rohitwaghchaure
2017-09-07 16:14:22 +05:30
committed by Nabin Hait
parent c79d14190f
commit 166b78f022
63 changed files with 2034 additions and 450 deletions

View File

@@ -8,7 +8,6 @@ from frappe.utils import today, flt, cint, fmt_money, formatdate, getdate
from erpnext.setup.utils import get_exchange_rate
from erpnext.accounts.utils import get_fiscal_years, validate_fiscal_year, get_account_currency
from erpnext.utilities.transaction_base import TransactionBase
from erpnext.controllers.recurring_document import convert_to_recurring, validate_recurring_document
from erpnext.controllers.sales_and_purchase_return import validate_return
from erpnext.accounts.party import get_party_account_currency, validate_party_frozen_disabled
from erpnext.exceptions import InvalidCurrency
@@ -53,13 +52,6 @@ class AccountsController(TransactionBase):
self.validate_party()
self.validate_currency()
if self.meta.get_field("is_recurring"):
if self.amended_from and self.recurring_id == self.amended_from:
self.recurring_id = None
if not self.get("__islocal"):
validate_recurring_document(self)
convert_to_recurring(self, self.get("posting_date") or self.get("transaction_date"))
if self.doctype == 'Purchase Invoice':
self.validate_paid_amount()
@@ -84,11 +76,6 @@ class AccountsController(TransactionBase):
else:
frappe.db.set(self,'paid_amount',0)
def on_update_after_submit(self):
if self.meta.get_field("is_recurring"):
validate_recurring_document(self)
convert_to_recurring(self, self.get("posting_date") or self.get("transaction_date"))
def set_missing_values(self, for_validate=False):
if frappe.flags.in_test:
for fieldname in ["posting_date","transaction_date"]: