[cleanup] item grid views, removed desc etc

This commit is contained in:
Rushabh Mehta 2015-02-19 20:05:45 +05:30
parent c7a11cc451
commit 50dc4e90e3
17 changed files with 915 additions and 897 deletions

View File

@ -94,7 +94,7 @@ cur_frm.cscript.item_code = function(doc, cdt, cdn) {
var d = locals[cdt][cdn]; var d = locals[cdt][cdn];
if (d.item_code) { if (d.item_code) {
return frappe.call({ return frappe.call({
method: "erpnext.selling.doctype.opportunity.opportunity.get_item_details", method: "erpnext.crm.doctype.opportunity.opportunity.get_item_details",
args: {"item_code":d.item_code}, args: {"item_code":d.item_code},
callback: function(r, rt) { callback: function(r, rt) {
if(r.message) { if(r.message) {

View File

@ -58,7 +58,10 @@ class Opportunity(TransactionBase):
where q.name = qi.parent and q.docstatus=1 and qi.prevdoc_docname =%s and q.status = 'Ordered'""", self.name) where q.name = qi.parent and q.docstatus=1 and qi.prevdoc_docname =%s and q.status = 'Ordered'""", self.name)
def validate_cust_name(self): def validate_cust_name(self):
self.customer_name = self.customer or self.lead if self.customer:
self.customer_name = frappe.db.get_value("Customer", self.customer, "customer_name")
elif self.lead:
self.customer_name = frappe.db.get_value("Lead", self.lead, "lead_name")
def get_cust_address(self,name): def get_cust_address(self,name):
details = frappe.db.sql("""select customer_name, address, territory, customer_group details = frappe.db.sql("""select customer_name, address, territory, customer_group

View File

@ -20,14 +20,6 @@
"permlevel": 0, "permlevel": 0,
"width": "50%" "width": "50%"
}, },
{
"fieldname": "image_view",
"fieldtype": "Image",
"in_list_view": 0,
"label": "Image View",
"options": "image",
"permlevel": 0
},
{ {
"fieldname": "employee", "fieldname": "employee",
"fieldtype": "Data", "fieldtype": "Data",
@ -71,9 +63,17 @@
}, },
{ {
"fieldname": "image", "fieldname": "image",
"fieldtype": "Select", "fieldtype": "Attach",
"label": "Image", "label": "Image",
"options": "attach_files:", "options": "",
"permlevel": 0
},
{
"fieldname": "image_view",
"fieldtype": "Image",
"in_list_view": 0,
"label": "Image View",
"options": "image",
"permlevel": 0 "permlevel": 0
}, },
{ {
@ -674,7 +674,7 @@
], ],
"icon": "icon-user", "icon": "icon-user",
"idx": 1, "idx": 1,
"modified": "2015-02-05 05:11:38.234802", "modified": "2015-02-19 09:28:40.628101",
"modified_by": "Administrator", "modified_by": "Administrator",
"module": "HR", "module": "HR",
"name": "Employee", "name": "Employee",

View File

@ -53,7 +53,7 @@
}, },
{ {
"depends_on": "", "depends_on": "",
"description": "Bill of Material to be considered for manufacturing", "description": "",
"fieldname": "bom_no", "fieldname": "bom_no",
"fieldtype": "Link", "fieldtype": "Link",
"in_list_view": 0, "in_list_view": 0,
@ -94,7 +94,7 @@
"reqd": 1 "reqd": 1
}, },
{ {
"description": "Automatically updated via Stock Entry", "description": "",
"fieldname": "material_transferred_for_qty", "fieldname": "material_transferred_for_qty",
"fieldtype": "Int", "fieldtype": "Int",
"label": "Material Transferred for Qty", "label": "Material Transferred for Qty",
@ -105,7 +105,7 @@
{ {
"default": "0", "default": "0",
"depends_on": "eval:doc.docstatus==1", "depends_on": "eval:doc.docstatus==1",
"description": "Automatically updated via Stock Entry of type Manufacture or Repack", "description": "",
"fieldname": "produced_qty", "fieldname": "produced_qty",
"fieldtype": "Float", "fieldtype": "Float",
"label": "Manufactured Qty", "label": "Manufactured Qty",
@ -360,7 +360,7 @@
"idx": 1, "idx": 1,
"in_create": 0, "in_create": 0,
"is_submittable": 1, "is_submittable": 1,
"modified": "2015-02-19 03:58:23.460022", "modified": "2015-02-19 06:00:33.277637",
"modified_by": "Administrator", "modified_by": "Administrator",
"module": "Manufacturing", "module": "Manufacturing",
"name": "Production Order", "name": "Production Order",

View File

@ -12,10 +12,10 @@ erpnext.selling.SalesOrderController = erpnext.selling.SellingController.extend(
if(doc.docstatus==1) { if(doc.docstatus==1) {
if(doc.status != 'Stopped') { if(doc.status != 'Stopped') {
cur_frm.dashboard.add_progress(cint(doc.per_delivered) + __("% Delivered"), // cur_frm.dashboard.add_progress(cint(doc.per_delivered) + __("% Delivered"),
doc.per_delivered); // doc.per_delivered);
cur_frm.dashboard.add_progress(cint(doc.per_billed) + __("% Billed"), // cur_frm.dashboard.add_progress(cint(doc.per_billed) + __("% Billed"),
doc.per_billed); // doc.per_billed);
// delivery note // delivery note
if(flt(doc.per_delivered, 2) < 100 && ["Sales", "Shopping Cart"].indexOf(doc.order_type)!==-1) if(flt(doc.per_delivered, 2) < 100 && ["Sales", "Shopping Cart"].indexOf(doc.order_type)!==-1)

View File

@ -147,9 +147,9 @@
}, },
{ {
"fieldname": "logo", "fieldname": "logo",
"fieldtype": "Select", "fieldtype": "Attach",
"label": "Logo", "label": "Logo",
"options": "attach_files:", "options": "",
"permlevel": 0 "permlevel": 0
}, },
{ {
@ -200,7 +200,7 @@
"icon": "icon-user", "icon": "icon-user",
"idx": 1, "idx": 1,
"in_create": 0, "in_create": 0,
"modified": "2015-02-05 05:11:46.087123", "modified": "2015-02-19 09:26:41.397649",
"modified_by": "Administrator", "modified_by": "Administrator",
"module": "Setup", "module": "Setup",
"name": "Sales Partner", "name": "Sales Partner",

View File

@ -37,7 +37,8 @@ class Bin(Document):
"item_code": self.item_code, "item_code": self.item_code,
"warehouse": self.warehouse, "warehouse": self.warehouse,
"posting_date": args.get("posting_date"), "posting_date": args.get("posting_date"),
"posting_time": args.get("posting_time") "posting_time": args.get("posting_time"),
"voucher_no": args.get("voucher_no")
}, allow_negative_stock=allow_negative_stock) }, allow_negative_stock=allow_negative_stock)
def update_qty(self, args): def update_qty(self, args):

View File

@ -72,8 +72,17 @@ frappe.ui.form.on("Item", "onload", function(frm) {
response($.map(r.message, function(d) { return d.attribute_value; })); response($.map(r.message, function(d) { return d.attribute_value; }));
} }
}); });
},
select: function(event, ui) {
field.$input.val(ui.item.value);
field.$input.trigger("change");
},
focus: function( event, ui ) {
if(ui.item.action) {
return false;
} }
}) },
});
} }
}); });

