Company field removed from Item Taxes Table

This commit is contained in:
mohammadahmad1990 2020-06-25 01:56:53 +05:00
parent ad3d44d622
commit 261ecba3d6
2 changed files with 5 additions and 14 deletions

View File

@ -6,8 +6,7 @@
"field_order": [
"item_tax_template",
"tax_category",
"valid_from",
"company"
"valid_from"
],
"fields": [
{
@ -34,20 +33,11 @@
"fieldtype": "Date",
"in_list_view": 1,
"label": "Valid From"
},
{
"fetch_from": "item_tax_template.company",
"fieldname": "company",
"fieldtype": "Link",
"in_list_view": 1,
"label": "Company",
"options": "Company",
"read_only": 1
}
],
"idx": 1,
"istable": 1,
"modified": "2020-06-18 22:53:44.546967",
"modified": "2020-06-25 01:40:28.859752",
"modified_by": "Administrator",
"module": "Stock",
"name": "Item Tax",

View File

@ -442,7 +442,8 @@ def _get_item_tax_template(args, taxes, out={}, for_validate=False):
taxes_with_no_validity = []
for tax in taxes:
if tax.valid_from and tax.company == args['company']:
tax_company = frappe.get_value("Item Tax Template", tax.item_tax_template, 'company')
if tax.valid_from and tax_company == args['company']:
# In purchase Invoice first preference will be given to supplier invoice date
# if supplier date is not present then posting date
validation_date = args.get('transaction_date') or args.get('bill_date') or args.get('posting_date')
@ -450,7 +451,7 @@ def _get_item_tax_template(args, taxes, out={}, for_validate=False):
if getdate(tax.valid_from) <= getdate(validation_date):
taxes_with_validity.append(tax)
else:
if tax.company == args['company']:
if tax_company == args['company']:
taxes_with_no_validity.append(tax)
if taxes_with_validity: