Merge pull request #37330 from ruthra-kumar/provision_to_pick_exc_rate_on_transaction_date

refactor: checkbox to toggle exchange rate inheritence in PO->PI
This commit is contained in:
ruthra kumar
2023-10-17 09:45:33 +05:30
committed by GitHub
3 changed files with 29 additions and 2 deletions

View File

@@ -584,6 +584,17 @@ class AccountsController(TransactionBase):
self.currency, self.company_currency, transaction_date, args
)
if (
self.currency
and buying_or_selling == "Buying"
and frappe.db.get_single_value("Buying Settings", "use_transaction_date_exchange_rate")
and self.doctype == "Purchase Invoice"
):
self.use_transaction_date_exchange_rate = True
self.conversion_rate = get_exchange_rate(
self.currency, self.company_currency, transaction_date, args
)
def set_missing_item_details(self, for_validate=False):
"""set missing item values"""
from erpnext.stock.doctype.serial_no.serial_no import get_serial_nos