View File

@ -79,12 +79,6 @@
"read_only": 0, "read_only": 0,
"reqd": 1 "reqd": 1
}, },
{
"fieldname": "column_break0",
"fieldtype": "Column Break",
"permlevel": 0,
"read_only": 0
},
{ {
"description": "Unit of measurement of this item (e.g. Kg, Unit, No, Pair).", "description": "Unit of measurement of this item (e.g. Kg, Unit, No, Pair).",
"fieldname": "stock_uom", "fieldname": "stock_uom",
@ -119,29 +113,10 @@
"read_only": 0 "read_only": 0
}, },
{ {
"fieldname": "section_break_11", "fieldname": "column_break0",
"fieldtype": "Section Break",
"permlevel": 0,
"precision": ""
},
{
"fieldname": "description",
"fieldtype": "Text Editor",
"in_filter": 0,
"in_list_view": 0,
"label": "Description",
"oldfieldname": "description",
"oldfieldtype": "Text",
"permlevel": 0,
"read_only": 0,
"reqd": 1,
"search_index": 0
},
{
"fieldname": "column_break_13",
"fieldtype": "Column Break", "fieldtype": "Column Break",
"permlevel": 0, "permlevel": 0,
"precision": "" "read_only": 0
}, },
{ {
"fieldname": "image", "fieldname": "image",
@ -160,6 +135,25 @@
"permlevel": 0, "permlevel": 0,
"precision": "" "precision": ""
}, },
{
"fieldname": "section_break_11",
"fieldtype": "Section Break",
"permlevel": 0,
"precision": ""
},
{
"fieldname": "description",
"fieldtype": "Text Editor",
"in_filter": 0,
"in_list_view": 0,
"label": "Description",
"oldfieldname": "description",
"oldfieldtype": "Text",
"permlevel": 0,
"read_only": 0,
"reqd": 1,
"search_index": 0
},
{ {
"fieldname": "variants_section", "fieldname": "variants_section",
"fieldtype": "Section Break", "fieldtype": "Section Break",
@ -801,9 +795,9 @@
"depends_on": "show_in_website", "depends_on": "show_in_website",
"description": "Item Image (if not slideshow)", "description": "Item Image (if not slideshow)",
"fieldname": "website_image", "fieldname": "website_image",
"fieldtype": "Select", "fieldtype": "Attach",
"label": "Image", "label": "Image",
"options": "attach_files:", "options": "",
"permlevel": 0, "permlevel": 0,
"read_only": 0 "read_only": 0
}, },
@ -879,7 +873,7 @@
"icon": "icon-tag", "icon": "icon-tag",
"idx": 1, "idx": 1,
"max_attachments": 1, "max_attachments": 1,
"modified": "2015-02-18 04:38:59.061328", "modified": "2015-02-19 09:24:59.397525",
"modified_by": "Administrator", "modified_by": "Administrator",
"module": "Stock", "module": "Stock",
"name": "Item", "name": "Item",

View File

@ -246,8 +246,6 @@ class Item(WebsiteGenerator):
for attr in template.variant_attributes[variant.item_code]: for attr in template.variant_attributes[variant.item_code]:
variant.description += "\n" + attr[0] + ": " + attr[1] variant.description += "\n" + attr[0] + ": " + attr[1]
if variant.description_html:
variant.description_html += "<div style='margin-top: 4px; font-size: 80%'>" + attr[0] + ": " + attr[1] + "</div>"
variant.variant_of = template.name variant.variant_of = template.name
variant.has_variants = 0 variant.has_variants = 0
variant.show_in_website = 0 variant.show_in_website = 0

View File

@ -1,3 +1,10 @@
frappe.listview_settings['Item'] = { frappe.listview_settings['Item'] = {
add_fields: ["item_name", "stock_uom", "item_group", "image"] add_fields: ["item_name", "stock_uom", "item_group", "image", "variant_of", "has_variants"],
get_indicator: function(doc) {
if(doc.has_variants) {
return [__("Template"), "blue", "has_variant,=,1"]
} else if(doc.variant_of) {
return [__("Variant"), "green", "variant_of,=," + doc.variant_of]
}
}
}; };

View File

@ -63,6 +63,7 @@ class StockEntry(StockController):
self.validate_return_reference_doc() self.validate_return_reference_doc()
self.validate_with_material_request() self.validate_with_material_request()
#self.validate_valuation_rate() #self.validate_valuation_rate()
self.set_total_incoming_outgoing_value()
self.set_total_amount() self.set_total_amount()
def on_submit(self): def on_submit(self):

