mirror of
https://github.com/frappe/erpnext.git
synced 2026-06-02 11:49:10 +00:00
fixes in patch
This commit is contained in:
@@ -2,19 +2,21 @@
|
|||||||
# License: GNU General Public License v3. See license.txt
|
# License: GNU General Public License v3. See license.txt
|
||||||
|
|
||||||
import frappe
|
import frappe
|
||||||
|
from frappe.website.utils import find_first_image
|
||||||
|
import re
|
||||||
|
|
||||||
def execute():
|
def execute():
|
||||||
dt_list= {"Purchase Order Item","Supplier Quotation Item", "BOM", "Bom Explosion Item" , \
|
dt_list= ["Purchase Order Item","Supplier Quotation Item", "BOM", "BOM Explosion Item" , \
|
||||||
"Bom Item", "Opportunity Item" , "Quotation Item" , "Sales Order Item" , "Delivery Note Item" , \
|
"BOM Item", "Opportunity Item" , "Quotation Item" , "Sales Order Item" , "Delivery Note Item" , \
|
||||||
"Material Request Item" , "Purchase Receipt Item" , "Stock Entry Detail"}
|
"Material Request Item" , "Purchase Receipt Item" , "Stock Entry Detail"]
|
||||||
|
|
||||||
for dt in dt_list:
|
for dt in dt_list:
|
||||||
names = frappe.db.sql("""select name, description from `tab{0}` doc where doc.description is not null""".format(dt),as_dict=1)
|
names = frappe.db.sql("""select name, description from `tab{0}` doc where doc.description is not null""".format(dt),as_dict=1)
|
||||||
for d in names:
|
for d in names:
|
||||||
try:
|
try:
|
||||||
data = d.description
|
data = d.description
|
||||||
image_url = data.split('<img src=')[1].split('" width=')[0]
|
image_url = find_first_image(data)
|
||||||
desc = data.split('<td>')[1].split('</td>')[0]
|
desc = re.sub("\<img[^>]+\>", "", data)
|
||||||
|
|
||||||
frappe.db.sql("""update `tab{0}` doc set doc.description = %s, doc.image = %s
|
frappe.db.sql("""update `tab{0}` doc set doc.description = %s, doc.image = %s
|
||||||
where doc.name = %s """.format(dt),(desc, image_url, d.name))
|
where doc.name = %s """.format(dt),(desc, image_url, d.name))
|
||||||
except:
|
except:
|
||||||
|
|||||||
@@ -68,7 +68,6 @@ erpnext.TransactionController = erpnext.taxes_and_totals.extend({
|
|||||||
|
|
||||||
item_code: function(doc, cdt, cdn) {
|
item_code: function(doc, cdt, cdn) {
|
||||||
var me = this;
|
var me = this;
|
||||||
var d = locals[cdt][cdn];
|
|
||||||
var item = frappe.get_doc(cdt, cdn);
|
var item = frappe.get_doc(cdt, cdn);
|
||||||
if(item.item_code || item.barcode || item.serial_no) {
|
if(item.item_code || item.barcode || item.serial_no) {
|
||||||
if(!this.validate_company_and_party()) {
|
if(!this.validate_company_and_party()) {
|
||||||
|
|||||||
Reference in New Issue
Block a user