fix: pound, gram to Ounce converion factor added (#21710)

* fix: pound, grams to Ounce converion factor added

* fix: patch date updated for UOM Conversion Factor

* fix: grams move to gram

* fix: duplicate entry of uom converion factor and patch added

* fix: typo fix

* fix: minor changes

* Update patches.txt

Co-authored-by: Marica <maricadsouza221197@gmail.com>
This commit is contained in:
Vishal Dhayagude
2020-05-25 15:13:09 +05:30
committed by GitHub
parent cbe476d455
commit 18b3c4802b
4 changed files with 34 additions and 7 deletions

View File

@@ -667,3 +667,4 @@ execute:frappe.delete_doc_if_exists("Page", "appointment-analytic")
erpnext.patches.v12_0.unset_customer_supplier_based_on_type_of_item_price
erpnext.patches.v12_0.set_serial_no_status #2020-05-21
erpnext.patches.v12_0.update_price_list_currency_in_bom
erpnext.patches.v12_0.update_uom_conversion_factor

View File

@@ -0,0 +1,11 @@
from __future__ import unicode_literals
import frappe, json
def execute():
from erpnext.setup.setup_wizard.operations.install_fixtures import add_uom_data
frappe.reload_doc("setup", "doctype", "UOM Conversion Factor")
frappe.reload_doc("setup", "doctype", "UOM")
frappe.reload_doc("stock", "doctype", "UOM Category")
add_uom_data()

View File

@@ -1571,5 +1571,19 @@
"to_uom": "Parts Per Million",
"abbr": "ppm",
"value": "10000"
},
{
"category": "Mass",
"from_uom": "Pound",
"to_uom": "Ounce",
"abbr": "oz",
"value": "16"
},
{
"category": "Mass",
"from_uom": "Gram",
"to_uom": "Ounce",
"abbr": "oz",
"value": "0.035274"
}
]

View File

@@ -335,13 +335,14 @@ def add_uom_data():
"category_name": _(d.get("category"))
}).insert(ignore_permissions=True)
uom_conversion = frappe.get_doc({
"doctype": "UOM Conversion Factor",
"category": _(d.get("category")),
"from_uom": _(d.get("from_uom")),
"to_uom": _(d.get("to_uom")),
"value": d.get("value")
}).insert(ignore_permissions=True)
if not frappe.db.exists("UOM Conversion Factor", {"from_uom": _(d.get("from_uom")), "to_uom": _(d.get("to_uom"))}):
uom_conversion = frappe.get_doc({
"doctype": "UOM Conversion Factor",
"category": _(d.get("category")),
"from_uom": _(d.get("from_uom")),
"to_uom": _(d.get("to_uom")),
"value": d.get("value")
}).insert(ignore_permissions=True)
def add_market_segments():
records = [