Fixed merge conflict
This commit is contained in:
commit
8bf58367b8
@ -2,7 +2,7 @@
|
|||||||
from __future__ import unicode_literals
|
from __future__ import unicode_literals
|
||||||
import frappe
|
import frappe
|
||||||
|
|
||||||
__version__ = '7.2.30'
|
__version__ = '7.2.31'
|
||||||
|
|
||||||
def get_default_company(user=None):
|
def get_default_company(user=None):
|
||||||
'''Get default company for user'''
|
'''Get default company for user'''
|
||||||
|
@ -115,8 +115,8 @@ class Asset(Document):
|
|||||||
def set_accumulated_depreciation(self):
|
def set_accumulated_depreciation(self):
|
||||||
accumulated_depreciation = flt(self.opening_accumulated_depreciation)
|
accumulated_depreciation = flt(self.opening_accumulated_depreciation)
|
||||||
for d in self.get("schedules"):
|
for d in self.get("schedules"):
|
||||||
accumulated_depreciation += flt(d.depreciation_amount)
|
accumulated_depreciation += flt(d.depreciation_amount, d.precision("depreciation_amount"))
|
||||||
d.accumulated_depreciation_amount = accumulated_depreciation
|
d.accumulated_depreciation_amount = flt(accumulated_depreciation, d.precision("accumulated_depreciation_amount"))
|
||||||
|
|
||||||
def get_depreciation_amount(self, depreciable_value):
|
def get_depreciation_amount(self, depreciable_value):
|
||||||
if self.depreciation_method in ("Straight Line", "Manual"):
|
if self.depreciation_method in ("Straight Line", "Manual"):
|
||||||
|
@ -209,6 +209,7 @@ function hide_fields(doc) {
|
|||||||
|
|
||||||
cur_frm.cscript.update_stock = function(doc, dt, dn) {
|
cur_frm.cscript.update_stock = function(doc, dt, dn) {
|
||||||
hide_fields(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) {
|
cur_frm.fields_dict.cash_bank_account.get_query = function(doc) {
|
||||||
|
@ -157,6 +157,12 @@ class PurchaseInvoice(BuyingController):
|
|||||||
|
|
||||||
super(PurchaseInvoice, self).validate_warehouse()
|
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):
|
def set_expense_account(self, for_validate=False):
|
||||||
auto_accounting_for_stock = cint(frappe.defaults.get_global_default("auto_accounting_for_stock"))
|
auto_accounting_for_stock = cint(frappe.defaults.get_global_default("auto_accounting_for_stock"))
|
||||||
|
|
||||||
@ -165,6 +171,7 @@ class PurchaseInvoice(BuyingController):
|
|||||||
stock_items = self.get_stock_items()
|
stock_items = self.get_stock_items()
|
||||||
|
|
||||||
if self.update_stock:
|
if self.update_stock:
|
||||||
|
self.validate_item_code()
|
||||||
self.validate_warehouse()
|
self.validate_warehouse()
|
||||||
warehouse_account = get_warehouse_account()
|
warehouse_account = get_warehouse_account()
|
||||||
|
|
||||||
|
@ -325,6 +325,7 @@ cur_frm.cscript.hide_fields = function(doc) {
|
|||||||
|
|
||||||
cur_frm.cscript.update_stock = function(doc, dt, dn) {
|
cur_frm.cscript.update_stock = function(doc, dt, dn) {
|
||||||
cur_frm.cscript.hide_fields(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() {
|
cur_frm.cscript['Make Delivery Note'] = function() {
|
||||||
|
@ -75,8 +75,8 @@ def get_fiscal_years(transaction_date=None, fiscal_year=None, label="Date", verb
|
|||||||
if verbose==1: frappe.msgprint(error_msg)
|
if verbose==1: frappe.msgprint(error_msg)
|
||||||
raise FiscalYearError, error_msg
|
raise FiscalYearError, error_msg
|
||||||
|
|
||||||
def validate_fiscal_year(date, fiscal_year, company, label=_("Date"), doc=None):
|
def validate_fiscal_year(date, fiscal_year, company, label="Date", doc=None):
|
||||||
years = [f[0] for f in get_fiscal_years(date, label=label, company=company)]
|
years = [f[0] for f in get_fiscal_years(date, label=_(label), company=company)]
|
||||||
if fiscal_year not in years:
|
if fiscal_year not in years:
|
||||||
if doc:
|
if doc:
|
||||||
doc.fiscal_year = years[0]
|
doc.fiscal_year = years[0]
|
||||||
|
@ -109,7 +109,7 @@ erpnext.buying.BuyingController = erpnext.TransactionController.extend({
|
|||||||
|
|
||||||
qty: function(doc, cdt, cdn) {
|
qty: function(doc, cdt, cdn) {
|
||||||
var item = frappe.get_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"]);
|
frappe.model.round_floats_in(item, ["qty", "received_qty"]);
|
||||||
|
|
||||||
if(!doc.is_return && this.validate_negative_quantity(cdt, cdn, item, ["qty", "received_qty"])){ return }
|
if(!doc.is_return && this.validate_negative_quantity(cdt, cdn, item, ["qty", "received_qty"])){ return }
|
||||||
|
@ -1080,5 +1080,4 @@ erpnext.TransactionController = erpnext.taxes_and_totals.extend({
|
|||||||
|
|
||||||
return method
|
return method
|
||||||
},
|
},
|
||||||
|
|
||||||
});
|
});
|
Loading…
Reference in New Issue
Block a user