mirror of
https://github.com/frappe/erpnext.git
synced 2026-05-30 02:14:48 +00:00
[website] [minor] moving to framework
This commit is contained in:
@@ -51,25 +51,3 @@ class DocType:
|
||||
webnotes.conn.sql("""update `tabAddress` set `%s`=0 where `%s`=%s and name!=%s""" %
|
||||
(is_address_type, fieldname, "%s", "%s"), (self.doc.fields[fieldname], self.doc.name))
|
||||
break
|
||||
|
||||
def get_website_args():
|
||||
def _get_fields(fieldnames):
|
||||
return [webnotes._dict(zip(["label", "fieldname", "fieldtype", "options"],
|
||||
[df.label, df.fieldname, df.fieldtype, df.options]))
|
||||
for df in webnotes.get_doctype("Address", processed=True).get({"fieldname": ["in", fieldnames]})]
|
||||
|
||||
bean = None
|
||||
if webnotes.form_dict.name:
|
||||
bean = webnotes.bean("Address", webnotes.form_dict.name)
|
||||
|
||||
return {
|
||||
"doc": bean.doc if bean else None,
|
||||
"meta": webnotes._dict({
|
||||
"left_fields": _get_fields(["address_title", "address_type", "address_line1", "address_line2",
|
||||
"city", "state", "pincode", "country"]),
|
||||
"right_fields": _get_fields(["email_id", "phone", "fax", "is_primary_address",
|
||||
"is_shipping_address"])
|
||||
}),
|
||||
"cint": cint
|
||||
}
|
||||
|
||||
|
||||
0
utilities/doctype/address/templates/__init__.py
Normal file
0
utilities/doctype/address/templates/__init__.py
Normal file
@@ -1,4 +1,4 @@
|
||||
{% extends "app/website/templates/html/page.html" %}
|
||||
{% extends base_template %}
|
||||
|
||||
{% set title=doc and doc.name or "New Address" %}
|
||||
{% set docname=(doc and doc.name or "") %}
|
||||
28
utilities/doctype/address/templates/pages/address.py
Normal file
28
utilities/doctype/address/templates/pages/address.py
Normal file
@@ -0,0 +1,28 @@
|
||||
# Copyright (c) 2013, Web Notes Technologies Pvt. Ltd.
|
||||
# License: GNU General Public License v3. See license.txt
|
||||
|
||||
from __future__ import unicode_literals
|
||||
import webnotes
|
||||
from webnotes.utils import cint
|
||||
|
||||
def get_context():
|
||||
def _get_fields(fieldnames):
|
||||
return [webnotes._dict(zip(["label", "fieldname", "fieldtype", "options"],
|
||||
[df.label, df.fieldname, df.fieldtype, df.options]))
|
||||
for df in webnotes.get_doctype("Address", processed=True).get({"fieldname": ["in", fieldnames]})]
|
||||
|
||||
bean = None
|
||||
if webnotes.form_dict.name:
|
||||
bean = webnotes.bean("Address", webnotes.form_dict.name)
|
||||
|
||||
return {
|
||||
"doc": bean.doc if bean else None,
|
||||
"meta": webnotes._dict({
|
||||
"left_fields": _get_fields(["address_title", "address_type", "address_line1", "address_line2",
|
||||
"city", "state", "pincode", "country"]),
|
||||
"right_fields": _get_fields(["email_id", "phone", "fax", "is_primary_address",
|
||||
"is_shipping_address"])
|
||||
}),
|
||||
"cint": cint
|
||||
}
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
{% extends "app/website/templates/html/page.html" %}
|
||||
{% extends base_template %}
|
||||
|
||||
{% set title="My Addresses" %}
|
||||
|
||||
Reference in New Issue
Block a user