Du kannst nicht mehr als 25 Themen auswählen Themen müssen entweder mit einem Buchstaben oder einer Ziffer beginnen. Sie können Bindestriche („-“) enthalten und bis zu 35 Zeichen lang sein.
 
 
 
 
 
 

65 Zeilen
1.4 KiB

  1. import frappe
  2. from frappe import _, flt
  3. from frappe.model.document import Document
  4. # ruleid: frappe-modifying-but-not-comitting
  5. def on_submit(self):
  6. if self.value_of_goods == 0:
  7. frappe.throw(_('Value of goods cannot be 0'))
  8. self.status = 'Submitted'
  9. # ok: frappe-modifying-but-not-comitting
  10. def on_submit(self):
  11. if self.value_of_goods == 0:
  12. frappe.throw(_('Value of goods cannot be 0'))
  13. self.status = 'Submitted'
  14. self.db_set('status', 'Submitted')
  15. # ok: frappe-modifying-but-not-comitting
  16. def on_submit(self):
  17. if self.value_of_goods == 0:
  18. frappe.throw(_('Value of goods cannot be 0'))
  19. x = "y"
  20. self.status = x
  21. self.db_set('status', x)
  22. # ok: frappe-modifying-but-not-comitting
  23. def on_submit(self):
  24. x = "y"
  25. self.status = x
  26. self.save()
  27. # ruleid: frappe-modifying-but-not-comitting-other-method
  28. class DoctypeClass(Document):
  29. def on_submit(self):
  30. self.good_method()
  31. self.tainted_method()
  32. def tainted_method(self):
  33. self.status = "uptate"
  34. # ok: frappe-modifying-but-not-comitting-other-method
  35. class DoctypeClass(Document):
  36. def on_submit(self):
  37. self.good_method()
  38. self.tainted_method()
  39. def tainted_method(self):
  40. self.status = "update"
  41. self.db_set("status", "update")
  42. # ok: frappe-modifying-but-not-comitting-other-method
  43. class DoctypeClass(Document):
  44. def on_submit(self):
  45. self.good_method()
  46. self.tainted_method()
  47. self.save()
  48. def tainted_method(self):
  49. self.status = "uptate"