fix: Patch fixes
This commit is contained in:
parent
86ef932979
commit
615dd9decd
@ -6,8 +6,8 @@ from erpnext.setup.utils import get_exchange_rate
|
||||
|
||||
|
||||
def execute():
|
||||
frappe.reload_doc('crm', 'doctype', 'opportunity')
|
||||
frappe.reload_doc('crm', 'doctype', 'opportunity_item')
|
||||
frappe.reload_doc('crm', 'doctype', 'opportunity', force=True)
|
||||
frappe.reload_doc('crm', 'doctype', 'opportunity_item', force=True)
|
||||
|
||||
opportunities = frappe.db.get_list('Opportunity', filters={
|
||||
'opportunity_amount': ['>', 0]
|
||||
@ -20,15 +20,11 @@ def execute():
|
||||
if opportunity.currency != company_currency:
|
||||
conversion_rate = get_exchange_rate(opportunity.currency, company_currency)
|
||||
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:
|
||||
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, {
|
||||
'conversion_rate': conversion_rate,
|
||||
'base_opportunity_amount': base_opportunity_amount,
|
||||
'grand_total': grand_total,
|
||||
'base_grand_total': base_grand_total
|
||||
'base_opportunity_amount': base_opportunity_amount
|
||||
}, 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):
|
||||
create_ksa_vat_setting(company)
|
||||
|
Loading…
x
Reference in New Issue
Block a user