[fix] [minor] fixed conflict while merging with master

This commit is contained in:
Nabin Hait
2013-08-19 11:06:06 +05:30
206 changed files with 5830 additions and 1272 deletions

View File

@@ -2,7 +2,7 @@
{
"creation": "2013-03-07 11:55:06",
"docstatus": 0,
"modified": "2013-07-05 14:29:48",
"modified": "2013-08-08 14:21:55",
"modified_by": "Administrator",
"owner": "Administrator"
},
@@ -50,7 +50,7 @@
"doctype": "DocField",
"fieldname": "naming_series",
"fieldtype": "Select",
"label": "Series",
"label": "Document Numbering Series",
"options": "\nC-FORM/",
"read_only": 0,
"reqd": 1

View File

@@ -2,7 +2,7 @@
{
"creation": "2013-03-25 10:53:52",
"docstatus": 0,
"modified": "2013-07-05 14:43:51",
"modified": "2013-08-08 14:21:56",
"modified_by": "Administrator",
"owner": "Administrator"
},
@@ -58,7 +58,7 @@
"doctype": "DocField",
"fieldname": "naming_series",
"fieldtype": "Select",
"label": "Series",
"label": "Document Numbering Series",
"no_copy": 1,
"oldfieldname": "naming_series",
"oldfieldtype": "Select",

View File

@@ -2,7 +2,7 @@
{
"creation": "2013-01-10 16:34:07",
"docstatus": 0,
"modified": "2013-07-22 15:31:33",
"modified": "2013-08-12 17:13:23",
"modified_by": "Administrator",
"owner": "jai@webnotestech.com"
},
@@ -35,7 +35,6 @@
"permlevel": 0,
"read": 1,
"report": 1,
"role": "Accounts Manager",
"submit": 1,
"write": 1
},
@@ -104,6 +103,7 @@
"oldfieldtype": "Column Break"
},
{
"description": "The account head under Liability, in which Profit/Loss will be booked",
"doctype": "DocField",
"fieldname": "closing_account_head",
"fieldtype": "Link",
@@ -131,6 +131,11 @@
"reqd": 1
},
{
"doctype": "DocPerm"
"doctype": "DocPerm",
"role": "System Manager"
},
{
"doctype": "DocPerm",
"role": "Accounts Manager"
}
]

View File

@@ -6,7 +6,7 @@ cur_frm.cscript.onload = function(doc,cdt,cdn){
if(r.message) set_field_options('naming_series', r.message);
});
cur_frm.set_query("price_list_name", function() {
cur_frm.set_query("selling_price_list", function() {
return { filters: { buying_or_selling: "Selling" } };
});
}

View File

@@ -2,7 +2,7 @@
{
"creation": "2013-05-24 12:15:51",
"docstatus": 0,
"modified": "2013-08-05 16:51:22",
"modified": "2013-08-09 16:35:03",
"modified_by": "Administrator",
"owner": "Administrator"
},
@@ -62,7 +62,7 @@
"doctype": "DocField",
"fieldname": "naming_series",
"fieldtype": "Select",
"label": "Series",
"label": "Document Numbering Series",
"no_copy": 1,
"oldfieldname": "naming_series",
"oldfieldtype": "Select",
@@ -92,7 +92,7 @@
},
{
"doctype": "DocField",
"fieldname": "price_list_name",
"fieldname": "selling_price_list",
"fieldtype": "Link",
"label": "Price List",
"oldfieldname": "price_list_name",
@@ -131,12 +131,12 @@
},
{
"doctype": "DocField",
"fieldname": "customer_account",
"fieldname": "customer",
"fieldtype": "Link",
"label": "Customer Account",
"label": "Customer",
"oldfieldname": "customer_account",
"oldfieldtype": "Link",
"options": "Account",
"options": "Customer",
"read_only": 0,
"reqd": 0
},

View File

