diff --git a/buying/doctype/purchase_order/test_purchase_order.py b/buying/doctype/purchase_order/test_purchase_order.py index 2c354b52b1..75eac9478f 100644 --- a/buying/doctype/purchase_order/test_purchase_order.py +++ b/buying/doctype/purchase_order/test_purchase_order.py @@ -70,6 +70,12 @@ class TestPurchaseOrder(unittest.TestCase): po.doc.conversion_rate = 0.0167 self.assertRaises(WrongWarehouseCompany, po.insert) + def test_uom_integer_validation(self): + from utilities.transaction_base import UOMMustBeIntegerError + po = webnotes.bean(copy=test_records[0]) + po.doclist[1].qty = 3.4 + self.assertRaises(UOMMustBeIntegerError, po.insert) + test_dependencies = ["BOM"] @@ -101,7 +107,7 @@ test_records = [ "import_rate": 500.0, "amount": 5000.0, "warehouse": "_Test Warehouse - _TC", - "stock_uom": "Nos", + "stock_uom": "_Test UOM", "uom": "_Test UOM", "schedule_date": "2013-03-01" } diff --git a/config.json b/config.json index 29d24fe982..c9d1aa71f8 100644 --- a/config.json +++ b/config.json @@ -87,9 +87,6 @@ "no_cache": true, "template": "app/website/templates/pages/account" }, - "attributions": { - "template": "app/website/templates/pages/attributions" - }, "blog": { "template": "app/website/templates/pages/blog", "args_method": "website.helpers.blog.get_blog_template_args" diff --git a/controllers/accounts_controller.py b/controllers/accounts_controller.py index 4e850ff8e0..56ddfd12b2 100644 --- a/controllers/accounts_controller.py +++ b/controllers/accounts_controller.py @@ -33,6 +33,8 @@ class AccountsController(TransactionBase): self.validate_value("grand_total", ">=", 0) self.set_total_in_words() + self.validate_for_freezed_account() + def set_missing_values(self, for_validate=False): for fieldname in ["posting_date", "transaction_date"]: if not self.doc.fields.get(fieldname) and self.meta.get_field(fieldname): @@ -51,6 +53,18 @@ class AccountsController(TransactionBase): if date_field and self.doc.fields[date_field]: validate_fiscal_year(self.doc.fields[date_field], self.doc.fiscal_year, label=self.meta.get_label(date_field)) + + def validate_for_freezed_account(self): + for fld in ["customer", "supplier"]: + if self.meta.get_field(fld): + accounts = webnotes.conn.get_values("Account", {"master_type": fld.upper(), + "master_name": self.doc.fields[fld], "company": self.doc.company}, + "freeze_account", as_dict=1) + + if accounts: + if not filter(lambda x: cstr(x.freeze_account) in ["", "No"], accounts): + msgprint(_("Account for this ") + fld + _(" has been freezed. ") + + self.doc.doctype + _(" can not be made."), raise_exception=1) def set_price_list_currency(self, buying_or_selling): # TODO - change this, since price list now has only one currency allowed diff --git a/home/page/attributions/README.md b/home/page/attributions/README.md deleted file mode 100644 index a5237bb8ce..0000000000 --- a/home/page/attributions/README.md +++ /dev/null @@ -1 +0,0 @@ -Attributions for software libraries / images used in ERPNext. \ No newline at end of file diff --git a/home/page/attributions/__init__.py b/home/page/attributions/__init__.py deleted file mode 100644 index baffc48825..0000000000 --- a/home/page/attributions/__init__.py +++ /dev/null @@ -1 +0,0 @@ -from __future__ import unicode_literals diff --git a/home/page/attributions/attributions.css b/home/page/attributions/attributions.css deleted file mode 100644 index 1de05eec8e..0000000000 --- a/home/page/attributions/attributions.css +++ /dev/null @@ -1,3 +0,0 @@ -.layout-attributions td:first-child { - width: 30%; -} \ No newline at end of file diff --git a/home/page/attributions/attributions.html b/home/page/attributions/attributions.html deleted file mode 100644 index 00f6342837..0000000000 --- a/home/page/attributions/attributions.html +++ /dev/null @@ -1,143 +0,0 @@ -
| ERPNext | -Web based, Open Source ERP. - Get top class hosting and support at ERPNext.com |
-
| wnframework | -The full stack Python + Javascript web application framework on which ERPNext is built. | -
| Linux Operating System | -The operating system that brought a revolution in Open Source software. | -
| MySQL Database | -The world's most popular Open Source Database. | -
| Apache HTTPD web server | -The Number One HTTP Server On The Internet. | -
| Memcached | -Free & open source, high-performance, distributed memory object caching system. | -
| Python Programming Language | -The "batteries included" language that lets you write elegant code, quickly. Python Libraries: -
|
-
| Git - Source Code Management | -Git is a free and open source distributed version control system designed to handle everything from small to very large projects with speed and efficiency. - Kindly hosted on the web by GitHub: The service that makes it easier for individuals and teams to write better code, faster. |
-
| JQuery Javascript Libary | -The write less, do more Javascript Library. | -
| JQuery UI - User Interface Library | -A curated set of user interface interactions, effects, widgets, and themes built on top of the jQuery JavaScript Library. | -
| Bootstrap CSS Framework | -Sleek, intuitive, and powerful front-end framework for faster and easier web development. | -
| Font Awesome - Icons | -The iconic font designed for use with Twitter Bootstrap. | -
| TinyMCE Rich Text Editor | -TinyMCE is a platform independent web based Javascript HTML WYSIWYG editor control released as Open Source under LGPL by Moxiecode Systems AB. | -
| SlickGrid | -A lightning fast JavaScript grid/spreadsheet. | -
| FullCalendar | -FullCalendar is a jQuery plugin that provides a full-sized, drag and drop calendar. | -
| Flot Charting Library | -Attractive JavaScript plotting for jQuery. | -
| Ace Code Editor | -High Performance Code Editor for the web. | -
| JQuery.Gantt - Gantt Charts | -Draw Gantt charts with the famous jQuery ease of development. | -
| JQuery Tag-it | -Simple and configurable tag editing widget with autocomplete support. | -
| JSColor - Color Picker | -HTML/Javascript Color Picker. | -
| QUnit | -A JavaScript Unit Testing framework. | -
| Downloadify - Flash Download Widget | -A tiny javascript + Flash library that enables the creation and download of text files without server interaction. | -
| GeoLite data by MaxMind | -GeoLite data created by MaxMind, available from - https://www.maxmind.com | -
ERPNext - Open Source, web based ERP
-Copyright © 2012, Web Notes Technologies Pvt Ltd, India
- -This program is free software: you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation, either version 3 of the License, or - (at your option) any later version.
- -This program is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details.
- -For complete license see http://www.gnu.org/licenses/
-Note: A link to this page must be easily accessible and all other ERPNext branding must remain as it is.
-For more information please write to us at support@erpnext.com
-*italic* **bold**
-_italic_ __bold__
-
-
-Inline:
- -An [example](http://url.com/ "Title")
-
-
-Reference-style labels (titles are optional):
- -An [example][id]. Then, anywhere
-else in the doc, define the link:
-
- [id]: http://example.com/ "Title"
-
-
-Inline (titles are optional):
- -
-
-
-Reference-style:
- -![alt text][id]
-
- [id]: /url/to/img.jpg "Title"
-
-
-Setext-style:
- -Header 1
-========
-
-Header 2
---------
-
-
-
-atx-style (closing #'s are optional):
- -# Header 1 #
-
-
-
-
-Ordered, without paragraphs:
- -1. Foo
-2. Bar
-
-
-Unordered, with paragraphs:
- -* A list item.
-
- With multiple paragraphs.
-
-* Bar
-
-
-You can nest them:
- -* Abacus
- * ass
-* Bastard
- 1. bitch
- 2. bupkis
- * BELITTLER
- 3. burper
-* Cunning
-
-
-> Email-style angle brackets
-
-> are used for blockquotes.
-
-> > And, they can be nested.
-
-> >
-> * You can quote a list.
-> * Etc.
-
-
-`<code>` spans are delimited
-by backticks.
-
-You can include literal backticks
-like `` `this` ``.
-
-
-Indent every line of a code block by at least 4 spaces or 1 tab, and use a colon at the end of the preceding paragraph.
- -This is a normal paragraph:
-
- This is a preformatted
- code block.
-
-Preceded by a space, the colon
-disappears. :
-
- This is a preformatted
- code block.
-
-
-Three or more dashes or asterisks:
- ----
-
-* * *
-
-- - - -
-
-
-End a line with two or more spaces:
- -Roses are red,
-Violets are blue.
-
-