mirror of
https://github.com/frappe/erpnext.git
synced 2026-05-29 18:04:46 +00:00
chore: pre-commit
(cherry picked from commit be15419bd5)
# Conflicts:
# erpnext/stock/doctype/repost_item_valuation/test_repost_item_valuation.py
This commit is contained in:
@@ -29,17 +29,21 @@ class RepostItemValuation(Document):
|
|||||||
|
|
||||||
def validate_accounts_freeze(self):
|
def validate_accounts_freeze(self):
|
||||||
acc_settings = frappe.db.get_value(
|
acc_settings = frappe.db.get_value(
|
||||||
'Accounts Settings',
|
"Accounts Settings",
|
||||||
'Accounts Settings',
|
"Accounts Settings",
|
||||||
['acc_frozen_upto', 'frozen_accounts_modifier'],
|
["acc_frozen_upto", "frozen_accounts_modifier"],
|
||||||
as_dict=1
|
as_dict=1,
|
||||||
)
|
)
|
||||||
if not acc_settings.acc_frozen_upto:
|
if not acc_settings.acc_frozen_upto:
|
||||||
return
|
return
|
||||||
if acc_settings.frozen_accounts_modifier and self.owner in get_users_with_role(acc_settings.frozen_accounts_modifier):
|
if acc_settings.frozen_accounts_modifier and self.owner in get_users_with_role(
|
||||||
|
acc_settings.frozen_accounts_modifier
|
||||||
|
):
|
||||||
return
|
return
|
||||||
if getdate(self.posting_date) <= getdate(acc_settings.acc_frozen_upto):
|
if getdate(self.posting_date) <= getdate(acc_settings.acc_frozen_upto):
|
||||||
frappe.throw(_("You cannot repost item valuation before {}").format(acc_settings.acc_frozen_upto))
|
frappe.throw(
|
||||||
|
_("You cannot repost item valuation before {}").format(acc_settings.acc_frozen_upto)
|
||||||
|
)
|
||||||
|
|
||||||
def reset_field_values(self):
|
def reset_field_values(self):
|
||||||
if self.based_on == "Transaction":
|
if self.based_on == "Transaction":
|
||||||
|
|||||||
@@ -344,11 +344,16 @@ class TestRepostItemValuation(FrappeTestCase, StockTestMixin):
|
|||||||
|
|
||||||
accounts_settings = frappe.get_doc("Accounts Settings")
|
accounts_settings = frappe.get_doc("Accounts Settings")
|
||||||
accounts_settings.acc_frozen_upto = today
|
accounts_settings.acc_frozen_upto = today
|
||||||
accounts_settings.frozen_accounts_modifier = ''
|
accounts_settings.frozen_accounts_modifier = ""
|
||||||
accounts_settings.save()
|
accounts_settings.save()
|
||||||
|
|
||||||
self.assertRaises(frappe.ValidationError, riv.save)
|
self.assertRaises(frappe.ValidationError, riv.save)
|
||||||
|
|
||||||
|
<<<<<<< HEAD
|
||||||
accounts_settings.acc_frozen_upto = ''
|
accounts_settings.acc_frozen_upto = ''
|
||||||
accounts_settings.save()
|
accounts_settings.save()
|
||||||
>>>>>>> 61f05132db (feat: validate repost item valuation against accounts freeze date)
|
>>>>>>> 61f05132db (feat: validate repost item valuation against accounts freeze date)
|
||||||
|
=======
|
||||||
|
accounts_settings.acc_frozen_upto = ""
|
||||||
|
accounts_settings.save()
|
||||||
|
>>>>>>> be15419bd5 (chore: pre-commit)
|
||||||
|
|||||||
Reference in New Issue
Block a user