chore: Resolve conflicts

This commit is contained in:
Deepesh Garg
2022-05-25 19:04:20 +05:30
parent 761669c7ca
commit f724f6d1bb
9 changed files with 48 additions and 376 deletions

View File

@@ -35,6 +35,7 @@ from erpnext.accounts.doctype.pricing_rule.utils import (
from erpnext.accounts.party import (
get_party_account,
get_party_account_currency,
get_party_gle_currency,
validate_party_frozen_disabled,
)
from erpnext.accounts.utils import get_account_currency, get_fiscal_years, validate_fiscal_year
@@ -44,12 +45,6 @@ from erpnext.controllers.print_settings import (
set_print_templates_for_taxes,
)
from erpnext.controllers.sales_and_purchase_return import validate_return
<<<<<<< HEAD
=======
from erpnext.accounts.party import get_party_account_currency, validate_party_frozen_disabled, get_party_gle_currency
from erpnext.accounts.doctype.pricing_rule.utils import (apply_pricing_rule_on_transaction,
apply_pricing_rule_for_free_items, get_applied_pricing_rules)
>>>>>>> 80c85dd17c (fix: Account currency validation for first transaction)
from erpnext.exceptions import InvalidCurrency
from erpnext.setup.utils import get_exchange_rate
from erpnext.stock.doctype.packed_item.packed_item import make_packing_list
@@ -1453,20 +1448,25 @@ class AccountsController(TransactionBase):
# from creating a sales invoice if sales order is already created
def validate_party_account_currency(self):
if self.doctype not in ('Sales Invoice', 'Purchase Invoice'):
if self.doctype not in ("Sales Invoice", "Purchase Invoice"):
return
if self.is_opening == 'Yes':
if self.is_opening == "Yes":
return
party_type, party = self.get_party()
party_gle_currency = get_party_gle_currency(party_type, party, self.company)
party_account = self.get('debit_to') if self.doctype == 'Sales Invoice' else self.get('credit_to')
party_account = (
self.get("debit_to") if self.doctype == "Sales Invoice" else self.get("credit_to")
)
party_account_currency = get_account_currency(party_account)
if not party_gle_currency and (party_account_currency != self.currency):
frappe.throw(_("Party Account {0} currency and document currency should be same").format(frappe.bold(party_account)))
frappe.throw(
_("Party Account {0} currency and document currency should be same").format(
frappe.bold(party_account)
)
)
def delink_advance_entries(self, linked_doc_name):
total_allocated_amount = 0