View File

@ -106,6 +106,7 @@ class update_entries_after(object):
self.build() self.build()
def build(self): def build(self):
# includes current entry!
entries_to_fix = self.get_sle_after_datetime() entries_to_fix = self.get_sle_after_datetime()
for sle in entries_to_fix: for sle in entries_to_fix:
@ -169,7 +170,6 @@ class update_entries_after(object):
self.qty_after_transaction += flt(sle.actual_qty) self.qty_after_transaction += flt(sle.actual_qty)
self.stock_value = sum((flt(batch[0]) * flt(batch[1]) for batch in self.stock_queue)) self.stock_value = sum((flt(batch[0]) * flt(batch[1]) for batch in self.stock_queue))
# rounding as per precision # rounding as per precision
self.stock_value = flt(self.stock_value, self.precision) self.stock_value = flt(self.stock_value, self.precision)
@ -179,6 +179,7 @@ class update_entries_after(object):
# update current sle # update current sle
sle.qty_after_transaction = self.qty_after_transaction sle.qty_after_transaction = self.qty_after_transaction
sle.valuation_rate = self.valuation_rate sle.valuation_rate = self.valuation_rate
sle.stock_value = self.stock_value
sle.stock_queue = json.dumps(self.stock_queue) sle.stock_queue = json.dumps(self.stock_queue)
sle.stock_value_difference = stock_value_difference sle.stock_value_difference = stock_value_difference
sle.doctype="Stock Ledger Entry" sle.doctype="Stock Ledger Entry"
@ -252,6 +253,10 @@ class update_entries_after(object):
if not self.stock_queue: if not self.stock_queue:
self.stock_queue.append([0, 0]) self.stock_queue.append([0, 0])
# last row has the same rate, just updated the qty
if self.stock_queue[-1][1]==incoming_rate:
self.stock_queue[-1][0] += actual_qty
else:
if self.stock_queue[-1][0] > 0: if self.stock_queue[-1][0] > 0:
self.stock_queue.append([actual_qty, incoming_rate]) self.stock_queue.append([actual_qty, incoming_rate])
else: else:
@ -299,7 +304,9 @@ class update_entries_after(object):
def get_sle_after_datetime(self): def get_sle_after_datetime(self):
"""get Stock Ledger Entries after a particular datetime, for reposting""" """get Stock Ledger Entries after a particular datetime, for reposting"""
return get_stock_ledger_entries(self.previous_sle or self.args, ">", "asc", for_update=True) return get_stock_ledger_entries(self.previous_sle or frappe._dict({
"item_code": self.args.get("item_code"), "warehouse": self.args.get("warehouse") }),
">", "asc", for_update=True)
def raise_exceptions(self): def raise_exceptions(self):
deficiency = min(e["diff"] for e in self.exceptions) deficiency = min(e["diff"] for e in self.exceptions)
@ -329,7 +336,7 @@ def get_previous_sle(args, for_update=False):
sle = get_stock_ledger_entries(args, "<=", "desc", "limit 1", for_update=for_update) sle = get_stock_ledger_entries(args, "<=", "desc", "limit 1", for_update=for_update)
return sle and sle[0] or {} return sle and sle[0] or {}
def get_stock_ledger_entries(previous_sle, operator=None, order="desc", limit=None, for_update=False): def get_stock_ledger_entries(previous_sle, operator=None, order="desc", limit=None, for_update=False, debug=False):
"""get stock ledger entries filtered by specific posting datetime conditions""" """get stock ledger entries filtered by specific posting datetime conditions"""
conditions = "timestamp(posting_date, posting_time) {0} timestamp(%(posting_date)s, %(posting_time)s)".format(operator) conditions = "timestamp(posting_date, posting_time) {0} timestamp(%(posting_date)s, %(posting_time)s)".format(operator)
if not previous_sle.get("posting_date"): if not previous_sle.get("posting_date"):
@ -351,7 +358,7 @@ def get_stock_ledger_entries(previous_sle, operator=None, order="desc", limit=No
"limit": limit or "", "limit": limit or "",
"for_update": for_update and "for update" or "", "for_update": for_update and "for update" or "",
"order": order "order": order
}, previous_sle, as_dict=1) }, previous_sle, as_dict=1, debug=debug)
def get_valuation_rate(item_code, warehouse, allow_zero_rate=False): def get_valuation_rate(item_code, warehouse, allow_zero_rate=False):
last_valuation_rate = frappe.db.sql("""select valuation_rate last_valuation_rate = frappe.db.sql("""select valuation_rate

View File

@ -9,12 +9,47 @@
</div> </div>
{% } else { %} {% } else { %}
<div class="row"> <div class="row">
<div class="col-sm-6 col-xs-8"><strong>{%= doc.item_code %}</strong> <div class="col-sm-6 col-xs-8">
{% if(doc.warehouse) {
var label_class = "label-default",
title = "Warehouse",
actual_qty = (frm.doc.doctype==="Sales Order"
? doc.projected_qty : doc.actual_qty);
if(flt(frm.doc.per_delivered) < 100
&& in_list(["Sales Order Item", "Delivery Note Item"], doc.doctype)) {
if(actual_qty != undefined) {
if(actual_qty > doc.qty) {
var label_class = "label-success";
var title = "In Stock"
} else {
var label_class = "label-danger";
var title = "Not In Stock"
}
}
} %}
<span class="pull-right" title="{%= title %}">
<span class="label {%= label_class %}">
{%= doc.warehouse %}
</span>
</span>
{% } %}
{% if(in_list(["Sales Order Item", "Purchase Order Item"],
doc.doctype) && frm.doc.docstatus===1) {
var delivered = doc.doctype==="Sales Order Item" ?
doc.delivered_qty : doc.received_qty,
pending = flt(doc.qty) - flt(delivered);
%}
<span class="indicator {%= pending ? "orange" : "green" %}">{%= doc.item_code %}</span>
{% } else { %}
<strong>{%= doc.item_code %}</strong>
{% } %}
{% if(doc.item_name != doc.item_code) { %} {% if(doc.item_name != doc.item_code) { %}
<br>{%= doc.item_name %}{% } %} <br>{%= doc.item_name %}{% } %}
{% if(doc.item_name != doc.description) { %} <!-- {% if(doc.item_name != doc.description) { %}
<p>{%= doc.description %}</p>{% } %} <p>{%= doc.description %}</p>{% } %} -->
<p> <!-- <p>
{% if(doc.sales_order || doc.against_sales_order) { %} {% if(doc.sales_order || doc.against_sales_order) { %}
<span class="label label-default" style="margin-right: 10px;" <span class="label label-default" style="margin-right: 10px;"
title="{%= __("Sales Order") %}"> title="{%= __("Sales Order") %}">
@ -22,30 +57,9 @@
{%= doc.sales_order || doc.against_sales_order %} {%= doc.sales_order || doc.against_sales_order %}
</span> </span>
{% } %} {% } %}
{% if(doc.warehouse) { </p> -->
var label_class = "label-default",
title = "Warehouse",
actual_qty = (doc.doctype==="Sales Order"
? doc.projected_qty : doc.actual_qty);
if(actual_qty != undefined) {
if(actual_qty > doc.qty) {
var label_class = "label-success";
var title = "In Stock"
} else {
var title = "Not In Stock"
}
}
%}
<span style="margin-right: 10px;"
title="{%= title %}">
<span class="label {%= label_class %}">
{%= doc.warehouse %}
</span>
</span>
{% } %}
</p>
{% include "templates/form_grid/includes/visible_cols.html" %} {% include "templates/form_grid/includes/visible_cols.html" %}
{% if(doc.schedule_date) { %} <!-- {% if(doc.schedule_date) { %}
<div class="clearfix"></div> <div class="clearfix"></div>
<div> <div>
{% if(frappe.datetime.get_diff(doc.schedule_date) < 1 && doc.received_qty < doc.qty) { %} {% if(frappe.datetime.get_diff(doc.schedule_date) < 1 && doc.received_qty < doc.qty) { %}
@ -58,23 +72,13 @@
</span> </span>
{% } %} {% } %}
</div> </div>
{% } %} {% } %} -->
</div> </div>
<!-- qty --> <!-- qty -->
<div class="col-sm-2 hidden-xs text-right"> <div class="col-sm-2 hidden-xs text-right">
{%= doc.get_formatted("qty") %} {%= doc.get_formatted("qty") %}
<br><small>{%= doc.uom || doc.stock_uom %}</small> <span class="small">{%= doc.uom || doc.stock_uom %}</span>
{% if(in_list(["Sales Order Item", "Purchase Order Item"],
doc.doctype) && frm.doc.docstatus===1) {
var delivered = doc.doctype==="Sales Order Item" ?
doc.delivered_qty : doc.received_qty,
completed =
100 - cint((flt(doc.qty) - flt(delivered)) * 100 / flt(doc.qty)),
title = __("Delivered");
%}
{% include "templates/form_grid/includes/progress.html" %}
{% } %}
</div> </div>
<!-- rate --> <!-- rate -->
@ -99,16 +103,6 @@
{%= doc.get_formatted("amount") %} {%= doc.get_formatted("amount") %}
{% } %} {% } %}
{% if(in_list(["Sales Order Item", "Purchase Order Item"],
doc.doctype) && frm.doc.docstatus===1 && doc.amount) {
var completed =
100 - cint((flt(doc.amount) - flt(doc.billed_amt)) * 100 / flt(doc.amount)),
title = __("Billed");
%}
<br><small>&nbsp;</small>
{% include "templates/form_grid/includes/progress.html" %}
{% } %}
{% if (frappe.perm.is_visible("rate", doc, frm.perm)) { %} {% if (frappe.perm.is_visible("rate", doc, frm.perm)) { %}
<div class="visible-xs text-muted"> <div class="visible-xs text-muted">
{%= doc.get_formatted("qty") %} <small>{%= doc.uom || doc.stock_uom %}</small> {%= doc.get_formatted("qty") %} <small>{%= doc.uom || doc.stock_uom %}</small>

View File

@ -3,43 +3,47 @@
{% if(!doc) { %} {% if(!doc) { %}
<div class="row"> <div class="row">
<div class="col-sm-9">{%= __("Item") %}</div> <div class="col-sm-4">{%= __("Item") %}</div>
<div class="col-sm-3 text-right">{%= __("Qty") %}</div> <div class="col-sm-3">{%= __("Required On") %}</div>
<div class="col-sm-3">{%= __("Warehouse") %}</div>
<div class="col-sm-2 text-right">{%= __("Qty") %}</div>
</div> </div>
{% } else { %} {% } else { %}
<div class="row"> <div class="row">
<div class="col-sm-9"><strong>{%= doc.item_code %}</strong> <div class="col-sm-4">
<span class="indicator {%= (doc.qty==doc.ordered_qty) ? "green" : "orange" %}">{%= doc.item_code %}</strong>
{% if(doc.item_name != doc.item_code) { %} {% if(doc.item_name != doc.item_code) { %}
<br>{%= doc.item_name %}{% } %} <br>{%= doc.item_name %}{% } %}
{% if(doc.item_name != doc.description) { %} <!-- {% if(doc.item_name != doc.description) { %}
<p>{%= doc.description %}</p>{% } %} <p>{%= doc.description %}</p>{% } %} -->
<div> {% include "templates/form_grid/includes/visible_cols.html" %}
</div>
<div class="col-sm-3">
{% if(doc.schedule_date) { %}
<span title="{%= __("Reqd By Date") %}" class="{%=
(frappe.datetime.get_diff(doc.schedule_date, frappe.datetime.get_today()) < 0
&& doc.ordered_qty < doc.qty)
? "text-danger" : "text-muted" %}">
{%= doc.get_formatted("schedule_date") %}</span>
{% } %}
</div>
<!-- warehouse -->
<div class="col-sm-3">
{% if(doc.warehouse) { %} {% if(doc.warehouse) { %}
<span class="label label-default" title="{%= __("For Warehouse") %}" <span class="label label-default" title="{%= __("For Warehouse") %}"
style="margin-right: 10px;"> style="margin-right: 10px;">
{%= doc.warehouse %} {%= doc.warehouse %}
</span> </span>
{% } %} {% } %}
{% if(doc.schedule_date) { %}
<span title="{%= __("Reqd By Date") %}" class="label {%=
(frappe.datetime.get_diff(doc.schedule_date, frappe.datetime.get_today()) < 0
&& doc.ordered_qty < doc.qty)
? "label-danger" : "label-default" %}">
{%= doc.get_formatted("schedule_date") %}</span>
{% } %}
</div>
{% include "templates/form_grid/includes/visible_cols.html" %}
</div> </div>
<!-- qty --> <!-- qty -->
<div class="col-sm-3 text-right"> <div class="col-sm-2 text-right">
{%= doc.get_formatted("qty") %} {%= doc.get_formatted("qty") %}
<div class="small">{%= doc.uom || doc.stock_uom %}</div> <span class="small">{%= doc.uom || doc.stock_uom %}</span>
{% if(doc.qty == doc.ordered_qty) { %}
<div class="small text-success">{%= __("Ordered") %}</div>
{% } else { %}
<div class="small text-muted">{%= __("{0} Ordered", doc.ordered_qty) %}</div>
{% } %}
</div> </div>
</div> </div>
{% } %} {% } %}

