From 27efc91db0fd63686e80ed1c9eb0d0379fcd6247 Mon Sep 17 00:00:00 2001 From: mbauskar Date: Wed, 15 Mar 2017 18:57:18 +0530 Subject: [PATCH 01/15] [minor] make item code mandatory if update_stock is selected --- .../accounts/doctype/purchase_invoice/purchase_invoice.js | 1 + .../accounts/doctype/purchase_invoice/purchase_invoice.py | 7 +++++++ erpnext/accounts/doctype/sales_invoice/sales_invoice.js | 1 + erpnext/public/js/controllers/transaction.js | 1 - 4 files changed, 9 insertions(+), 1 deletion(-) diff --git a/erpnext/accounts/doctype/purchase_invoice/purchase_invoice.js b/erpnext/accounts/doctype/purchase_invoice/purchase_invoice.js index 5f4e8c05d9..48b18493d1 100644 --- a/erpnext/accounts/doctype/purchase_invoice/purchase_invoice.js +++ b/erpnext/accounts/doctype/purchase_invoice/purchase_invoice.js @@ -205,6 +205,7 @@ function hide_fields(doc) { cur_frm.cscript.update_stock = function(doc, dt, dn) { hide_fields(doc, dt, dn); + this.frm.fields_dict.items.grid.toggle_reqd("item_code", doc.update_stock? true: false) } cur_frm.fields_dict.cash_bank_account.get_query = function(doc) { diff --git a/erpnext/accounts/doctype/purchase_invoice/purchase_invoice.py b/erpnext/accounts/doctype/purchase_invoice/purchase_invoice.py index 14459fa497..feb0775572 100644 --- a/erpnext/accounts/doctype/purchase_invoice/purchase_invoice.py +++ b/erpnext/accounts/doctype/purchase_invoice/purchase_invoice.py @@ -156,6 +156,12 @@ class PurchaseInvoice(BuyingController): super(PurchaseInvoice, self).validate_warehouse() + + def validate_item_code(self): + for d in self.get('items'): + if not d.item_code: + frappe.msgprint(_("Item Code required at Row No {0}").format(d.idx), raise_exception=True) + def set_expense_account(self, for_validate=False): auto_accounting_for_stock = cint(frappe.defaults.get_global_default("auto_accounting_for_stock")) @@ -164,6 +170,7 @@ class PurchaseInvoice(BuyingController): stock_items = self.get_stock_items() if self.update_stock: + self.validate_item_code() self.validate_warehouse() warehouse_account = get_warehouse_account() diff --git a/erpnext/accounts/doctype/sales_invoice/sales_invoice.js b/erpnext/accounts/doctype/sales_invoice/sales_invoice.js index 1564b48c68..0b6e2afadb 100644 --- a/erpnext/accounts/doctype/sales_invoice/sales_invoice.js +++ b/erpnext/accounts/doctype/sales_invoice/sales_invoice.js @@ -321,6 +321,7 @@ cur_frm.cscript.hide_fields = function(doc) { cur_frm.cscript.update_stock = function(doc, dt, dn) { cur_frm.cscript.hide_fields(doc, dt, dn); + this.frm.fields_dict.items.grid.toggle_reqd("item_code", doc.update_stock? true: false) } cur_frm.cscript['Make Delivery Note'] = function() { diff --git a/erpnext/public/js/controllers/transaction.js b/erpnext/public/js/controllers/transaction.js index 4e08287004..f8aa7cff57 100644 --- a/erpnext/public/js/controllers/transaction.js +++ b/erpnext/public/js/controllers/transaction.js @@ -1047,5 +1047,4 @@ erpnext.TransactionController = erpnext.taxes_and_totals.extend({ return method }, - }); \ No newline at end of file From 414c0ab3bbefbf7f9e48025222078aeb4a74c6b0 Mon Sep 17 00:00:00 2001 From: Rohit Waghchaure Date: Fri, 17 Mar 2017 17:19:17 +0530 Subject: [PATCH 02/15] [fix] Quantity is not copying in the Received Qty during making of debit note --- erpnext/buying/doctype/purchase_common/purchase_common.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/erpnext/buying/doctype/purchase_common/purchase_common.js b/erpnext/buying/doctype/purchase_common/purchase_common.js index 47cdefc581..6074cc690a 100644 --- a/erpnext/buying/doctype/purchase_common/purchase_common.js +++ b/erpnext/buying/doctype/purchase_common/purchase_common.js @@ -139,7 +139,7 @@ erpnext.buying.BuyingController = erpnext.TransactionController.extend({ qty: function(doc, cdt, cdn) { var item = frappe.get_doc(cdt, cdn); - if ((doc.doctype == "Purchase Receipt") || (doc.doctype == "Purchase Invoice" && doc.update_stock)) { + if ((doc.doctype == "Purchase Receipt") || (doc.doctype == "Purchase Invoice" && (doc.update_stock || doc.is_return))) { frappe.model.round_floats_in(item, ["qty", "received_qty"]); if(!item.rejected_qty && item.qty) { item.received_qty = item.qty; From b69d311268e07da2cd398f3b03a568e5e71b1032 Mon Sep 17 00:00:00 2001 From: Rohit Waghchaure Date: Mon, 20 Mar 2017 16:30:34 +0530 Subject: [PATCH 03/15] [fix] precision issue during making of depreciation schedule --- erpnext/accounts/doctype/asset/asset.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/erpnext/accounts/doctype/asset/asset.py b/erpnext/accounts/doctype/asset/asset.py index 9caac071f9..88a52e7d01 100644 --- a/erpnext/accounts/doctype/asset/asset.py +++ b/erpnext/accounts/doctype/asset/asset.py @@ -112,8 +112,8 @@ class Asset(Document): def set_accumulated_depreciation(self): accumulated_depreciation = flt(self.opening_accumulated_depreciation) for d in self.get("schedules"): - accumulated_depreciation += flt(d.depreciation_amount) - d.accumulated_depreciation_amount = accumulated_depreciation + accumulated_depreciation += flt(d.depreciation_amount, d.precision("depreciation_amount")) + d.accumulated_depreciation_amount = flt(accumulated_depreciation, d.precision("accumulated_depreciation_amount")) def get_depreciation_amount(self, depreciable_value): if self.depreciation_method in ("Straight Line", "Manual"): From 6ee91ec9c6835e25dcea659067f3acd3fb24321b Mon Sep 17 00:00:00 2001 From: Rohit Waghchaure Date: Tue, 21 Mar 2017 15:55:09 +0530 Subject: [PATCH 04/15] on selection of row highlight the background in the cart --- erpnext/accounts/page/pos/pos.js | 3 ++- erpnext/public/js/pos/pos_bill_item_new.html | 2 +- erpnext/public/js/pos/pos_selected_item.html | 12 ++++++------ 3 files changed, 9 insertions(+), 8 deletions(-) diff --git a/erpnext/accounts/page/pos/pos.js b/erpnext/accounts/page/pos/pos.js index c02100029b..8d9efeaf12 100644 --- a/erpnext/accounts/page/pos/pos.js +++ b/erpnext/accounts/page/pos/pos.js @@ -1339,7 +1339,8 @@ erpnext.pos.PointOfSale = erpnext.taxes_and_totals.extend({ projected_qty: d.projected_qty, rate: format_number(d.rate, me.frm.doc.currency), enabled: me.pos_profile_data["allow_user_to_edit_rate"] ? true : false, - amount: format_currency(d.amount, me.frm.doc.currency) + amount: format_currency(d.amount, me.frm.doc.currency), + selected_class: (me.item_code == d.item_code) ? "active" : "" })).appendTo($items); }); diff --git a/erpnext/public/js/pos/pos_bill_item_new.html b/erpnext/public/js/pos/pos_bill_item_new.html index 80a33d49fc..cb626cefce 100644 --- a/erpnext/public/js/pos/pos_bill_item_new.html +++ b/erpnext/public/js/pos/pos_bill_item_new.html @@ -1,4 +1,4 @@ -
+
{{ strip_html(__(item_name)) || item_code }} diff --git a/erpnext/public/js/pos/pos_selected_item.html b/erpnext/public/js/pos/pos_selected_item.html index dfc9915f04..65e4ef18b4 100644 --- a/erpnext/public/js/pos/pos_selected_item.html +++ b/erpnext/public/js/pos/pos_selected_item.html @@ -1,22 +1,22 @@
Quantity:
- +
Price List Rate:
- +
Discount:
- +
Price:
- -
+ +
Amount:
- +
\ No newline at end of file From 57f35a25a1c8725aa2ac55c4b959024a01bd22f7 Mon Sep 17 00:00:00 2001 From: Rohit Waghchaure Date: Thu, 23 Mar 2017 14:55:52 +0530 Subject: [PATCH 05/15] [fix] UnpickleError, removed _ method from the argument of the function --- erpnext/accounts/utils.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/erpnext/accounts/utils.py b/erpnext/accounts/utils.py index b7fef75de8..a64464ffc2 100644 --- a/erpnext/accounts/utils.py +++ b/erpnext/accounts/utils.py @@ -44,8 +44,8 @@ def get_fiscal_years(transaction_date=None, fiscal_year=None, label="Date", verb raise FiscalYearError, error_msg return fy -def validate_fiscal_year(date, fiscal_year, label=_("Date"), doc=None): - years = [f[0] for f in get_fiscal_years(date, label=label)] +def validate_fiscal_year(date, fiscal_year, label="Date", doc=None): + years = [f[0] for f in get_fiscal_years(date, label=_(label))] if fiscal_year not in years: if doc: doc.fiscal_year = years[0] From b719dc53fce60495b5992a6a2be65495dbd13d0d Mon Sep 17 00:00:00 2001 From: Rohit Waghchaure Date: Thu, 23 Mar 2017 17:04:00 +0530 Subject: [PATCH 06/15] [fix] customer edit and numeric keypad visibility issue in the pos --- erpnext/accounts/doctype/sales_invoice/pos.py | 14 +++- erpnext/accounts/page/pos/pos.js | 67 ++++++++++++------- 2 files changed, 55 insertions(+), 26 deletions(-) diff --git a/erpnext/accounts/doctype/sales_invoice/pos.py b/erpnext/accounts/doctype/sales_invoice/pos.py index 49e2f15daa..59766bd7b2 100644 --- a/erpnext/accounts/doctype/sales_invoice/pos.py +++ b/erpnext/accounts/doctype/sales_invoice/pos.py @@ -170,6 +170,9 @@ def get_customers_list(pos_profile): def get_customers_address(customers): customer_address = {} + if isinstance(customers, basestring): + customers = [frappe._dict({'name': customers})] + for data in customers: address = frappe.db.sql(""" select name, address_line1, address_line2, city, state, email_id, phone, fax, pincode from `tabAddress` where is_primary_address =1 and name in @@ -292,6 +295,7 @@ def make_invoice(doc_list={}, email_queue_list={}, customers_list={}): if not frappe.db.exists('Sales Invoice', {'offline_pos_name': name}): validate_records(doc) si_doc = frappe.new_doc('Sales Invoice') + si_doc.due_date = doc.get('posting_date') si_doc.offline_pos_name = name si_doc.update(doc) submit_invoice(si_doc, name, doc) @@ -328,10 +332,16 @@ def add_customer(name): customer_doc.flags.ignore_mandatory = True customer_doc.save(ignore_permissions = True) frappe.db.commit() + return customer_doc.name def make_address(args, customer): - if args.get('name'): - address = frappe.get_doc('Address', args.get('name')) + if not args.get('address_line1'): return + + name = args.get('name') or get_customers_address(customer)[customer].get("name") + + if name: + address = frappe.get_doc('Address', name) + frappe.errprint(address) else: address = frappe.new_doc('Address') address.country = frappe.db.get_value('Company', args.get('company'), 'country') diff --git a/erpnext/accounts/page/pos/pos.js b/erpnext/accounts/page/pos/pos.js index 8d9efeaf12..fb89d7e452 100644 --- a/erpnext/accounts/page/pos/pos.js +++ b/erpnext/accounts/page/pos/pos.js @@ -475,6 +475,7 @@ erpnext.pos.PointOfSale = erpnext.taxes_and_totals.extend({ this.pos_bill = this.wrapper.find('.pos-bill-wrapper').hide(); this.list_customers = this.wrapper.find('.list-customers'); this.numeric_keypad = this.wrapper.find('.numeric_keypad'); + this.list_customers_btn.addClass("view_customer") me.render_list_customers(); me.toggle_totals_area(false); @@ -495,9 +496,7 @@ erpnext.pos.PointOfSale = erpnext.taxes_and_totals.extend({ me.toggle_totals_area(false); me.toggle_delete_button() me.list_customers.hide(); - if(me.frm.doc.items.length > 0) { - me.numeric_keypad.show(); - } + me.numeric_keypad.show(); } }); this.add_customer_btn.on('click', function() { @@ -694,7 +693,8 @@ erpnext.pos.PointOfSale = erpnext.taxes_and_totals.extend({ .get(0); } }); - var customers = this.customers.map(function (c) { + + this.customers_mapper = this.customers.map(function (c) { return { label: c.name, value: c.name, @@ -703,7 +703,7 @@ erpnext.pos.PointOfSale = erpnext.taxes_and_totals.extend({ } }); - customers.push({ + this.customers_mapper.push({ label: "" + " " + __("Create a new Customer") @@ -711,11 +711,11 @@ erpnext.pos.PointOfSale = erpnext.taxes_and_totals.extend({ value: 'is_action', action: me.add_customer }); - this.party_field.awesomeplete.list = customers; + this.autocomplete_customers(); this.party_field.$input .on('input', function (e) { - me.party_field.awesomeplete.list = customers; + me.party_field.awesomeplete.list = this.customers_mapper; }) .on('awesomplete-select', function (e) { var customer = me.party_field.awesomeplete @@ -731,6 +731,7 @@ erpnext.pos.PointOfSale = erpnext.taxes_and_totals.extend({ me.update_customer_data(customer); me.refresh(); me.set_focus(); + me.list_customers_btn.removeClass("view_customer"); }) .on('focus', function (e) { $(e.target).val('').trigger('input'); @@ -754,6 +755,10 @@ erpnext.pos.PointOfSale = erpnext.taxes_and_totals.extend({ }); }, + autocomplete_customers: function() { + this.party_field.awesomeplete.list = this.customers_mapper; + }, + toggle_edit_button: function(flag) { this.page.wrapper.find('.edit-customer-btn').toggle(flag); }, @@ -768,10 +773,10 @@ erpnext.pos.PointOfSale = erpnext.taxes_and_totals.extend({ add_customer: function() { this.frm.doc.customer = ""; - this.update_customer() + this.update_customer(true) }, - update_customer: function () { + update_customer: function (new_customer) { var me = this; if (!this.connection_status) return; @@ -844,14 +849,14 @@ erpnext.pos.PointOfSale = erpnext.taxes_and_totals.extend({ this.render_address_data() this.customer_doc.set_primary_action(__("Save"), function () { - me.make_offline_customer(); + me.make_offline_customer(new_customer); me.pos_bill.show(); }); }, render_address_data: function() { var me = this; - this.address_data = this.address[this.frm.doc.customer] || this.get_address_from_localstorage(); + this.address_data = this.address[this.frm.doc.customer]; this.customer_doc.set_values(this.address_data) if(!this.customer_doc.fields_dict.full_name.$input.val()) { @@ -864,20 +869,32 @@ erpnext.pos.PointOfSale = erpnext.taxes_and_totals.extend({ return this.address_details[this.frm.doc.customer] }, - make_offline_customer: function() { + make_offline_customer: function(new_customer) { this.frm.doc.customer = this.frm.doc.customer || this.customer_doc.get_values().full_name; this.customer_details = this.get_customers_details(); this.customer_details[this.frm.doc.customer] = this.get_prompt_details(); this.party_field.$input.val(this.frm.doc.customer); - this.customers.push({ - name: this.frm.doc.customer, - customer_name: this.frm.doc.customer - }); + this.update_address_and_customer_list(new_customer) + this.autocomplete_customers(); this.update_customer_in_localstorage() this.update_customer_in_localstorage() this.customer_doc.hide() }, + update_address_and_customer_list: function(new_customer) { + var me = this; + if(new_customer) { + this.customers_mapper.push({ + label: this.frm.doc.customer, + value: this.frm.doc.customer, + customer_group: "", + territory: "" + }); + } + + this.address[this.frm.doc.customer] = this.customer_doc.get_values(); + }, + get_prompt_details: function() { this.prompt_details = this.customer_doc.get_values(); this.prompt_details['country'] = this.pos_profile_data.country; @@ -1072,7 +1089,7 @@ erpnext.pos.PointOfSale = erpnext.taxes_and_totals.extend({ // if form is local then allow this function // $(me.wrapper).find(".pos-item-wrapper").on("click", function () { $(this.wrapper).on("click", ".pos-item-wrapper", function () { - if(me.list_customers_btn.hasClass("view_customer")) return; + if($(me.pos_bill).is(":hidden")) return; me.customer_validate(); if (me.frm.doc.docstatus == 0) { @@ -1221,7 +1238,7 @@ erpnext.pos.PointOfSale = erpnext.taxes_and_totals.extend({ customer_validate: function () { var me = this; - if (!this.frm.doc.customer) { + if (!this.frm.doc.customer || this.party_field.get_value() == "") { frappe.throw(__("Please select customer")) } }, @@ -1458,12 +1475,14 @@ erpnext.pos.PointOfSale = erpnext.taxes_and_totals.extend({ sn = data.serial_no.split('\n') if(sn.length) { serial_no_list = me.serial_no_data[data.item_code] - $.each(sn, function(i, serial_no) { - if(in_list(Object.keys(serial_no_list), serial_no)) { - delete serial_no_list[serial_no] - } - }) - me.serial_no_data[data.item_code] = serial_no_list; + if(serial_no_list) { + $.each(sn, function(i, serial_no) { + if(in_list(Object.keys(serial_no_list), serial_no)) { + delete serial_no_list[serial_no] + } + }) + me.serial_no_data[data.item_code] = serial_no_list; + } } }) }, From f74b02140cbc8677907cd8e83d39aef7b6a3776c Mon Sep 17 00:00:00 2001 From: Rohit Waghchaure Date: Fri, 24 Mar 2017 17:37:02 +0530 Subject: [PATCH 07/15] [fix] Purchase analytics report not loading --- erpnext/startup/report_data_map.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/erpnext/startup/report_data_map.py b/erpnext/startup/report_data_map.py index e4bbd8744e..ffdc66d555 100644 --- a/erpnext/startup/report_data_map.py +++ b/erpnext/startup/report_data_map.py @@ -241,7 +241,7 @@ data_map = { } }, "Purchase Invoice Item": { - "columns": ["name", "parent", "item_code", "stock_qty as qty", "base_net_amount"], + "columns": ["name", "parent", "item_code", "(qty * conversion_factor) as qty", "base_net_amount"], "conditions": ["docstatus=1", "ifnull(parent, '')!=''"], "order_by": "parent", "links": { From 3938c61996bc4be229eb2c6206f9606955669f13 Mon Sep 17 00:00:00 2001 From: Dominik Ottenbreit Date: Fri, 24 Mar 2017 14:24:34 +0100 Subject: [PATCH 08/15] migrate from manufacturer to manufacturer childtable --- erpnext/patches.txt | 2 + erpnext/patches/v8_0/__init__.py | 0 .../v8_0/manufacturer_childtable_migrate.py | 17 +++ erpnext/stock/doctype/item/item.json | 122 +++++++++--------- 4 files changed, 80 insertions(+), 61 deletions(-) create mode 100644 erpnext/patches/v8_0/__init__.py create mode 100644 erpnext/patches/v8_0/manufacturer_childtable_migrate.py diff --git a/erpnext/patches.txt b/erpnext/patches.txt index 0e34ee61b3..3c2a372794 100644 --- a/erpnext/patches.txt +++ b/erpnext/patches.txt @@ -379,3 +379,5 @@ erpnext.patches.v7_2.update_attendance_docstatus erpnext.patches.v7_2.move_dates_from_salary_structure_to_employee erpnext.patches.v7_2.make_all_assessment_group erpnext.patches.v7_2.stock_uom_in_selling + +erpnext.patches.v8_0.manufacturer_childtable_migrate diff --git a/erpnext/patches/v8_0/__init__.py b/erpnext/patches/v8_0/__init__.py new file mode 100644 index 0000000000..e69de29bb2 diff --git a/erpnext/patches/v8_0/manufacturer_childtable_migrate.py b/erpnext/patches/v8_0/manufacturer_childtable_migrate.py new file mode 100644 index 0000000000..6bb788063a --- /dev/null +++ b/erpnext/patches/v8_0/manufacturer_childtable_migrate.py @@ -0,0 +1,17 @@ +# Copyright (c) 2013, Web Notes Technologies Pvt. Ltd. and Contributors +# License: GNU General Public License v3. See license.txt + +from __future__ import unicode_literals +import frappe + +def execute(): + item_manufacturers = frappe.get_all("Item", fields=["name", "manufacturer", "manufacturer_part_no"]) + for item in item_manufacturers: + item_doc = frappe.get_doc("Item", item.name) + item_doc.append("manufacturers", { + "manufacturer": item.manufacturer, + "manufacturer_part_no": item.manufacturer_part_no + }) + item_doc.flags.ignore_validate = True + item_doc.flags.ignore_mandatory = True + item_doc.save() diff --git a/erpnext/stock/doctype/item/item.json b/erpnext/stock/doctype/item/item.json index db327cc23f..eb3786426a 100644 --- a/erpnext/stock/doctype/item/item.json +++ b/erpnext/stock/doctype/item/item.json @@ -1528,6 +1528,65 @@ "set_only_once": 0, "unique": 0 }, + { + "allow_on_submit": 0, + "bold": 0, + "collapsible": 1, + "columns": 0, + "fieldname": "manufacturer_details", + "fieldtype": "Section Break", + "hidden": 0, + "ignore_user_permissions": 0, + "ignore_xss_filter": 0, + "in_filter": 0, + "in_global_search": 0, + "in_list_view": 0, + "in_standard_filter": 0, + "label": "Manufacturer Details", + "length": 0, + "no_copy": 0, + "permlevel": 0, + "precision": "", + "print_hide": 0, + "print_hide_if_no_value": 0, + "read_only": 0, + "remember_last_selected_value": 0, + "report_hide": 0, + "reqd": 0, + "search_index": 0, + "set_only_once": 0, + "unique": 0 + }, + { + "allow_on_submit": 0, + "bold": 0, + "collapsible": 0, + "columns": 0, + "fieldname": "manufacturers", + "fieldtype": "Table", + "hidden": 0, + "ignore_user_permissions": 0, + "ignore_xss_filter": 0, + "in_filter": 0, + "in_global_search": 0, + "in_list_view": 0, + "in_standard_filter": 0, + "label": "Item Manufacturers", + "length": 0, + "no_copy": 0, + "options": "Item Manufacturer", + "permlevel": 0, + "precision": "", + "print_hide": 0, + "print_hide_if_no_value": 0, + "read_only": 0, + "remember_last_selected_value": 0, + "report_hide": 0, + "reqd": 0, + "search_index": 0, + "set_only_once": 0, + "unique": 0 + }, { "allow_on_submit": 0, "bold": 0, @@ -1617,65 +1676,6 @@ "set_only_once": 0, "unique": 0 }, - { - "allow_on_submit": 0, - "bold": 0, - "collapsible": 0, - "columns": 0, - "depends_on": "", - "fieldname": "manufacturer", - "fieldtype": "Link", - "hidden": 0, - "ignore_user_permissions": 0, - "ignore_xss_filter": 0, - "in_filter": 0, - "in_global_search": 0, - "in_list_view": 0, - "in_standard_filter": 0, - "label": "Manufacturer", - "length": 0, - "no_copy": 0, - "options": "Manufacturer", - "permlevel": 0, - "print_hide": 0, - "print_hide_if_no_value": 0, - "read_only": 0, - "remember_last_selected_value": 0, - "report_hide": 0, - "reqd": 0, - "search_index": 0, - "set_only_once": 0, - "unique": 0 - }, - { - "allow_on_submit": 0, - "bold": 0, - "collapsible": 0, - "columns": 0, - "depends_on": "", - "fieldname": "manufacturer_part_no", - "fieldtype": "Data", - "hidden": 0, - "ignore_user_permissions": 0, - "ignore_xss_filter": 0, - "in_filter": 0, - "in_global_search": 0, - "in_list_view": 0, - "in_standard_filter": 0, - "label": "Manufacturer Part Number", - "length": 0, - "no_copy": 0, - "permlevel": 0, - "print_hide": 0, - "print_hide_if_no_value": 0, - "read_only": 0, - "remember_last_selected_value": 0, - "report_hide": 0, - "reqd": 0, - "search_index": 0, - "set_only_once": 0, - "unique": 0 - }, { "allow_on_submit": 0, "bold": 0, @@ -2837,8 +2837,8 @@ "issingle": 0, "istable": 0, "max_attachments": 1, - "modified": "2017-03-21 21:03:10.715674", - "modified_by": "Administrator", + "modified": "2017-03-24 14:07:02.172008", + "modified_by": "d.ottenbreit@eso-electronic.de", "module": "Stock", "name": "Item", "owner": "Administrator", From 6eb202ef3a57eda9f3b9f81569804d05d155e5e3 Mon Sep 17 00:00:00 2001 From: Dominik Ottenbreit Date: Fri, 24 Mar 2017 14:49:52 +0100 Subject: [PATCH 09/15] fix patch after test, fix variant based on manufacturer, add json for item_manufacturer --- erpnext/controllers/item_variant.py | 6 +- .../v8_0/manufacturer_childtable_migrate.py | 26 +++-- erpnext/stock/doctype/item/item.json | 6 +- .../doctype/item_manufacturer/__init__.py | 0 .../item_manufacturer/item_manufacturer.json | 100 ++++++++++++++++++ .../item_manufacturer/item_manufacturer.py | 10 ++ 6 files changed, 134 insertions(+), 14 deletions(-) create mode 100644 erpnext/stock/doctype/item_manufacturer/__init__.py create mode 100644 erpnext/stock/doctype/item_manufacturer/item_manufacturer.json create mode 100644 erpnext/stock/doctype/item_manufacturer/item_manufacturer.py diff --git a/erpnext/controllers/item_variant.py b/erpnext/controllers/item_variant.py index 53421b71bc..c21ee000f5 100644 --- a/erpnext/controllers/item_variant.py +++ b/erpnext/controllers/item_variant.py @@ -42,8 +42,10 @@ def make_variant_based_on_manufacturer(template, manufacturer, manufacturer_part copy_attributes_to_variant(template, variant) - variant.manufacturer = manufacturer - variant.manufacturer_part_no = manufacturer_part_no + variant.append("manufacturers", { + "manufacturer": manufacturer, + "manufacturer_part_no": manufacturer_part_no + }) variant.item_code = append_number_if_name_exists('Item', template.name) diff --git a/erpnext/patches/v8_0/manufacturer_childtable_migrate.py b/erpnext/patches/v8_0/manufacturer_childtable_migrate.py index 6bb788063a..6d566b45bb 100644 --- a/erpnext/patches/v8_0/manufacturer_childtable_migrate.py +++ b/erpnext/patches/v8_0/manufacturer_childtable_migrate.py @@ -1,17 +1,25 @@ -# Copyright (c) 2013, Web Notes Technologies Pvt. Ltd. and Contributors +# Copyright (c) 2017, Frappe and Contributors # License: GNU General Public License v3. See license.txt from __future__ import unicode_literals import frappe def execute(): + + # reading from json and writing it to mariadb + # reload_doc needed here with information because new table introduced + frappe.reload_doc('stock', 'doctype', 'item_manufacturer') + # reload_doctype is a simpler concept of reload_doc + frappe.reload_doctype('Item') + item_manufacturers = frappe.get_all("Item", fields=["name", "manufacturer", "manufacturer_part_no"]) for item in item_manufacturers: - item_doc = frappe.get_doc("Item", item.name) - item_doc.append("manufacturers", { - "manufacturer": item.manufacturer, - "manufacturer_part_no": item.manufacturer_part_no - }) - item_doc.flags.ignore_validate = True - item_doc.flags.ignore_mandatory = True - item_doc.save() + if item.manufacturer or item.manufacturer_part_no: + item_doc = frappe.get_doc("Item", item.name) + item_doc.append("manufacturers", { + "manufacturer": item.manufacturer, + "manufacturer_part_no": item.manufacturer_part_no + }) + item_doc.flags.ignore_validate = True + item_doc.flags.ignore_mandatory = True + item_doc.save() diff --git a/erpnext/stock/doctype/item/item.json b/erpnext/stock/doctype/item/item.json index eb3786426a..f75b89fe02 100644 --- a/erpnext/stock/doctype/item/item.json +++ b/erpnext/stock/doctype/item/item.json @@ -1533,7 +1533,7 @@ "bold": 0, "collapsible": 1, "columns": 0, - "fieldname": "manufacturer_details", + "fieldname": "manufacturer_part_numbers", "fieldtype": "Section Break", "hidden": 0, "ignore_user_permissions": 0, @@ -1542,7 +1542,7 @@ "in_global_search": 0, "in_list_view": 0, "in_standard_filter": 0, - "label": "Manufacturer Details", + "label": "Manufacturer Part Numbers", "length": 0, "no_copy": 0, "permlevel": 0, @@ -2837,7 +2837,7 @@ "issingle": 0, "istable": 0, "max_attachments": 1, - "modified": "2017-03-24 14:07:02.172008", + "modified": "2017-03-24 14:41:03.395811", "modified_by": "d.ottenbreit@eso-electronic.de", "module": "Stock", "name": "Item", diff --git a/erpnext/stock/doctype/item_manufacturer/__init__.py b/erpnext/stock/doctype/item_manufacturer/__init__.py new file mode 100644 index 0000000000..e69de29bb2 diff --git a/erpnext/stock/doctype/item_manufacturer/item_manufacturer.json b/erpnext/stock/doctype/item_manufacturer/item_manufacturer.json new file mode 100644 index 0000000000..aa3469141d --- /dev/null +++ b/erpnext/stock/doctype/item_manufacturer/item_manufacturer.json @@ -0,0 +1,100 @@ +{ + "allow_copy": 0, + "allow_guest_to_view": 0, + "allow_import": 0, + "allow_rename": 0, + "beta": 0, + "creation": "2017-03-24 14:05:42.026237", + "custom": 0, + "docstatus": 0, + "doctype": "DocType", + "document_type": "", + "editable_grid": 1, + "engine": "InnoDB", + "fields": [ + { + "allow_on_submit": 0, + "bold": 0, + "collapsible": 0, + "columns": 0, + "fieldname": "manufacturer", + "fieldtype": "Link", + "hidden": 0, + "ignore_user_permissions": 0, + "ignore_xss_filter": 0, + "in_filter": 0, + "in_global_search": 0, + "in_list_view": 1, + "in_standard_filter": 0, + "label": "Manufacturer", + "length": 0, + "no_copy": 0, + "options": "Manufacturer", + "permlevel": 0, + "precision": "", + "print_hide": 0, + "print_hide_if_no_value": 0, + "read_only": 0, + "remember_last_selected_value": 0, + "report_hide": 0, + "reqd": 1, + "search_index": 0, + "set_only_once": 0, + "unique": 0 + }, + { + "allow_on_submit": 0, + "bold": 0, + "collapsible": 0, + "columns": 0, + "fieldname": "manufacturer_part_no", + "fieldtype": "Data", + "hidden": 0, + "ignore_user_permissions": 0, + "ignore_xss_filter": 0, + "in_filter": 0, + "in_global_search": 0, + "in_list_view": 1, + "in_standard_filter": 0, + "label": "Manufacturer Part Number", + "length": 0, + "no_copy": 0, + "permlevel": 0, + "precision": "", + "print_hide": 0, + "print_hide_if_no_value": 0, + "read_only": 0, + "remember_last_selected_value": 0, + "report_hide": 0, + "reqd": 0, + "search_index": 0, + "set_only_once": 0, + "unique": 0 + } + ], + "has_web_view": 0, + "hide_heading": 0, + "hide_toolbar": 0, + "idx": 0, + "image_view": 0, + "in_create": 0, + "is_submittable": 0, + "issingle": 0, + "istable": 1, + "max_attachments": 0, + "modified": "2017-03-24 14:33:56.726460", + "modified_by": "d.ottenbreit@eso-electronic.de", + "module": "Stock", + "name": "Item Manufacturer", + "name_case": "", + "owner": "d.ottenbreit@eso-electronic.de", + "permissions": [], + "quick_entry": 1, + "read_only": 0, + "read_only_onload": 0, + "show_name_in_global_search": 0, + "sort_field": "modified", + "sort_order": "DESC", + "track_changes": 1, + "track_seen": 0 +} \ No newline at end of file diff --git a/erpnext/stock/doctype/item_manufacturer/item_manufacturer.py b/erpnext/stock/doctype/item_manufacturer/item_manufacturer.py new file mode 100644 index 0000000000..933f7cc36a --- /dev/null +++ b/erpnext/stock/doctype/item_manufacturer/item_manufacturer.py @@ -0,0 +1,10 @@ +# -*- coding: utf-8 -*- +# Copyright (c) 2017, Frappe Technologies Pvt. Ltd. and contributors +# For license information, please see license.txt + +from __future__ import unicode_literals +import frappe +from frappe.model.document import Document + +class ItemManufacturer(Document): + pass From ea617da27740613e43fca6445c402bd8e30d18bf Mon Sep 17 00:00:00 2001 From: Dominik Ottenbreit Date: Fri, 24 Mar 2017 15:24:55 +0100 Subject: [PATCH 10/15] fix translations that have to do with term 'close' which was not well translated --- erpnext/translations/de.csv | 47 +++++++++++++++++++------------------ 1 file changed, 24 insertions(+), 23 deletions(-) diff --git a/erpnext/translations/de.csv b/erpnext/translations/de.csv index 77032110ad..0bd991cb96 100644 --- a/erpnext/translations/de.csv +++ b/erpnext/translations/de.csv @@ -518,7 +518,7 @@ apps/erpnext/erpnext/stock/dashboard/item_dashboard_list.html +25,Acutal Qty {0} DocType: Timesheet Detail,Hrs,Std apps/erpnext/erpnext/accounts/doctype/journal_entry/journal_entry.js +317,Please select Company,Bitte Firma auswählen DocType: Stock Entry Detail,Difference Account,Differenzkonto -apps/erpnext/erpnext/projects/doctype/task/task.py +46,Cannot close task as its dependant task {0} is not closed.,"Aufgabe kann nicht geschlossen werden, da die von ihr abhängige Aufgabe {0} nicht geschlossen ist." +apps/erpnext/erpnext/projects/doctype/task/task.py +46,Cannot close task as its dependant task {0} is not closed.,"Aufgabe kann nicht abgeschlossen werden, da die von ihr abhängige Aufgabe {0} nicht abgeschlossen ist." apps/erpnext/erpnext/manufacturing/doctype/production_planning_tool/production_planning_tool.py +433,Please enter Warehouse for which Material Request will be raised,"Bitte das Lager eingeben, für das eine Materialanfrage erhoben wird" DocType: Production Order,Additional Operating Cost,Zusätzliche Betriebskosten apps/erpnext/erpnext/setup/setup_wizard/industry_type.py +20,Cosmetics,Kosmetika @@ -775,7 +775,7 @@ The tax rate you define here will be the standard tax rate for all **Items**. If #### Description of Columns -1. Calculation Type: +1. Calculation Type: - This can be on **Net Total** (that is the sum of basic amount). - **On Previous Row Total / Amount** (for cumulative taxes or charges). If you select this option, the tax will be applied as a percentage of the previous row (in the tax table) amount or total. - **Actual** (as mentioned). @@ -786,15 +786,15 @@ The tax rate you define here will be the standard tax rate for all **Items**. If 6. Amount: Tax amount. 7. Total: Cumulative total to this point. 8. Enter Row: If based on ""Previous Row Total"" you can select the row number which will be taken as a base for this calculation (default is the previous row). -9. Is this Tax included in Basic Rate?: If you check this, it means that this tax will not be shown below the item table, but will be included in the Basic Rate in your main item table. This is useful where you want give a flat price (inclusive of all taxes) price to customers.","Standard-Steuer-Vorlage, die für alle Kauftransaktionen angewandt werden kann. Diese Vorlage kann eine Liste der Steuern und auch anderer Kosten wie ""Versand"", ""Versicherung"", ""Handhabung"" usw. enthalten. +9. Is this Tax included in Basic Rate?: If you check this, it means that this tax will not be shown below the item table, but will be included in the Basic Rate in your main item table. This is useful where you want give a flat price (inclusive of all taxes) price to customers.","Standard-Steuer-Vorlage, die für alle Kauftransaktionen angewandt werden kann. Diese Vorlage kann eine Liste der Steuern und auch anderer Kosten wie ""Versand"", ""Versicherung"", ""Handhabung"" usw. enthalten. - #### Hinweis + #### Hinweis Der Steuersatz, den sie hier definieren, wird der Standardsteuersatz für alle Artikel. Wenn es Artikel mit davon abweichenden Steuersätzen gibt, müssen diese in der Tabelle ""Artikelsteuer"" im Artikelstamm hinzugefügt werden. - #### Beschreibung der Spalten + #### Beschreibung der Spalten -1. Berechnungsart: +1. Berechnungsart: - Dies kann sein ""Auf Nettosumme"" (das ist die Summe der Grundbeträge). - ""Auf vorherige Zeilensumme/-Betrag"" (für kumulative Steuern oder Abgaben). Wenn diese Option ausgewählt wird, wird die Steuer als Prozentsatz der vorherigen Zeilesumme/des vorherigen Zeilenbetrags (in der Steuertabelle) angewendet. - ""Unmittelbar"" (wie bereits erwähnt). @@ -1010,7 +1010,7 @@ apps/erpnext/erpnext/accounts/doctype/c_form/c_form.py +30,"Row {0}: Invoice {1} apps/erpnext/erpnext/accounts/doctype/journal_entry/journal_entry.py +125,Row {0}: Payment against Sales/Purchase Order should always be marked as advance,"Zeile {0}: ""Zahlung zu Kunden-/Lieferantenauftrag"" sollte immer als ""Vorkasse"" eingestellt werden" apps/erpnext/erpnext/setup/setup_wizard/industry_type.py +16,Chemical,Chemische Industrie DocType: Salary Component Account,Default Bank / Cash account will be automatically updated in Salary Journal Entry when this mode is selected.,"Standard Bank / Geldkonto wird automatisch in Gehalts Journal Entry aktualisiert werden, wenn dieser Modus ausgewählt ist." -apps/erpnext/erpnext/schools/doctype/grading_structure/grading_structure.py +24,"The intervals for Grade Code {0} overlaps with the grade intervals for other grades. +apps/erpnext/erpnext/schools/doctype/grading_structure/grading_structure.py +24,"The intervals for Grade Code {0} overlaps with the grade intervals for other grades. Please check intervals {0} and {1} and try again",Die Intervalle für Grade-Code {0} überlappt mit der Note Intervalle für andere Typen. Bitte überprüfen Sie Intervalle {0} und {1} und versuchen Sie es erneut DocType: BOM,Raw Material Cost(Company Currency),Rohstoffkosten (Gesellschaft Währung) apps/erpnext/erpnext/stock/doctype/stock_entry/stock_entry.py +715,All items have already been transferred for this Production Order.,Alle Artikel wurden schon für diesen Fertigungsauftrag übernommen. @@ -1430,7 +1430,7 @@ DocType: Rename Tool,Type of document to rename.,"Dokumententyp, der umbenannt w apps/erpnext/erpnext/public/js/setup_wizard.js +307,We buy this Item,Wir kaufen diesen Artikel apps/erpnext/erpnext/accounts/doctype/gl_entry/gl_entry.py +54,{0} {1}: Customer is required against Receivable account {2},{0} {1}: Der Kunde muss gegen Receivable Konto {2} DocType: Purchase Invoice,Total Taxes and Charges (Company Currency),Gesamte Steuern und Gebühren (Firmenwährung) -apps/erpnext/erpnext/accounts/report/trial_balance/trial_balance.js +60,Show unclosed fiscal year's P&L balances,Zeigen Sie nicht geschlossene Geschäftsjahr des P & L-Waagen +apps/erpnext/erpnext/accounts/report/trial_balance/trial_balance.js +60,Show unclosed fiscal year's P&L balances,Zeigen Sie nicht abgeschlossene Geschäftsjahr des P & L-Waagen DocType: Shipping Rule,Shipping Account,Versandkonto apps/erpnext/erpnext/accounts/doctype/gl_entry/gl_entry.py +93,{0} {1}: Account {2} is inactive,{0} {1}: Konto {2} ist inaktiv apps/erpnext/erpnext/utilities/activation.py +85,Make Sales Orders to help you plan your work and deliver on-time,Machen Sie Kundenaufträge Sie Ihre Arbeit planen und liefern on-time @@ -1468,7 +1468,7 @@ DocType: HR Settings,Email Salary Slip to Employee,E-Mail-Gehaltsabrechnung an M DocType: Cost Center,Parent Cost Center,Übergeordnete Kostenstelle apps/erpnext/erpnext/buying/doctype/request_for_quotation/request_for_quotation.js +816,Select Possible Supplier,Wählen Mögliche Lieferant DocType: Sales Invoice,Source,Quelle -apps/erpnext/erpnext/templates/pages/projects.html +31,Show closed,Zeige geschlossen +apps/erpnext/erpnext/templates/pages/projects.html +31,Show closed,Zeige abgeschlossen DocType: Leave Type,Is Leave Without Pay,Ist unbezahlter Urlaub apps/erpnext/erpnext/stock/doctype/item/item.py +237,Asset Category is mandatory for Fixed Asset item,Anlagekategorie ist obligatorisch für Posten des Anlagevermögens apps/erpnext/erpnext/accounts/doctype/payment_reconciliation/payment_reconciliation.py +145,No records found in the Payment table,"Keine Datensätze in der Tabelle ""Zahlungen"" gefunden" @@ -1578,7 +1578,7 @@ apps/erpnext/erpnext/manufacturing/doctype/production_order/production_order.py apps/erpnext/erpnext/accounts/doctype/payment_request/payment_request.py +23,Payment Request already exists {0},Zahlungsanordnung bereits vorhanden ist {0} apps/erpnext/erpnext/projects/report/project_wise_stock_tracking/project_wise_stock_tracking.py +27,Cost of Issued Items,Aufwendungen für in Umlauf gebrachte Artikel apps/erpnext/erpnext/manufacturing/doctype/production_order/production_order.js +246,Quantity must not be more than {0},Menge darf nicht mehr als {0} sein -apps/erpnext/erpnext/accounts/report/balance_sheet/balance_sheet.py +107,Previous Financial Year is not closed,Zurück Geschäftsjahr nicht geschlossen +apps/erpnext/erpnext/accounts/report/balance_sheet/balance_sheet.py +107,Previous Financial Year is not closed,Zurück Geschäftsjahr nicht abgeschlossen apps/erpnext/erpnext/accounts/report/accounts_receivable/accounts_receivable.py +44,Age (Days),Alter (Tage) DocType: Quotation Item,Quotation Item,Angebotsposition DocType: Account,Account Name,Kontenname @@ -2282,7 +2282,7 @@ DocType: Supplier Quotation,Opportunity,Chance DocType: Operation,Default Workstation,Standard-Arbeitsplatz DocType: Notification Control,Expense Claim Approved Message,Benachrichtigung über genehmigte Aufwandsabrechnung DocType: Payment Entry,Deductions or Loss,Abzüge oder Verlust -apps/erpnext/erpnext/accounts/doctype/journal_entry/journal_entry.py +240,{0} {1} is closed,{0} {1} ist geschlossen +apps/erpnext/erpnext/accounts/doctype/journal_entry/journal_entry.py +240,{0} {1} is closed,{0} {1} ist abgeschlossen DocType: Email Digest,How frequently?,Wie häufig? DocType: Purchase Receipt,Get Current Stock,Aktuellen Lagerbestand aufrufen apps/erpnext/erpnext/config/manufacturing.py +46,Tree of Bill of Materials,Stücklistenstruktur @@ -2326,7 +2326,7 @@ The tax rate you define here will be the standard tax rate for all **Items**. If #### Description of Columns -1. Calculation Type: +1. Calculation Type: - This can be on **Net Total** (that is the sum of basic amount). - **On Previous Row Total / Amount** (for cumulative taxes or charges). If you select this option, the tax will be applied as a percentage of the previous row (in the tax table) amount or total. - **Actual** (as mentioned). @@ -2338,15 +2338,15 @@ The tax rate you define here will be the standard tax rate for all **Items**. If 7. Total: Cumulative total to this point. 8. Enter Row: If based on ""Previous Row Total"" you can select the row number which will be taken as a base for this calculation (default is the previous row). 9. Consider Tax or Charge for: In this section you can specify if the tax / charge is only for valuation (not a part of total) or only for total (does not add value to the item) or for both. -10. Add or Deduct: Whether you want to add or deduct the tax.","Standard-Steuer-Vorlage, die für alle Kauftransaktionen angewandt werden kann. Diese Vorlage kann eine Liste der Steuern und auch anderer Kosten wie ""Versand"", ""Versicherung"", ""Handhabung"" usw. enthalten. +10. Add or Deduct: Whether you want to add or deduct the tax.","Standard-Steuer-Vorlage, die für alle Kauftransaktionen angewandt werden kann. Diese Vorlage kann eine Liste der Steuern und auch anderer Kosten wie ""Versand"", ""Versicherung"", ""Handhabung"" usw. enthalten. - #### Hinweis + #### Hinweis Der Steuersatz, den sie hier definieren, wird der Standardsteuersatz für alle Artikel. Wenn es Artikel mit davon abweichenden Steuersätzen gibt, müssen diese in der Tabelle ""Artikelsteuer"" im Artikelstamm hinzugefügt werden. - #### Beschreibung der Spalten + #### Beschreibung der Spalten -1. Berechnungsart: +1. Berechnungsart: - Dies kann sein ""Auf Nettosumme"" (das ist die Summe der Grundbeträge). - ""Auf vorherige Zeilensumme/-Betrag"" (für kumulative Steuern oder Abgaben). Wenn diese Option ausgewählt wird, wird die Steuer als Prozentsatz der vorherigen Zeilesumme/des vorherigen Zeilenbetrags (in der Steuertabelle) angewendet. - ""Unmittelbar"" (wie bereits erwähnt). @@ -2557,7 +2557,7 @@ Examples: 1. Ways of addressing disputes, indemnity, liability, etc. 1. Address and Contact of your Company.","Allgemeine Geschäftsbedingungen, die bei Ver- und Einkäufen verwendet werden können. - Beispiele: + Beispiele: 1. Gültigkeit des Angebots. 2. Zahlungsbedingungen (Vorkasse, auf Rechnung, Teilweise Vorkasse usw.) @@ -2566,7 +2566,7 @@ Examples: 5. Garantie, falls vorhanden. 6. Rückgabebedingungen. 7. Lieferbedingungen, falls zutreffend. -8. Beschwerdemanagement, Schadensersatz, Haftung usw. +8. Beschwerdemanagement, Schadensersatz, Haftung usw. 9. Adresse und Kontaktdaten des Unternehmens." DocType: Attendance,Leave Type,Urlaubstyp apps/erpnext/erpnext/controllers/stock_controller.py +222,Expense / Difference account ({0}) must be a 'Profit or Loss' account,"Aufwands-/Differenz-Konto ({0}) muss ein ""Gewinn oder Verlust""-Konto sein" @@ -2583,6 +2583,7 @@ DocType: Bin,FCFS Rate,"""Wer-zuerst-kommt-mahlt-zuerst""-Anteil (Windhundverfah DocType: Payment Reconciliation Invoice,Outstanding Amount,Ausstehender Betrag apps/erpnext/erpnext/templates/generators/bom.html +71,Time(in mins),Zeit (in Min) DocType: Project Task,Working,In Bearbeitung +DocType: Project Task,Closed,Abgeschlossen DocType: Stock Ledger Entry,Stock Queue (FIFO),Lagerverfahren (FIFO) apps/erpnext/erpnext/accounts/doctype/pos_profile/pos_profile.py +39,{0} does not belong to Company {1},{0} gehört nicht zu Firma {1} apps/erpnext/erpnext/accounts/report/asset_depreciations_and_balances/asset_depreciations_and_balances.py +119,Cost as on,"Kosten, da auf" @@ -2805,7 +2806,7 @@ apps/erpnext/erpnext/accounts/doctype/payment_entry/payment_entry.py +79,Party T DocType: Quality Inspection,Outgoing,Ausgang DocType: Material Request,Requested For,Angefordert für DocType: Quotation Item,Against Doctype,Zu DocType -apps/erpnext/erpnext/controllers/buying_controller.py +380,{0} {1} is cancelled or closed,{0} {1} wurde abgebrochen oder geschlossen +apps/erpnext/erpnext/controllers/buying_controller.py +380,{0} {1} is cancelled or closed,{0} {1} wurde abgebrochen oder abgeschlossen DocType: Delivery Note,Track this Delivery Note against any Project,Diesen Lieferschein in jedem Projekt nachverfolgen apps/erpnext/erpnext/accounts/report/cash_flow/cash_flow.py +30,Net Cash from Investing,Nettocashflow aus Investitionen ,Is Primary Address,Ist Hauptadresse @@ -2838,7 +2839,7 @@ apps/erpnext/erpnext/accounts/doctype/asset/asset.py +58,Expected Value After Us DocType: Sales Invoice Item,Available Qty at Warehouse,Verfügbarer Lagerbestand apps/erpnext/erpnext/accounts/report/delivered_items_to_be_billed/delivered_items_to_be_billed.py +20,Billed Amount,Rechnungsbetrag DocType: Asset,Double Declining Balance,Doppelte degressive -apps/erpnext/erpnext/selling/doctype/sales_order/sales_order.py +166,Closed order cannot be cancelled. Unclose to cancel.,Geschlossen Auftrag nicht abgebrochen werden kann. Unclose abzubrechen. +apps/erpnext/erpnext/selling/doctype/sales_order/sales_order.py +166,Closed order cannot be cancelled. Unclose to cancel.,Abgeschlossen Auftrag kann nicht abgebrochen werden. Abschließen rückgängig machen um abzubrechen. DocType: Student Guardian,Father,Vater apps/erpnext/erpnext/controllers/accounts_controller.py +568,'Update Stock' cannot be checked for fixed asset sale,'Update Bestand' kann nicht für einen festen Asset-Verkauf überprüft werden DocType: Bank Reconciliation,Bank Reconciliation,Kontenabgleich @@ -3724,7 +3725,7 @@ DocType: Purchase Invoice,Return,Zurück DocType: Production Order Operation,Production Order Operation,Arbeitsgang im Fertigungsauftrag DocType: Pricing Rule,Disable,Deaktivieren apps/erpnext/erpnext/hr/doctype/expense_claim/expense_claim.py +153,Mode of payment is required to make a payment,"Modus der Zahlung ist erforderlich, um eine Zahlung zu leisten" -DocType: Project Task,Pending Review,Wartet auf Überprüfung +DocType: Project Task,Pending Review,Warte auf Überprüfung apps/erpnext/erpnext/accounts/doctype/asset/depreciation.py +106,"Asset {0} cannot be scrapped, as it is already {1}","Asset-{0} kann nicht verschrottet werden, als es ohnehin schon ist {1}" DocType: Task,Total Expense Claim (via Expense Claim),Gesamtbetrag der Aufwandsabrechnung (über Aufwandsabrechnung) apps/erpnext/erpnext/accounts/report/sales_register/sales_register.py +70,Customer Id,Kunden-ID @@ -3800,7 +3801,7 @@ apps/erpnext/erpnext/controllers/recurring_document.py +133,Please find attached apps/erpnext/erpnext/accounts/report/bank_reconciliation_statement/bank_reconciliation_statement.py +34,Bank Statement balance as per General Ledger,Kontoauszug Bilanz nach Hauptbuch DocType: Job Applicant,Applicant Name,Bewerbername DocType: Authorization Rule,Customer / Item Name,Kunde / Artikelname -DocType: Product Bundle,"Aggregate group of **Items** into another **Item**. This is useful if you are bundling a certain **Items** into a package and you maintain stock of the packed **Items** and not the aggregate **Item**. +DocType: Product Bundle,"Aggregate group of **Items** into another **Item**. This is useful if you are bundling a certain **Items** into a package and you maintain stock of the packed **Items** and not the aggregate **Item**. The package **Item** will have ""Is Stock Item"" as ""No"" and ""Is Sales Item"" as ""Yes"". @@ -4151,7 +4152,7 @@ DocType: Purchase Invoice Item,Rejected Serial No,Abgelehnte Seriennummer apps/erpnext/erpnext/accounts/doctype/fiscal_year/fiscal_year.py +82,Year start date or end date is overlapping with {0}. To avoid please set company,Jahresbeginn oder Enddatum überlappt mit {0}. Um dies zu verhindern setzen Sie eine Firma. apps/erpnext/erpnext/maintenance/doctype/maintenance_schedule/maintenance_schedule.py +157,Start date should be less than end date for Item {0},Startdatum sollte für den Artikel {0} vor dem Enddatum liegen DocType: Item,"Example: ABCD.##### -If series is set and Serial No is not mentioned in transactions, then automatic serial number will be created based on this series. If you always want to explicitly mention Serial Nos for this item. leave this blank.","Beispiel: ABCD.##### +If series is set and Serial No is not mentioned in transactions, then automatic serial number will be created based on this series. If you always want to explicitly mention Serial Nos for this item. leave this blank.","Beispiel: ABCD.##### Wenn ""Serie"" eingestellt ist und ""Seriennummer"" in den Transaktionen nicht aufgeführt ist, dann wird eine Seriennummer automatisch auf der Grundlage dieser Serie erstellt. Wenn immer explizit Seriennummern für diesen Artikel aufgeführt werden sollen, muss das Feld leer gelassen werden." DocType: Upload Attendance,Upload Attendance,Anwesenheit hochladen apps/erpnext/erpnext/stock/doctype/stock_entry/stock_entry.js +300,BOM and Manufacturing Quantity are required,Stückliste und Fertigungsmenge werden benötigt From 70c3f79d129dd514bac930523d04f1f7d8264c84 Mon Sep 17 00:00:00 2001 From: Nabin Hait Date: Mon, 27 Mar 2017 12:57:38 +0600 Subject: [PATCH 11/15] bumped to version 7.2.31 --- erpnext/__init__.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/erpnext/__init__.py b/erpnext/__init__.py index b4cc2f1e09..96a6424295 100644 --- a/erpnext/__init__.py +++ b/erpnext/__init__.py @@ -2,7 +2,7 @@ from __future__ import unicode_literals import frappe -__version__ = '7.2.30' +__version__ = '7.2.31' def get_default_company(user=None): '''Get default company for user''' From 5b60ef2dcec0f4c2b0ac32f3301a9bfe8e9380b1 Mon Sep 17 00:00:00 2001 From: Nabin Hait Date: Mon, 27 Mar 2017 16:29:51 +0530 Subject: [PATCH 12/15] Fetch operations from all sub-assembly BOMs in Pro Order if multi-level BOM is checked --- .../production_order/production_order.js | 6 + .../production_order/production_order.py | 49 ++++++-- .../production_order_operation.json | 118 +++++++++++++++++- 3 files changed, 158 insertions(+), 15 deletions(-) diff --git a/erpnext/manufacturing/doctype/production_order/production_order.js b/erpnext/manufacturing/doctype/production_order/production_order.js index 836024c3b0..1217790113 100644 --- a/erpnext/manufacturing/doctype/production_order/production_order.js +++ b/erpnext/manufacturing/doctype/production_order/production_order.js @@ -272,6 +272,12 @@ $.extend(cur_frm.cscript, { } }); }, + + use_multi_level_bom: function() { + if(this.frm.doc.bom_no) { + this.frm.trigger("bom_no"); + } + }, qty: function() { frappe.ui.form.trigger("Production Order", 'bom_no') diff --git a/erpnext/manufacturing/doctype/production_order/production_order.py b/erpnext/manufacturing/doctype/production_order/production_order.py index 907a4b324a..2d9a06711a 100644 --- a/erpnext/manufacturing/doctype/production_order/production_order.py +++ b/erpnext/manufacturing/doctype/production_order/production_order.py @@ -213,12 +213,29 @@ class ProductionOrder(Document): def set_production_order_operations(self): """Fetch operations from BOM and set in 'Production Order'""" - if not self.bom_no or cint(frappe.db.get_single_value("Manufacturing Settings", "disable_capacity_planning")): - return + + if not self.bom_no \ + or cint(frappe.db.get_single_value("Manufacturing Settings", "disable_capacity_planning")): + return + self.set('operations', []) - operations = frappe.db.sql("""select operation, description, workstation, idx, - base_hour_rate as hour_rate, time_in_mins, "Pending" as status from `tabBOM Operation` - where parent = %s order by idx""", self.bom_no, as_dict=1) + + if self.use_multi_level_bom: + bom_list = frappe.get_doc("BOM", self.bom_no).traverse_tree() + else: + bom_list = [self.bom_no] + + operations = frappe.db.sql(""" + select + operation, description, workstation, idx, + base_hour_rate as hour_rate, time_in_mins, + "Pending" as status, parent as bom + from + `tabBOM Operation` + where + parent in (%s) order by idx + """ % ", ".join(["%s"]*len(bom_list)), tuple(bom_list), as_dict=1) + self.set('operations', operations) self.calculate_time() @@ -257,14 +274,15 @@ class ProductionOrder(Document): plan_days = frappe.db.get_single_value("Manufacturing Settings", "capacity_planning_for_days") or 30 timesheet = make_timesheet(self.name) - workstation_list = [] timesheet.set('time_logs', []) for i, d in enumerate(self.operations): - if d.workstation and d.status != 'Completed': - self.set_start_end_time_for_workstation(d, workstation_list, i) + + if d.status != 'Completed': + self.set_start_end_time_for_workstation(d, i) args = self.get_operations_data(d) + add_timesheet_detail(timesheet, args) original_start_time = d.planned_start_time @@ -291,7 +309,7 @@ class ProductionOrder(Document): if timesheet and open_new: return timesheet - if timesheet: + if timesheet and timesheet.get("time_logs"): timesheet.save() timesheets.append(timesheet.name) @@ -312,7 +330,7 @@ class ProductionOrder(Document): 'completed_qty': flt(self.qty) - flt(data.completed_qty) } - def set_start_end_time_for_workstation(self, data, workstation_list, index): + def set_start_end_time_for_workstation(self, data, index): """Set start and end time for given operation. If first operation, set start as `planned_start_date`, else add time diff to end time of earlier operation.""" @@ -449,9 +467,14 @@ class ProductionOrder(Document): @frappe.whitelist() def get_item_details(item, project = None): - res = frappe.db.sql("""select stock_uom, description - from `tabItem` where disabled=0 and (end_of_life is null or end_of_life='0000-00-00' or end_of_life > %s) - and name=%s""", (nowdate(), item), as_dict=1) + res = frappe.db.sql(""" + select stock_uom, description + from `tabItem` + where disabled=0 + and (end_of_life is null or end_of_life='0000-00-00' or end_of_life > %s) + and name=%s + """, (nowdate(), item), as_dict=1) + if not res: return {} diff --git a/erpnext/manufacturing/doctype/production_order_operation/production_order_operation.json b/erpnext/manufacturing/doctype/production_order_operation/production_order_operation.json index 00bf934d83..618235f002 100644 --- a/erpnext/manufacturing/doctype/production_order_operation/production_order_operation.json +++ b/erpnext/manufacturing/doctype/production_order_operation/production_order_operation.json @@ -1,5 +1,6 @@ { "allow_copy": 0, + "allow_guest_to_view": 0, "allow_import": 0, "allow_rename": 0, "beta": 0, @@ -9,18 +10,22 @@ "doctype": "DocType", "document_type": "", "editable_grid": 1, + "engine": "InnoDB", "fields": [ { "allow_on_submit": 0, "bold": 0, "collapsible": 0, + "columns": 0, "fieldname": "details", "fieldtype": "Section Break", "hidden": 0, "ignore_user_permissions": 0, "ignore_xss_filter": 0, "in_filter": 0, + "in_global_search": 0, "in_list_view": 0, + "in_standard_filter": 0, "label": "", "length": 0, "no_copy": 0, @@ -29,6 +34,7 @@ "print_hide": 0, "print_hide_if_no_value": 0, "read_only": 0, + "remember_last_selected_value": 0, "report_hide": 0, "reqd": 0, "search_index": 0, @@ -39,13 +45,16 @@ "allow_on_submit": 0, "bold": 0, "collapsible": 0, + "columns": 0, "fieldname": "operation", "fieldtype": "Link", "hidden": 0, "ignore_user_permissions": 0, "ignore_xss_filter": 0, "in_filter": 0, + "in_global_search": 0, "in_list_view": 1, + "in_standard_filter": 0, "label": "Operation", "length": 0, "no_copy": 0, @@ -57,6 +66,7 @@ "print_hide": 0, "print_hide_if_no_value": 0, "read_only": 1, + "remember_last_selected_value": 0, "report_hide": 0, "reqd": 1, "search_index": 0, @@ -67,13 +77,46 @@ "allow_on_submit": 0, "bold": 0, "collapsible": 0, + "columns": 0, + "fieldname": "bom", + "fieldtype": "Link", + "hidden": 0, + "ignore_user_permissions": 0, + "ignore_xss_filter": 0, + "in_filter": 0, + "in_global_search": 0, + "in_list_view": 1, + "in_standard_filter": 0, + "label": "BOM", + "length": 0, + "no_copy": 1, + "options": "BOM", + "permlevel": 0, + "precision": "", + "print_hide": 1, + "print_hide_if_no_value": 0, + "read_only": 1, + "remember_last_selected_value": 0, + "report_hide": 0, + "reqd": 0, + "search_index": 0, + "set_only_once": 0, + "unique": 0 + }, + { + "allow_on_submit": 0, + "bold": 0, + "collapsible": 0, + "columns": 0, "fieldname": "description", "fieldtype": "Text Editor", "hidden": 0, "ignore_user_permissions": 0, "ignore_xss_filter": 0, "in_filter": 0, + "in_global_search": 0, "in_list_view": 0, + "in_standard_filter": 0, "label": "Operation Description", "length": 0, "no_copy": 0, @@ -84,6 +127,7 @@ "print_hide": 0, "print_hide_if_no_value": 0, "read_only": 1, + "remember_last_selected_value": 0, "report_hide": 0, "reqd": 0, "search_index": 0, @@ -94,13 +138,16 @@ "allow_on_submit": 0, "bold": 0, "collapsible": 0, + "columns": 0, "fieldname": "col_break1", "fieldtype": "Column Break", "hidden": 0, "ignore_user_permissions": 0, "ignore_xss_filter": 0, "in_filter": 0, + "in_global_search": 0, "in_list_view": 0, + "in_standard_filter": 0, "length": 0, "no_copy": 0, "permlevel": 0, @@ -108,6 +155,7 @@ "print_hide": 0, "print_hide_if_no_value": 0, "read_only": 0, + "remember_last_selected_value": 0, "report_hide": 0, "reqd": 0, "search_index": 0, @@ -118,6 +166,7 @@ "allow_on_submit": 0, "bold": 0, "collapsible": 0, + "columns": 0, "description": "Operation completed for how many finished goods?", "fieldname": "completed_qty", "fieldtype": "Float", @@ -125,7 +174,9 @@ "ignore_user_permissions": 0, "ignore_xss_filter": 0, "in_filter": 0, + "in_global_search": 0, "in_list_view": 0, + "in_standard_filter": 0, "label": "Completed Qty", "length": 0, "no_copy": 1, @@ -134,6 +185,7 @@ "print_hide": 0, "print_hide_if_no_value": 0, "read_only": 1, + "remember_last_selected_value": 0, "report_hide": 0, "reqd": 0, "search_index": 0, @@ -144,6 +196,7 @@ "allow_on_submit": 0, "bold": 0, "collapsible": 0, + "columns": 0, "default": "Pending", "fieldname": "status", "fieldtype": "Select", @@ -151,7 +204,9 @@ "ignore_user_permissions": 0, "ignore_xss_filter": 0, "in_filter": 0, + "in_global_search": 0, "in_list_view": 1, + "in_standard_filter": 0, "label": "Status", "length": 0, "no_copy": 1, @@ -161,6 +216,7 @@ "print_hide": 0, "print_hide_if_no_value": 0, "read_only": 1, + "remember_last_selected_value": 0, "report_hide": 0, "reqd": 0, "search_index": 0, @@ -171,13 +227,16 @@ "allow_on_submit": 0, "bold": 0, "collapsible": 0, + "columns": 0, "fieldname": "workstation", "fieldtype": "Link", "hidden": 0, "ignore_user_permissions": 0, "ignore_xss_filter": 0, "in_filter": 0, + "in_global_search": 0, "in_list_view": 1, + "in_standard_filter": 0, "label": "Workstation", "length": 0, "no_copy": 0, @@ -189,6 +248,7 @@ "print_hide": 0, "print_hide_if_no_value": 0, "read_only": 0, + "remember_last_selected_value": 0, "report_hide": 0, "reqd": 0, "search_index": 0, @@ -199,13 +259,16 @@ "allow_on_submit": 0, "bold": 0, "collapsible": 0, + "columns": 0, "fieldname": "estimated_time_and_cost", "fieldtype": "Section Break", "hidden": 0, "ignore_user_permissions": 0, "ignore_xss_filter": 0, "in_filter": 0, + "in_global_search": 0, "in_list_view": 0, + "in_standard_filter": 0, "label": "Estimated Time and Cost", "length": 0, "no_copy": 0, @@ -214,6 +277,7 @@ "print_hide": 0, "print_hide_if_no_value": 0, "read_only": 0, + "remember_last_selected_value": 0, "report_hide": 0, "reqd": 0, "search_index": 0, @@ -224,13 +288,16 @@ "allow_on_submit": 0, "bold": 0, "collapsible": 0, + "columns": 0, "fieldname": "planned_start_time", "fieldtype": "Datetime", "hidden": 0, "ignore_user_permissions": 0, "ignore_xss_filter": 0, "in_filter": 0, + "in_global_search": 0, "in_list_view": 0, + "in_standard_filter": 0, "label": "Planned Start Time", "length": 0, "no_copy": 1, @@ -239,6 +306,7 @@ "print_hide": 0, "print_hide_if_no_value": 0, "read_only": 1, + "remember_last_selected_value": 0, "report_hide": 0, "reqd": 0, "search_index": 0, @@ -249,13 +317,16 @@ "allow_on_submit": 0, "bold": 0, "collapsible": 0, + "columns": 0, "fieldname": "planned_end_time", "fieldtype": "Datetime", "hidden": 0, "ignore_user_permissions": 0, "ignore_xss_filter": 0, "in_filter": 0, + "in_global_search": 0, "in_list_view": 0, + "in_standard_filter": 0, "label": "Planned End Time", "length": 0, "no_copy": 1, @@ -264,6 +335,7 @@ "print_hide": 0, "print_hide_if_no_value": 0, "read_only": 1, + "remember_last_selected_value": 0, "report_hide": 0, "reqd": 0, "search_index": 0, @@ -274,13 +346,16 @@ "allow_on_submit": 0, "bold": 0, "collapsible": 0, + "columns": 0, "fieldname": "column_break_10", "fieldtype": "Column Break", "hidden": 0, "ignore_user_permissions": 0, "ignore_xss_filter": 0, "in_filter": 0, + "in_global_search": 0, "in_list_view": 0, + "in_standard_filter": 0, "length": 0, "no_copy": 0, "permlevel": 0, @@ -288,6 +363,7 @@ "print_hide": 0, "print_hide_if_no_value": 0, "read_only": 0, + "remember_last_selected_value": 0, "report_hide": 0, "reqd": 0, "search_index": 0, @@ -298,6 +374,7 @@ "allow_on_submit": 0, "bold": 0, "collapsible": 0, + "columns": 0, "description": "in Minutes", "fieldname": "time_in_mins", "fieldtype": "Float", @@ -305,7 +382,9 @@ "ignore_user_permissions": 0, "ignore_xss_filter": 0, "in_filter": 0, + "in_global_search": 0, "in_list_view": 1, + "in_standard_filter": 0, "label": "Operation Time", "length": 0, "no_copy": 0, @@ -316,6 +395,7 @@ "print_hide": 0, "print_hide_if_no_value": 0, "read_only": 0, + "remember_last_selected_value": 0, "report_hide": 0, "reqd": 1, "search_index": 0, @@ -326,13 +406,16 @@ "allow_on_submit": 0, "bold": 0, "collapsible": 0, + "columns": 0, "fieldname": "hour_rate", "fieldtype": "Float", "hidden": 0, "ignore_user_permissions": 0, "ignore_xss_filter": 0, "in_filter": 0, + "in_global_search": 0, "in_list_view": 0, + "in_standard_filter": 0, "label": "Hour Rate", "length": 0, "no_copy": 0, @@ -343,6 +426,7 @@ "print_hide": 0, "print_hide_if_no_value": 0, "read_only": 1, + "remember_last_selected_value": 0, "report_hide": 0, "reqd": 0, "search_index": 0, @@ -353,13 +437,16 @@ "allow_on_submit": 0, "bold": 0, "collapsible": 0, + "columns": 0, "fieldname": "planned_operating_cost", "fieldtype": "Currency", "hidden": 0, "ignore_user_permissions": 0, "ignore_xss_filter": 0, "in_filter": 0, + "in_global_search": 0, "in_list_view": 0, + "in_standard_filter": 0, "label": "Planned Operating Cost", "length": 0, "no_copy": 0, @@ -369,6 +456,7 @@ "print_hide": 0, "print_hide_if_no_value": 0, "read_only": 1, + "remember_last_selected_value": 0, "report_hide": 0, "reqd": 0, "search_index": 0, @@ -379,13 +467,16 @@ "allow_on_submit": 0, "bold": 0, "collapsible": 0, + "columns": 0, "fieldname": "section_break_9", "fieldtype": "Section Break", "hidden": 0, "ignore_user_permissions": 0, "ignore_xss_filter": 0, "in_filter": 0, + "in_global_search": 0, "in_list_view": 0, + "in_standard_filter": 0, "label": "Actual Time and Cost", "length": 0, "no_copy": 0, @@ -394,6 +485,7 @@ "print_hide": 0, "print_hide_if_no_value": 0, "read_only": 0, + "remember_last_selected_value": 0, "report_hide": 0, "reqd": 0, "search_index": 0, @@ -404,13 +496,16 @@ "allow_on_submit": 0, "bold": 0, "collapsible": 0, + "columns": 0, "fieldname": "actual_start_time", "fieldtype": "Datetime", "hidden": 0, "ignore_user_permissions": 0, "ignore_xss_filter": 0, "in_filter": 0, + "in_global_search": 0, "in_list_view": 0, + "in_standard_filter": 0, "label": "Actual Start Time", "length": 0, "no_copy": 1, @@ -419,6 +514,7 @@ "print_hide": 0, "print_hide_if_no_value": 0, "read_only": 1, + "remember_last_selected_value": 0, "report_hide": 0, "reqd": 0, "search_index": 0, @@ -429,6 +525,7 @@ "allow_on_submit": 0, "bold": 0, "collapsible": 0, + "columns": 0, "description": "Updated via 'Time Log'", "fieldname": "actual_end_time", "fieldtype": "Datetime", @@ -436,7 +533,9 @@ "ignore_user_permissions": 0, "ignore_xss_filter": 0, "in_filter": 0, + "in_global_search": 0, "in_list_view": 0, + "in_standard_filter": 0, "label": "Actual End Time", "length": 0, "no_copy": 1, @@ -445,6 +544,7 @@ "print_hide": 0, "print_hide_if_no_value": 0, "read_only": 1, + "remember_last_selected_value": 0, "report_hide": 0, "reqd": 0, "search_index": 0, @@ -455,13 +555,16 @@ "allow_on_submit": 0, "bold": 0, "collapsible": 0, + "columns": 0, "fieldname": "column_break_11", "fieldtype": "Column Break", "hidden": 0, "ignore_user_permissions": 0, "ignore_xss_filter": 0, "in_filter": 0, + "in_global_search": 0, "in_list_view": 0, + "in_standard_filter": 0, "length": 0, "no_copy": 0, "permlevel": 0, @@ -469,6 +572,7 @@ "print_hide": 0, "print_hide_if_no_value": 0, "read_only": 0, + "remember_last_selected_value": 0, "report_hide": 0, "reqd": 0, "search_index": 0, @@ -479,6 +583,7 @@ "allow_on_submit": 0, "bold": 0, "collapsible": 0, + "columns": 0, "description": "in Minutes\nUpdated via 'Time Log'", "fieldname": "actual_operation_time", "fieldtype": "Float", @@ -486,7 +591,9 @@ "ignore_user_permissions": 0, "ignore_xss_filter": 0, "in_filter": 0, + "in_global_search": 0, "in_list_view": 0, + "in_standard_filter": 0, "label": "Actual Operation Time", "length": 0, "no_copy": 1, @@ -495,6 +602,7 @@ "print_hide": 0, "print_hide_if_no_value": 0, "read_only": 1, + "remember_last_selected_value": 0, "report_hide": 0, "reqd": 0, "search_index": 0, @@ -505,6 +613,7 @@ "allow_on_submit": 0, "bold": 0, "collapsible": 0, + "columns": 0, "description": "(Hour Rate / 60) * Actual Operation Time", "fieldname": "actual_operating_cost", "fieldtype": "Currency", @@ -512,7 +621,9 @@ "ignore_user_permissions": 0, "ignore_xss_filter": 0, "in_filter": 0, + "in_global_search": 0, "in_list_view": 0, + "in_standard_filter": 0, "label": "Actual Operating Cost", "length": 0, "no_copy": 1, @@ -522,6 +633,7 @@ "print_hide": 0, "print_hide_if_no_value": 0, "read_only": 1, + "remember_last_selected_value": 0, "report_hide": 0, "reqd": 0, "search_index": 0, @@ -529,17 +641,17 @@ "unique": 0 } ], + "has_web_view": 0, "hide_heading": 0, "hide_toolbar": 0, "idx": 0, "image_view": 0, "in_create": 0, - "in_dialog": 0, "is_submittable": 0, "issingle": 0, "istable": 1, "max_attachments": 0, - "modified": "2016-08-22 03:41:42.356833", + "modified": "2017-03-27 15:56:29.010336", "modified_by": "Administrator", "module": "Manufacturing", "name": "Production Order Operation", @@ -549,7 +661,9 @@ "quick_entry": 0, "read_only": 0, "read_only_onload": 0, + "show_name_in_global_search": 0, "sort_field": "modified", "sort_order": "DESC", + "track_changes": 1, "track_seen": 0 } \ No newline at end of file From 0329c0ffabfe45a707f4e8bbfef8d6283427f346 Mon Sep 17 00:00:00 2001 From: Nabin Hait Date: Mon, 27 Mar 2017 19:11:45 +0530 Subject: [PATCH 13/15] Test case fixed for production order --- .../doctype/production_order/test_production_order.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/erpnext/manufacturing/doctype/production_order/test_production_order.py b/erpnext/manufacturing/doctype/production_order/test_production_order.py index 1454c10ce0..40e839323c 100644 --- a/erpnext/manufacturing/doctype/production_order/test_production_order.py +++ b/erpnext/manufacturing/doctype/production_order/test_production_order.py @@ -285,8 +285,10 @@ def make_prod_order_test_record(**args): pro_order.scrap_warehouse = args.fg_warehouse or "_Test Scrap Warehouse - _TC" pro_order.company = args.company or "_Test Company" pro_order.stock_uom = args.stock_uom or "_Test UOM" + pro_order.use_multi_level_bom=0 pro_order.set_production_order_operations() + if args.source_warehouse: pro_order.source_warehouse = args.source_warehouse From fe5c95e360c849de72bc9f02522b5ee92ce665df Mon Sep 17 00:00:00 2001 From: Rushabh Mehta Date: Mon, 27 Mar 2017 20:41:51 +0530 Subject: [PATCH 14/15] Update CONTRIBUTING.md --- .github/CONTRIBUTING.md | 40 +++++++++++++++++++++++----------------- 1 file changed, 23 insertions(+), 17 deletions(-) diff --git a/.github/CONTRIBUTING.md b/.github/CONTRIBUTING.md index f95b67a660..04e8d88784 100644 --- a/.github/CONTRIBUTING.md +++ b/.github/CONTRIBUTING.md @@ -1,52 +1,58 @@ -##General Overview +## General Overview -We have three branches where all the work happens: +There are three branches where all the work happens: -* **master** - This is the stable branch based on which we do releases. This branch is for production. -* **develop** - This is an unstable branch for development purposes, it has bleeding edge features and fixes, but it's not recommended for production. Bug fixes and new features go here. -* **hotfix** - This is a branch dedicated to hotfixes on the master branch. Urgent bug fixes go here. +* **master** - This is the production / stable branch for releases. +* **develop** - This is bleeding edge with features and fixes. Non critical bug fixes and new features go here. All updates to master also get pushed to develop. +* **hotfix** - Urgent bug fixes go here. This is merged into master for releases. +## Release Cycles -Once we deem the develop branch to be stable, we merge it into the master and do a major release. The hotfix branch is solely for making urgent bug fixes on the current master branch, which we then merge into master. - -We almost never push directly to master. +Usually, hotfix / develop is pushed to master roughly every week. +If we are close to a major release, then all bugfixes get pushed to hotfix and a release is done every week or as necessary. *** -##Workflow +## Contributing Contributing to ERPNext is not very different from the usual Pull Request workflow on GitHub. -###Prerequisites : +### Prerequisites : * You need to know [Git and Github basics](https://try.github.io/levels/1/challenges/1) * You need to have a Fork of the [ERPNext repo](https://github.com/frappe/erpnext) in your personal Github account * You need to add a [remote](#glossary) for your Forked repository. `git remote add origin [your-erpnext-repo-url]` - -###The Process: +### The Process: 1. Make sure you're in the right branch. **develop** for adding features / fixing issues and **hotfix** for urgent bug fixes 2. Make your changes 3. Create and checkout a new branch for the changes you've made. `git checkout -b [branch-name]` 4. Add and commit your changes `git commit -am "[commit-message]" -5. If you have been working on sometime for a long time, you should [rebase](#glossary) your branch with our develop branch. `git pull upstream develop --rebase` where `upstream` is the remote name of our repo +5. If you have been working on sometime for a long time, you should [rebase](#glossary) your branch with main develop branch. `git pull upstream develop --rebase` where `upstream` is the remote name of our repo 6. Now, push your changes to your fork. `git push origin [branch-name]` If you rebased your commits, you will have to [force push](http://vignette2.wikia.nocookie.net/starwars/images/e/ea/Yodapush.png/revision/latest?cb=20130205190454) `git push origin [branch-name] --force` 7. You should now be able to see your pushed branch on Github, now create a pull request against the branch that you want to merge to. 8. Wait for us to review it -###Common Problems: +### Your Pull Request Should have + +1. Clear explanation of the use case +1. Screenshots / Screecast GIF +1. Test Cases (if applicable) +1. Update to documentation + +### Common Problems: * During rebase you might face _merge conflicts_. A merge conflict occurs when you have made changes to the same file that someone else has, in the commits you're pulling. You need to resolve these conflicts by picking which code you want to keep, yours or theirs. You can use `git mergetool` for help. * Sometimes you don't have a local branch to which you want to make changes to. In that case you first run `git fetch` followed by `git checkout --track -b upstream/[branch-name]` -###Good practices: +### Good practices: -* You should rebase your branch with the branch you plan to make a Pull Request to as often as you can. +* You should rebase your branch with the branch you plan to make a Pull Request (PR) to as often as you can. * Your commit messages should be precise and explain exactly what the commit does. Same goes for the Pull Request title. * When making a PR make sure that all your code is committed properly by checking the diffs. * If you're working on different things at the same time, make sure you make separate branches for each. @@ -55,7 +61,7 @@ If you rebased your commits, you will have to [force push](http://vignette2.wiki * Tabs, not spaces. -###Glossary +### Glossary * remote - A remote is a connection to a Github repo. You should have two remotes, one that points to your repo and one to ours. * rebase - When you rebase a branch, you pull commits from your remote branch and move your commits on top of it. This allows you to update your branch with the latest changes without losing your changes. From 77b2fef41ec8a4efde2e01b452acf034c423bcf7 Mon Sep 17 00:00:00 2001 From: Nabin Hait Date: Tue, 28 Mar 2017 13:39:26 +0530 Subject: [PATCH 15/15] Fixed test cases --- erpnext/stock/doctype/item/test_item.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/erpnext/stock/doctype/item/test_item.py b/erpnext/stock/doctype/item/test_item.py index 2a8e4344af..57805fb57b 100644 --- a/erpnext/stock/doctype/item/test_item.py +++ b/erpnext/stock/doctype/item/test_item.py @@ -217,15 +217,15 @@ class TestItem(unittest.TestCase): variant = get_variant(template.name, manufacturer=manufacturer.name) self.assertEquals(variant.item_code, '_Test Variant Mfg-1') self.assertEquals(variant.description, '_Test Variant Mfg') - self.assertEquals(variant.manufacturer, 'MSG1') + self.assertEquals(variant.get("manufacturers")[0].manufacturer, 'MSG1') variant.insert() variant = get_variant(template.name, manufacturer=manufacturer.name, manufacturer_part_no='007') self.assertEquals(variant.item_code, '_Test Variant Mfg-2') self.assertEquals(variant.description, '_Test Variant Mfg') - self.assertEquals(variant.manufacturer, 'MSG1') - self.assertEquals(variant.manufacturer_part_no, '007') + self.assertEquals(variant.get("manufacturers")[0].manufacturer, 'MSG1') + self.assertEquals(variant.get("manufacturers")[0].manufacturer_part_no, '007') def make_item_variant():