You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

260 lines
12 KiB

4 years ago
  1. <?xml version="1.0" encoding="utf-8"?>
  2. <odoo>
  3. <record id="view_loan_issue_tree" model="ir.ui.view">
  4. <field name="name">loan.issue.tree</field>
  5. <field name="model">loan.issue</field>
  6. <field name="arch" type="xml">
  7. <tree string="Loan issues">
  8. <field name="name"/>
  9. <field name="subscription_start_date"/>
  10. <field name="subscription_end_date"/>
  11. <field name="loan_start_date"/>
  12. <field name="term_date"/>
  13. <field name="loan_term"/>
  14. <field name="rate"/>
  15. <field name="gross_rate"/>
  16. <field name="minimum_amount"/>
  17. <field name="maximum_amount"/>
  18. <field name="subscribed_amount"/>
  19. <field name="user_id"/>
  20. <field name="state"/>
  21. </tree>
  22. </field>
  23. </record>
  24. <record id="view_loan_issue_form" model="ir.ui.view">
  25. <field name="name">loan.issue.form</field>
  26. <field name="model">loan.issue</field>
  27. <field name="arch" type="xml">
  28. <form string="Loan issue">
  29. <header>
  30. <!-- todo check access rights -->
  31. <button name="action_confirm" string="Confirm" type="object"
  32. states="draft"
  33. groups="easy_my_coop.group_easy_my_coop_manager"/>
  34. <button name="action_cancel" string="Cancel" type="object"
  35. states="draft,ongoing"
  36. confirm="Are you sure you want to cancel this loan issue?"
  37. groups="easy_my_coop.group_easy_my_coop_manager"/>
  38. <button name="action_open" string="Open" type="object"
  39. states="confirmed"
  40. groups="easy_my_coop.group_easy_my_coop_manager"/>
  41. <button name="action_close" string="Close" type="object"
  42. states="ongoing"
  43. confirm="Are you sure you want to close this loan issue?"
  44. groups="easy_my_coop.group_easy_my_coop_manager"/>
  45. <button name="action_draft" string="Set to draft"
  46. type="object" states="confirmed,cancelled"
  47. groups="easy_my_coop.group_easy_my_coop_manager"/>
  48. <button name="compute_loan_interest"
  49. string="Compute interest"
  50. type="object" states="closed,ongoing"
  51. groups="easy_my_coop.group_easy_my_coop_manager"/>
  52. <field name="state" widget="statusbar"
  53. statusbar_visible="draft,confirmed,ongoing,closed"/>
  54. </header>
  55. <sheet>
  56. <div class="oe_title">
  57. <label class="oe_edit_only" for="name" string="Name"/>
  58. <h1>
  59. <field name="name" placeholder="Loan issue Name"/>
  60. </h1>
  61. <div name="options">
  62. <div>
  63. <field name="display_on_website"/>
  64. <label for="display_on_website"/>
  65. </div>
  66. </div>
  67. </div>
  68. <group>
  69. <group>
  70. <field name="default_issue"/>
  71. <field name="face_value"/>
  72. <field name="minimum_amount"/>
  73. <field name="maximum_amount"/>
  74. <field name="subscribed_amount"/>
  75. <field name="by_individual"/>
  76. <field name="min_amount_person"
  77. attrs="{'invisible':[('by_individual','=',False)]}"/>
  78. <field name="max_amount_person"
  79. attrs="{'invisible':[('by_individual','=',False)]}"/>
  80. <field name="by_company"/>
  81. <field name="min_amount_company"
  82. attrs="{'invisible':[('by_company','=',False)]}"/>
  83. <field name="max_amount_company"
  84. attrs="{'invisible':[('by_company','=',False)]}"/>
  85. <field name="company_currency_id" invisible="True"/>
  86. </group>
  87. <group>
  88. <field name="user_id" widget="selection"/>
  89. <label for="rate" string="Net Interest rate"/>
  90. <div>
  91. <field name="rate" class="oe_inline"/>
  92. <span class="o_form_label oe_inline">%</span>
  93. </div>
  94. <label for="gross_rate" string="Gross Interest rate"/>
  95. <div>
  96. <field name="gross_rate" class="oe_inline"/>
  97. <span class="o_form_label oe_inline">%</span>
  98. </div>
  99. <label for="taxes_rate" string="Taxes on interest"/>
  100. <div>
  101. <field name="taxes_rate" class="oe_inline"/>
  102. <span class="o_form_label oe_inline">%</span>
  103. </div>
  104. <field name="subscription_start_date"/>
  105. <field name="subscription_end_date"/>
  106. <field name="loan_start_date"/>
  107. <field name="term_date"/>
  108. <field name="loan_term"/>
  109. <field name="interest_payment" widget="selection"/>
  110. <field name="interest_payment_info"
  111. attrs="{'invisible':[('interest_payment','not in',['end','yearly'])]}"/>
  112. </group>
  113. </group>
  114. <notebook>
  115. <page name="lines" string="Lines">
  116. <field name="loan_issue_lines">
  117. <tree delete="false">
  118. <field name="name"/>
  119. <field name="partner_id"/>
  120. <field name="date"/>
  121. <field name="quantity"/>
  122. <field name="face_value"/>
  123. <field name="amount"/>
  124. <field name="state"/>
  125. <field name="company_currency_id"
  126. invisible="True"/>
  127. </tree>
  128. </field>
  129. </page>
  130. </notebook>
  131. </sheet>
  132. </form>
  133. </field>
  134. </record>
  135. <record id="view_loan_issue_filter" model="ir.ui.view">
  136. <field name="name">Loans Issue Search</field>
  137. <field name="model">loan.issue</field>
  138. <field name="arch" type="xml">
  139. <search string="Search Loan Issue">
  140. <field name="name"/>
  141. </search>
  142. </field>
  143. </record>
  144. <record id="action_loan_issue" model="ir.actions.act_window">
  145. <field name="name">Loan Issues</field>
  146. <field name="res_model">loan.issue</field>
  147. <field name="view_type">form</field>
  148. <field name="view_mode">tree,form</field>
  149. </record>
  150. <record id="action_loan_issue_lines" model="ir.actions.act_window">
  151. <field name="name">Loans</field>
  152. <field name="res_model">loan.issue.line</field>
  153. <field name="view_type">form</field>
  154. <field name="view_mode">tree,form</field>
  155. </record>
  156. <record id="loan_issue_line_view_tree" model="ir.ui.view">
  157. <field name="name">loan_issue_line_view_tree</field>
  158. <field name="model">loan.issue.line</field>
  159. <field name="arch" type="xml">
  160. <tree string="Loans">
  161. <field name="name"/>
  162. <field name="loan_issue_id"/>
  163. <field name="partner_id"/>
  164. <field name="quantity"/>
  165. <field name="face_value"/>
  166. <field name="amount"/>
  167. <field name="date"/>
  168. <field name="state"/>
  169. </tree>
  170. </field>
  171. </record>
  172. <record id="view_loan_issue_line_form" model="ir.ui.view">
  173. <field name="name">loan.issue.line.form</field>
  174. <field name="model">loan.issue.line</field>
  175. <field name="arch" type="xml">
  176. <form string="Loan issue">
  177. <header>
  178. <button name="action_validate" string="Validate"
  179. type="object" states="draft"/>
  180. <button name="action_request_payment"
  181. string="Request Payment"
  182. type="object" states="subscribed"/>
  183. <button name="action_cancel" string="Cancel" type="object"
  184. states="draft,subscribed,waiting"
  185. confirm="Are you sure you want to cancel this loan subscription ?"/>
  186. <button name="action_draft" string="Set to draft"
  187. type="object" states="cancelled"/>
  188. <button name="action_paid" string="Paid"
  189. type="object" states="waiting"/>
  190. <field name="state" widget="statusbar"/>
  191. </header>
  192. <sheet>
  193. <group>
  194. <group>
  195. <field name="loan_issue_id"/>
  196. <field name="name"/>
  197. <field name="quantity"/>
  198. <field name="face_value"/>
  199. </group>
  200. <group>
  201. <field name="date"/>
  202. <field name="partner_id"/>
  203. <field name="amount"/>
  204. </group>
  205. </group>
  206. <notebook>
  207. <page string="Interest lines">
  208. <field name="interest_lines">
  209. <tree delete="false" create="false">
  210. <field name="name"/>
  211. <field name="amount"/>
  212. <field name="accrued_amount"/>
  213. <field name="interest"/>
  214. <field name="net_interest"/>
  215. <field name="taxes_amount"/>
  216. <field name="due_date"/>
  217. <field name="state"/>
  218. </tree>
  219. </field>
  220. </page>
  221. </notebook>
  222. </sheet>
  223. </form>
  224. </field>
  225. </record>
  226. <record id="view_loan_issue_line_filter" model="ir.ui.view">
  227. <field name="name">Loans Search</field>
  228. <field name="model">loan.issue.line</field>
  229. <field name="arch" type="xml">
  230. <search string="Search Loans">
  231. <field name="name"/>
  232. <field name="partner_id"/>
  233. <field name="loan_issue_id"/>
  234. <separator/>
  235. <filter string="Draft" name="state_draft"
  236. domain="[('state','=','draft')]"/>
  237. <filter string="Paid" name="state_paid"
  238. domain="[('state','=','paid')]"/>
  239. <filter string="Done" name="state_done"
  240. domain="[('state','=','done')]"/>
  241. <filter string="Subscribed" name="state_subscribed"
  242. domain="[('state','=','subscribed')]"/>
  243. <group expand="0" name="group_by" string="Group By">
  244. <filter name="loan_issue_id" string="Loan Issue"
  245. context="{'group_by' : 'loan_issue_id'}"/>
  246. <filter name="date" string="Subscription Date"
  247. context="{'group_by': 'date'}"/>
  248. </group>
  249. </search>
  250. </field>
  251. </record>
  252. </odoo>