View File

@ -15,8 +15,8 @@
<div class="col-sm-5 col-xs-4"><strong>{%= doc.item_code %}</strong> <div class="col-sm-5 col-xs-4"><strong>{%= doc.item_code %}</strong>
{% if(doc.item_name != doc.item_code) { %} {% if(doc.item_name != doc.item_code) { %}
<br>{%= doc.item_name %}{% } %} <br>{%= doc.item_name %}{% } %}
{% if(doc.item_name != doc.description) { %} <!-- {% if(doc.item_name != doc.description) { %}
<p>{%= doc.description %}</p>{% } %} <p>{%= doc.description %}</p>{% } %} -->
{% include "templates/form_grid/includes/visible_cols.html" %} {% include "templates/form_grid/includes/visible_cols.html" %}
{% if(frm.doc.docstatus==0 && doc.s_warehouse && doc.actual_qty < doc.qty) { %} {% if(frm.doc.docstatus==0 && doc.s_warehouse && doc.actual_qty < doc.qty) { %}
<span class="text-danger small" style="margin-left: 15px;"> <span class="text-danger small" style="margin-left: 15px;">
@ -28,10 +28,10 @@
<!-- warehouse --> <!-- warehouse -->
<div class="col-sm-3 col-xs-4"> <div class="col-sm-3 col-xs-4">
{% if(doc.s_warehouse) { %} {% if(doc.s_warehouse) { %}
<span class="label label-default" title="{% __("Source" )%}"> <span class="label label-default grid-label" title="{% __("Source" )%}">
{%= doc.s_warehouse || "" %}</span> {%= doc.s_warehouse || "" %}</span>
{% } %} {% } %}
{% if(doc.t_warehouse) { %}<span class="label label-primary" title="{% __("Target" )%}"> {% if(doc.t_warehouse) { %}<span class="label label-primary grid-label" title="{% __("Target" )%}">
{%= doc.t_warehouse || "" %}</span>{% } %} {%= doc.t_warehouse || "" %}</span>{% } %}
</div> </div>

View File

@ -49,7 +49,7 @@ class TransactionBase(StatusUpdater):
}) })
if frappe.db.exists("User", self.contact_by): if frappe.db.exists("User", self.contact_by):
frappe.share("Event", event.name, self.contact_by) frappe.share.add("Event", event.name, self.contact_by)
event.insert(ignore_permissions=True) event.insert(ignore_permissions=True)