mirror of
https://github.com/frappe/erpnext.git
synced 2026-05-31 10:49:09 +00:00
fix: Patch fixes
This commit is contained in:
@@ -6,8 +6,8 @@ from erpnext.setup.utils import get_exchange_rate
|
|||||||
|
|
||||||
|
|
||||||
def execute():
|
def execute():
|
||||||
frappe.reload_doc('crm', 'doctype', 'opportunity')
|
frappe.reload_doc('crm', 'doctype', 'opportunity', force=True)
|
||||||
frappe.reload_doc('crm', 'doctype', 'opportunity_item')
|
frappe.reload_doc('crm', 'doctype', 'opportunity_item', force=True)
|
||||||
|
|
||||||
opportunities = frappe.db.get_list('Opportunity', filters={
|
opportunities = frappe.db.get_list('Opportunity', filters={
|
||||||
'opportunity_amount': ['>', 0]
|
'opportunity_amount': ['>', 0]
|
||||||
@@ -20,15 +20,11 @@ def execute():
|
|||||||
if opportunity.currency != company_currency:
|
if opportunity.currency != company_currency:
|
||||||
conversion_rate = get_exchange_rate(opportunity.currency, company_currency)
|
conversion_rate = get_exchange_rate(opportunity.currency, company_currency)
|
||||||
base_opportunity_amount = flt(conversion_rate) * flt(opportunity.opportunity_amount)
|
base_opportunity_amount = flt(conversion_rate) * flt(opportunity.opportunity_amount)
|
||||||
grand_total = flt(opportunity.opportunity_amount)
|
|
||||||
base_grand_total = flt(conversion_rate) * flt(opportunity.opportunity_amount)
|
|
||||||
else:
|
else:
|
||||||
conversion_rate = 1
|
conversion_rate = 1
|
||||||
base_opportunity_amount = grand_total = base_grand_total = flt(opportunity.opportunity_amount)
|
base_opportunity_amount = flt(opportunity.opportunity_amount)
|
||||||
|
|
||||||
frappe.db.set_value('Opportunity', opportunity.name, {
|
frappe.db.set_value('Opportunity', opportunity.name, {
|
||||||
'conversion_rate': conversion_rate,
|
'conversion_rate': conversion_rate,
|
||||||
'base_opportunity_amount': base_opportunity_amount,
|
'base_opportunity_amount': base_opportunity_amount
|
||||||
'grand_total': grand_total,
|
|
||||||
'base_grand_total': base_grand_total
|
|
||||||
}, update_modified=False)
|
}, update_modified=False)
|
||||||
|
|||||||
@@ -102,7 +102,7 @@ def make_custom_fields():
|
|||||||
]
|
]
|
||||||
}
|
}
|
||||||
|
|
||||||
create_custom_fields(custom_fields, update=True)
|
create_custom_fields(custom_fields, ignore_validate=True, update=True)
|
||||||
|
|
||||||
def update_regional_tax_settings(country, company):
|
def update_regional_tax_settings(country, company):
|
||||||
create_ksa_vat_setting(company)
|
create_ksa_vat_setting(company)
|
||||||
|
|||||||
Reference in New Issue
Block a user