@@ -7,7 +7,7 @@ test_records = [
"name": "_Test POS Setting",
"currency": "INR",
"conversion_rate": 1.0,
"price_list_name": "_Test Price List",
"selling_price_list": "_Test Price List",
"company": "_Test Company",
"warehouse": "_Test Warehouse - _TC",
"territory": "_Test Territory",

View File

@@ -2,7 +2,7 @@
{
"creation": "2013-05-21 16:16:39",
"docstatus": 0,
"modified": "2013-08-01 16:49:49",
"modified": "2013-08-09 14:45:35",
"modified_by": "Administrator",
"owner": "Administrator"
},
@@ -59,7 +59,7 @@
"doctype": "DocField",
"fieldname": "naming_series",
"fieldtype": "Select",
"label": "Series",
"label": "Document Numbering Series",
"no_copy": 1,
"oldfieldname": "naming_series",
"oldfieldtype": "Select",
@@ -242,7 +242,7 @@
{
"description": "Consider this Price List for fetching rate. (only which have \"For Buying\" as checked)",
"doctype": "DocField",
"fieldname": "price_list_name",
"fieldname": "buying_price_list",
"fieldtype": "Link",
"label": "Price List",
"options": "Price List",
@@ -250,7 +250,7 @@
"read_only": 0
},
{
"depends_on": "price_list_name",
"depends_on": "buying_price_list",
"doctype": "DocField",
"fieldname": "price_list_currency",
"fieldtype": "Link",
@@ -260,7 +260,7 @@
"read_only": 1
},
{
"depends_on": "price_list_name",
"depends_on": "buying_price_list",
"doctype": "DocField",
"fieldname": "plc_conversion_rate",
"fieldtype": "Float",

View File

@@ -98,8 +98,6 @@ erpnext.accounts.SalesInvoiceController = erpnext.selling.SellingController.exte
// }, 'icon-desktop');
}
cur_frm.cscript.hide_fields(doc, dt, dn);
},
toggle_pos: function(show) {
@@ -178,6 +176,11 @@ erpnext.accounts.SalesInvoiceController = erpnext.selling.SellingController.exte
entries_add: function(doc, cdt, cdn) {
var row = wn.model.get_doc(cdt, cdn);
this.frm.script_manager.copy_from_first_row("entries", row, ["income_account", "cost_center"]);
},
set_dynamic_labels: function() {
this._super();
this.hide_fields(this.frm.doc);
}
});
@@ -201,7 +204,10 @@ cur_frm.cscript.hide_fields = function(doc) {
cur_frm.fields_dict['entries'].grid.set_column_disp(item_flds_normal, false);
} else {
hide_field('payments_section');
unhide_field(par_flds);
for (i in par_flds) {
var docfield = wn.meta.docfield_map[doc.doctype][par_flds[i]];
if(!docfield.hidden) unhide_field(par_flds[i]);
}
cur_frm.fields_dict['entries'].grid.set_column_disp(item_flds_normal, true);
}

View File

@@ -162,12 +162,22 @@ class DocType(SellingController):
def set_missing_values(self, for_validate=False):
self.set_pos_fields(for_validate)
if not self.doc.debit_to:
self.doc.debit_to = self.get_customer_account()
if not self.doc.due_date:
self.doc.due_date = self.get_due_date()
super(DocType, self).set_missing_values(for_validate)
def set_customer_defaults(self):
# TODO cleanup these methods
self.doc.fields.update(self.get_debit_to())
self.get_cust_and_due_date()
if self.doc.customer:
self.doc.debit_to = self.get_customer_account()
elif self.doc.debit_to:
self.doc.customer = webnotes.conn.get_value('Account', self.doc.debit_to, 'master_name')
self.doc.due_date = self.get_due_date()
super(DocType, self).set_customer_defaults()
@@ -197,20 +207,12 @@ class DocType(SellingController):
if pos:
self.doc.conversion_rate = flt(pos.conversion_rate)
if not self.doc.debit_to:
self.doc.debit_to = self.doc.customer and webnotes.conn.get_value("Account", {
"name": self.doc.customer + " - " + self.get_company_abbr(),
"docstatus": ["!=", 2]
}) or pos.customer_account
if self.doc.debit_to and not self.doc.customer:
self.doc.customer = webnotes.conn.get_value("Account", {
"name": self.doc.debit_to,
"master_type": "Customer"
}, "master_name")
if not for_validate:
self.doc.customer = pos.customer
self.set_customer_defaults()
for fieldname in ('territory', 'naming_series', 'currency', 'charge', 'letter_head', 'tc_name',
'price_list_name', 'company', 'select_print_heading', 'cash_bank_account'):
'selling_price_list', 'company', 'select_print_heading', 'cash_bank_account'):
if (not for_validate) or (for_validate and not self.doc.fields.get(fieldname)):
self.doc.fields[fieldname] = pos.get(fieldname)
@@ -251,27 +253,24 @@ class DocType(SellingController):
You must first create it from the Customer Master" %
(self.doc.customer, self.doc.company))
def get_debit_to(self):
acc_head = self.get_customer_account()
return acc_head and {'debit_to' : acc_head} or {}
def get_cust_and_due_date(self):
def get_due_date(self):
"""Set Due Date = Posting Date + Credit Days"""
due_date = None
if self.doc.posting_date:
credit_days = 0
if self.doc.debit_to:
credit_days = webnotes.conn.get_value("Account", self.doc.debit_to, "credit_days")
if self.doc.customer and not credit_days:
credit_days = webnotes.conn.get_value("Customer", self.doc.customer, "credit_days")
if self.doc.company and not credit_days:
credit_days = webnotes.conn.get_value("Company", self.doc.company, "credit_days")
if credit_days:
self.doc.due_date = add_days(self.doc.posting_date, credit_days)
due_date = add_days(self.doc.posting_date, credit_days)
else:
self.doc.due_date = self.doc.posting_date
if self.doc.debit_to:
self.doc.customer = webnotes.conn.get_value('Account',self.doc.debit_to,'master_name')
due_date = self.doc.posting_date
return due_date
def get_barcode_details(self, barcode):
return get_obj('Sales Common').get_barcode_details(barcode)
@@ -510,18 +509,20 @@ class DocType(SellingController):
if not d.warehouse:
d.warehouse = cstr(w)
if flt(self.doc.paid_amount) == 0:
if self.doc.cash_bank_account:
webnotes.conn.set(self.doc, 'paid_amount',
(flt(self.doc.grand_total) - flt(self.doc.write_off_amount)))
else:
# show message that the amount is not paid
webnotes.conn.set(self.doc,'paid_amount',0)
webnotes.msgprint("Note: Payment Entry will not be created since 'Cash/Bank Account' was not specified.")
self.make_packing_list()
else:
self.doclist = self.doc.clear_table(self.doclist, 'packing_details')
if cint(self.doc.is_pos) == 1:
if flt(self.doc.paid_amount) == 0:
if self.doc.cash_bank_account:
webnotes.conn.set(self.doc, 'paid_amount',
(flt(self.doc.grand_total) - flt(self.doc.write_off_amount)))
else:
# show message that the amount is not paid
webnotes.conn.set(self.doc,'paid_amount',0)
webnotes.msgprint("Note: Payment Entry will not be created since 'Cash/Bank Account' was not specified.")
else:
webnotes.conn.set(self.doc,'paid_amount',0)
def check_prev_docstatus(self):

View File

@@ -2,7 +2,7 @@
{
"creation": "2013-05-24 19:29:05",
"docstatus": 0,
"modified": "2013-07-26 11:16:58",
"modified": "2013-08-09 14:45:42",
"modified_by": "Administrator",
"owner": "Administrator"
},
@@ -52,7 +52,7 @@
"doctype": "DocField",
"fieldname": "naming_series",
"fieldtype": "Select",
"label": "Series",
"label": "Document Numbering Series",
"no_copy": 1,
"oldfieldname": "naming_series",
"oldfieldtype": "Select",
@@ -246,7 +246,7 @@
},
{
"doctype": "DocField",
"fieldname": "price_list_name",
"fieldname": "selling_price_list",
"fieldtype": "Link",
"label": "Price List",
"oldfieldname": "price_list_name",

View File

@@ -675,7 +675,7 @@ test_records = [
"plc_conversion_rate": 1.0,
"posting_date": "2013-01-23",
"price_list_currency": "INR",
"price_list_name": "_Test Price List",
"selling_price_list": "_Test Price List",
"territory": "_Test Territory"
},
{
@@ -738,7 +738,7 @@ test_records = [
"plc_conversion_rate": 1.0,
"posting_date": "2013-03-07",
"price_list_currency": "INR",
"price_list_name": "_Test Price List",
"selling_price_list": "_Test Price List",
"territory": "_Test Territory"
},
{
@@ -789,7 +789,7 @@ test_records = [
"plc_conversion_rate": 1.0,
"posting_date": "2013-01-23",
"price_list_currency": "INR",
"price_list_name": "_Test Price List",
"selling_price_list": "_Test Price List",
"territory": "_Test Territory",
},
# items
@@ -914,7 +914,7 @@ test_records = [
"plc_conversion_rate": 1.0,
"posting_date": "2013-01-23",
"price_list_currency": "INR",
"price_list_name": "_Test Price List",
"selling_price_list": "_Test Price List",
"territory": "_Test Territory",
},
# items
@@ -925,7 +925,6 @@ test_records = [
"item_name": "_Test Item Home Desktop 100",
"qty": 10,
"ref_rate": 62.5,
"export_rate": 62.5,
"stock_uom": "_Test UOM",
"item_tax_rate": json.dumps({"_Test Account Excise Duty - _TC": 10}),
"income_account": "Sales - _TC",
@@ -939,7 +938,6 @@ test_records = [
"item_name": "_Test Item Home Desktop 200",
"qty": 5,
"ref_rate": 190.66,
"export_rate": 190.66,
"stock_uom": "_Test UOM",
"income_account": "Sales - _TC",
"cost_center": "_Test Cost Center - _TC",