Permalink
Browse files

[MERGE] (website_)portal: make customer portal independent from website

This merge make the customer portal available independently from website
module. This implies moving some routing features from website to a new
http_routing module. Customer portal is located in a new portal module.

Sale and account customer portal are moved directly into sale and account
module, and in sale_payment and account_payment for the online payment
part. Most of website_payment code is moved to payment as it holds
customer portal features related to payment.

This merge removes website_portal, website_portal_sale and website_account
module.

This closes #17100.
  • Loading branch information...
tde-banana-odoo committed Aug 8, 2017
2 parents 31e4675 + 79f362d commit c3c42658c529967f26c39f51b39059bf47078b57
Showing with 1,528 additions and 28,895 deletions.
  1. +0 −10 .tx/config
  2. +1 −1 addons/account/__init__.py
  3. +2 −1 addons/account/__manifest__.py
  4. +1 −1 addons/{website_account → account}/controllers/__init__.py
  5. +7 −5 addons/{website_account/controllers/portal_account.py → account/controllers/portal.py}
  6. +54 −2 addons/account/models/account_invoice.py
  7. +14 −0 addons/account/security/account_security.xml
  8. +2 −0 addons/account/security/ir.model.access.csv
  9. +1 −1 addons/account/views/account_invoice_view.xml
  10. +5 −9 addons/{website_account/views/account_templates.xml → account/views/account_portal_templates.xml}
  11. +0 −2 addons/{website_portal/controllers → account_payment}/__init__.py
  12. +21 −0 addons/account_payment/__manifest__.py
  13. +14 −0 addons/account_payment/views/account_portal_templates.xml
  14. +1 −0 addons/auth_signup/models/__init__.py
  15. +19 −0 addons/auth_signup/models/ir_http.py
  16. +0 −1 addons/{website_account → http_routing}/__init__.py
  17. +16 −0 addons/http_routing/__manifest__.py
  18. +5 −0 addons/http_routing/models/__init__.py
  19. +404 −0 addons/http_routing/models/ir_http.py
  20. +16 −0 addons/http_routing/models/ir_ui_view.py
  21. +1 −1 addons/mail/models/mail_thread.py
  22. +1 −0 addons/mail/tests/__init__.py
  23. 0 addons/{website_portal → mail}/tests/test_portal.py
  24. +1 −0 addons/payment/__init__.py
  25. +2 −1 addons/payment/__manifest__.py
  26. +1 −1 addons/{website_account/models → payment/controllers}/__init__.py
  27. +5 −5 addons/{website_payment/controllers/main.py → payment/controllers/portal.py}
  28. 0 addons/{website_payment → payment}/static/lib/jquery.payment/jquery.payment.js
  29. 0 .../{website_payment/static/src/css/website_payment.css → payment/static/src/css/portal_payment.css}
  30. 0 ...website_payment/static/src/css/website_payment.sass → payment/static/src/css/portal_payment.sass}
  31. +8 −2 addons/{website_payment/static/src/js/payment_acquirer.js → payment/static/src/js/payment_portal.js}
  32. +26 −0 addons/payment/static/src/js/payment_transaction_portal.js
  33. +12 −0 addons/payment/views/assets.xml
  34. +0 −8 addons/payment/views/payment_assets.xml
  35. +142 −0 addons/payment/views/payment_portal_templates.xml
  36. 0 addons/{website_portal → portal}/__init__.py
  37. +25 −0 addons/portal/__manifest__.py
  38. +5 −0 addons/portal/controllers/__init__.py
  39. +91 −34 addons/{website_portal/controllers/main.py → portal/controllers/portal.py}
  40. +20 −0 addons/portal/controllers/web.py
  41. +1 −1 addons/{website_portal/data/website_portal_data.xml → portal/data/portal_data.xml}
  42. +5 −3 addons/{website_portal/static/src/js/website_portal.js → portal/static/src/js/portal.js}
  43. +1 −3 addons/{website_portal/static/src/js/website_portal_tour.js → portal/static/src/js/portal_tour.js}
  44. 0 addons/{website → portal}/static/src/less/bootstrap.extend.less
  45. 0 addons/{website → portal}/static/src/less/website.ui.less
  46. 0 addons/{website → portal}/static/src/less/website.wrapwrap.less
  47. +0 −1 addons/{website_portal → portal}/tests/__init__.py
  48. 0 addons/{website_portal → portal}/tests/test_load_process.py
  49. +15 −0 addons/portal/views/assets.xml
  50. +165 −90 addons/{website_portal/views/website_portal_templates.xml → portal/views/portal_templates.xml}
  51. 0 addons/{website_portal → portal}/wizard/__init__.py
  52. +1 −1 addons/{website_portal → portal}/wizard/portal_wizard.py
  53. 0 addons/{website_portal → portal}/wizard/portal_wizard_views.xml
  54. +1 −0 addons/sale/__init__.py
  55. +2 −1 addons/sale/__manifest__.py
  56. +1 −1 addons/{website_portal_sale → sale}/controllers/__init__.py
  57. 0 addons/{website_portal_sale → sale}/controllers/mail.py
  58. +9 −10 addons/{website_portal_sale/controllers/main.py → sale/controllers/portal.py}
  59. +73 −0 addons/sale/data/sale_demo.xml
  60. +59 −1 addons/sale/models/sale.py
  61. +7 −0 addons/sale/models/sale_config_settings.py
  62. +2 −0 addons/sale/security/ir.model.access.csv
  63. +19 −0 addons/sale/security/sale_security.xml
  64. 0 ...ite_portal_sale/static/src/less/website_portal_sale.less → sale/static/src/less/sale_portal.less}
  65. +13 −0 addons/sale/views/sale_config_settings_views.xml
  66. +12 −13 ...bsite_portal_sale/views/website_portal_sale_templates.xml → sale/views/sale_portal_templates.xml}
  67. +2 −0 addons/sale_payment/__manifest__.py
  68. +1 −0 addons/sale_payment/models/__init__.py
  69. 0 addons/{website_portal_sale → sale_payment}/models/crm_team.py
  70. +27 −0 addons/sale_payment/models/sale_order.py
  71. 0 addons/{website_portal_sale → sale_payment}/views/crm_team_views.xml
  72. 0 addons/{website_portal_sale → sale_payment}/views/sale_order_views.xml
  73. +1 −2 addons/survey/models/survey.py
  74. +1 −2 addons/survey/tests/test_survey.py
  75. +4 −3 addons/web/controllers/main.py
  76. 0 addons/{website_portal/static/src/less/website_portal.less → web/static/src/less/portal.less}
  77. +2 −2 addons/web/views/report_templates.xml
  78. +2 −0 addons/web/views/webclient_templates.xml
  79. +1 −1 addons/website/__manifest__.py
  80. +2 −2 addons/website/controllers/main.py
  81. +1 −1 addons/website/models/__init__.py
  82. +26 −219 addons/website/models/ir_http.py
  83. +7 −19 addons/website/models/ir_ui_view.py
  84. +6 −179 addons/website/models/website.py
  85. +1 −1 addons/website/static/src/js/website.js
  86. +1 −1 addons/website/static/src/js/website.translator.js
  87. +1 −1 addons/website/tests/test_converter.py
  88. +32 −76 addons/website/views/website_templates.xml
  89. +0 −25 addons/website_account/__manifest__.py
  90. +0 −58 addons/website_account/models/account_invoice.py
  91. +0 −18 addons/website_account/security/account.xml
  92. +0 −3 addons/website_account/security/ir.model.access.csv
  93. +0 −13 addons/website_account/views/account_views.xml
  94. +1 −1 addons/website_blog/controllers/main.py
  95. +1 −1 addons/website_blog/models/website_blog.py
  96. +1 −1 addons/website_crm_partner_assign/__manifest__.py
  97. +3 −4 addons/website_crm_partner_assign/controllers/main.py
  98. +1 −1 addons/website_crm_partner_assign/models/res_partner.py
  99. +9 −9 addons/website_crm_partner_assign/views/website_crm_partner_assign_templates.xml
  100. +1 −1 addons/website_customer/controllers/main.py
  101. +1 −1 addons/website_event/controllers/main.py
  102. +1 −3 addons/website_event/models/event.py
  103. +1 −1 addons/website_event_track/models/event.py
  104. +1 −1 addons/website_event_track/models/event_track.py
  105. +1 −1 addons/website_forum/controllers/main.py
  106. +1 −1 addons/website_hr_recruitment/controllers/main.py
  107. +0 −1 addons/website_hr_recruitment/models/hr_recruitment.py
  108. +1 −1 addons/website_livechat/models/im_livechat.py
  109. +2 −1 addons/website_mail_channel/controllers/main.py
  110. +1 −1 addons/website_mail_channel/models/mail_channel.py
  111. +1 −1 addons/website_mail_channel/models/mail_mail.py
  112. +1 −1 addons/website_membership/controllers/main.py
  113. +1 −1 addons/website_partner/controllers/main.py
  114. +1 −1 addons/website_partner/models/res_partner.py
  115. +0 −1 addons/website_payment/__init__.py
  116. +1 −1 addons/website_payment/__manifest__.py
  117. +0 −1 addons/website_payment/controllers/__init__.py
  118. +0 −26 addons/website_payment/static/src/js/payment_transaction.js
  119. +11 −160 addons/website_payment/views/website_payment_templates.xml
  120. +0 −20 addons/website_portal/__manifest__.py
  121. +0 −140 addons/website_portal/i18n/af.po
  122. +0 −140 addons/website_portal/i18n/ar.po
  123. +0 −144 addons/website_portal/i18n/bg.po
  124. +0 −140 addons/website_portal/i18n/bs.po
  125. +0 −139 addons/website_portal/i18n/ca.po
  126. +0 −139 addons/website_portal/i18n/cs.po
  127. +0 −139 addons/website_portal/i18n/da.po
  128. +0 −143 addons/website_portal/i18n/de.po
  129. +0 −142 addons/website_portal/i18n/el.po
  130. +0 −140 addons/website_portal/i18n/en_GB.po
  131. +0 −159 addons/website_portal/i18n/es.po
  132. +0 −140 addons/website_portal/i18n/es_AR.po
  133. +0 −140 addons/website_portal/i18n/es_CL.po
  134. +0 −159 addons/website_portal/i18n/es_CO.po
  135. +0 −140 addons/website_portal/i18n/es_CR.po
  136. +0 −140 addons/website_portal/i18n/es_DO.po
  137. +0 −145 addons/website_portal/i18n/es_EC.po
  138. +0 −140 addons/website_portal/i18n/es_PA.po
  139. +0 −143 addons/website_portal/i18n/es_PE.po
  140. +0 −140 addons/website_portal/i18n/es_PY.po
  141. +0 −145 addons/website_portal/i18n/es_VE.po
  142. +0 −139 addons/website_portal/i18n/et.po
  143. +0 −139 addons/website_portal/i18n/eu.po
  144. +0 −139 addons/website_portal/i18n/fa.po
  145. +0 −139 addons/website_portal/i18n/fi.po
  146. +0 −163 addons/website_portal/i18n/fr.po
  147. +0 −140 addons/website_portal/i18n/fr_BE.po
  148. +0 −140 addons/website_portal/i18n/fr_CA.po
  149. +0 −139 addons/website_portal/i18n/gl.po
  150. +0 −139 addons/website_portal/i18n/gu.po
  151. +0 −139 addons/website_portal/i18n/he.po
  152. +0 −144 addons/website_portal/i18n/hr.po
  153. +0 −159 addons/website_portal/i18n/hu.po
  154. +0 −139 addons/website_portal/i18n/hy.po
  155. +0 −140 addons/website_portal/i18n/id.po
  156. +0 −141 addons/website_portal/i18n/is.po
  157. +0 −144 addons/website_portal/i18n/it.po
  158. +0 −139 addons/website_portal/i18n/ja.po
  159. +0 −139 addons/website_portal/i18n/ka.po
  160. +0 −139 addons/website_portal/i18n/kab.po
  161. +0 −139 addons/website_portal/i18n/kk.po
  162. +0 −140 addons/website_portal/i18n/ko.po
  163. +0 −141 addons/website_portal/i18n/lt.po
  164. +0 −140 addons/website_portal/i18n/lv.po
  165. +0 −141 addons/website_portal/i18n/mk.po
  166. +0 −140 addons/website_portal/i18n/mn.po
  167. +0 −144 addons/website_portal/i18n/nb.po
  168. +0 −161 addons/website_portal/i18n/nl.po
  169. +0 −140 addons/website_portal/i18n/nl_BE.po
  170. +0 −144 addons/website_portal/i18n/pl.po
  171. +0 −152 addons/website_portal/i18n/pt.po
  172. +0 −163 addons/website_portal/i18n/pt_BR.po
  173. +0 −144 addons/website_portal/i18n/ro.po
  174. +0 −161 addons/website_portal/i18n/ru.po
  175. +0 −142 addons/website_portal/i18n/sk.po
  176. +0 −141 addons/website_portal/i18n/sl.po
  177. +0 −140 addons/website_portal/i18n/sr.po
  178. +0 −141 addons/website_portal/i18n/sr@latin.po
  179. +0 −139 addons/website_portal/i18n/sv.po
  180. +0 −139 addons/website_portal/i18n/ta.po
  181. +0 −143 addons/website_portal/i18n/th.po
  182. +0 −140 addons/website_portal/i18n/tr.po
  183. +0 −147 addons/website_portal/i18n/uk.po
  184. +0 −140 addons/website_portal/i18n/vi.po
  185. +0 −350 addons/website_portal/i18n/website_portal.pot
  186. +0 −168 addons/website_portal/i18n/zh_CN.po
  187. +0 −140 addons/website_portal/i18n/zh_TW.po
  188. BIN addons/website_portal/static/description/icon.png
  189. +2 −1 addons/website_portal_purchase/__manifest__.py
  190. +2 −3 addons/website_portal_purchase/controllers/website_portal.py
  191. +6 −6 addons/website_portal_purchase/views/website_portal_purchase_templates.xml
  192. +0 −5 addons/website_portal_sale/__init__.py
  193. +0 −29 addons/website_portal_sale/__manifest__.py
  194. +0 −76 addons/website_portal_sale/data/sale_demo.xml
  195. +0 −273 addons/website_portal_sale/i18n/af.po
  196. +0 −274 addons/website_portal_sale/i18n/ar.po
  197. +0 −306 addons/website_portal_sale/i18n/bg.po
  198. +0 −273 addons/website_portal_sale/i18n/bs.po
  199. +0 −272 addons/website_portal_sale/i18n/ca.po
  200. +0 −272 addons/website_portal_sale/i18n/cs.po
  201. +0 −272 addons/website_portal_sale/i18n/da.po
  202. +0 −294 addons/website_portal_sale/i18n/de.po
  203. +0 −281 addons/website_portal_sale/i18n/el.po
  204. +0 −273 addons/website_portal_sale/i18n/en_GB.po
  205. +0 −423 addons/website_portal_sale/i18n/es.po
  206. +0 −273 addons/website_portal_sale/i18n/es_AR.po
  207. +0 −273 addons/website_portal_sale/i18n/es_BO.po
  208. +0 −275 addons/website_portal_sale/i18n/es_CL.po
  209. +0 −294 addons/website_portal_sale/i18n/es_CO.po
  210. +0 −273 addons/website_portal_sale/i18n/es_CR.po
  211. +0 −273 addons/website_portal_sale/i18n/es_DO.po
  212. +0 −296 addons/website_portal_sale/i18n/es_EC.po
  213. +0 −294 addons/website_portal_sale/i18n/es_PE.po
  214. +0 −273 addons/website_portal_sale/i18n/es_PY.po
  215. +0 −273 addons/website_portal_sale/i18n/es_VE.po
  216. +0 −273 addons/website_portal_sale/i18n/et.po
  217. +0 −273 addons/website_portal_sale/i18n/eu.po
  218. +0 −272 addons/website_portal_sale/i18n/fa.po
  219. +0 −272 addons/website_portal_sale/i18n/fi.po
  220. +0 −272 addons/website_portal_sale/i18n/fo.po
  221. +0 −422 addons/website_portal_sale/i18n/fr.po
  222. +0 −272 addons/website_portal_sale/i18n/gl.po
  223. +0 −273 addons/website_portal_sale/i18n/he.po
  224. +0 −294 addons/website_portal_sale/i18n/hr.po
  225. +0 −424 addons/website_portal_sale/i18n/hu.po
  226. +0 −273 addons/website_portal_sale/i18n/id.po
  227. +0 −295 addons/website_portal_sale/i18n/it.po
  228. +0 −278 addons/website_portal_sale/i18n/ja.po
  229. +0 −272 addons/website_portal_sale/i18n/kab.po
  230. +0 −272 addons/website_portal_sale/i18n/ko.po
  231. +0 −274 addons/website_portal_sale/i18n/lt.po
  232. +0 −273 addons/website_portal_sale/i18n/lv.po
  233. +0 −281 addons/website_portal_sale/i18n/mk.po
  234. +0 −273 addons/website_portal_sale/i18n/mn.po
  235. +0 −273 addons/website_portal_sale/i18n/nb.po
  236. +0 −427 addons/website_portal_sale/i18n/nl.po
  237. +0 −273 addons/website_portal_sale/i18n/nl_BE.po
  238. +0 −291 addons/website_portal_sale/i18n/pl.po
  239. +0 −273 addons/website_portal_sale/i18n/pt.po
  240. +0 −427 addons/website_portal_sale/i18n/pt_BR.po
  241. +0 −297 addons/website_portal_sale/i18n/ro.po
  242. +0 −274 addons/website_portal_sale/i18n/ru.po
  243. +0 −293 addons/website_portal_sale/i18n/sk.po
  244. +0 −282 addons/website_portal_sale/i18n/sl.po
  245. +0 −273 addons/website_portal_sale/i18n/sr.po
  246. +0 −274 addons/website_portal_sale/i18n/sr@latin.po
  247. +0 −275 addons/website_portal_sale/i18n/sv.po
  248. +0 −291 addons/website_portal_sale/i18n/th.po
  249. +0 −278 addons/website_portal_sale/i18n/tr.po
  250. +0 −296 addons/website_portal_sale/i18n/uk.po
  251. +0 −273 addons/website_portal_sale/i18n/vi.po
  252. +0 −399 addons/website_portal_sale/i18n/website_portal_sale.pot
  253. +0 −422 addons/website_portal_sale/i18n/zh_CN.po
  254. +0 −273 addons/website_portal_sale/i18n/zh_TW.po
  255. +0 −5 addons/website_portal_sale/models/__init__.py
  256. +0 −99 addons/website_portal_sale/models/sale_order.py
  257. +0 −3 addons/website_portal_sale/security/ir.model.access.csv
  258. +0 −23 addons/website_portal_sale/security/sale_order_security.xml
  259. BIN addons/website_portal_sale/static/description/icon.png
  260. +1 −1 addons/website_project/__manifest__.py
  261. +2 −3 addons/website_project/controllers/main.py
  262. +0 −1 addons/website_project/models/project.py
  263. +10 −10 addons/website_project/views/project_templates.xml
  264. +1 −1 addons/website_quote/__manifest__.py
  265. +1 −1 addons/website_quote/controllers/main.py
  266. +3 −3 addons/website_quote/views/website_quote_templates.xml
  267. +1 −1 addons/website_sale/__manifest__.py
  268. +1 −1 addons/website_sale/controllers/main.py
  269. +1 −1 addons/website_sale/views/templates.xml
  270. +1 −1 addons/website_sale_digital/__manifest__.py
  271. +3 −2 addons/website_sale_digital/controllers/main.py
  272. +1 −1 addons/website_sale_digital/views/website_sale_digital.xml
  273. +1 −1 addons/website_sale_stock/views/website_sale_stock_templates.xml
  274. +1 −1 addons/website_slides/models/slides.py
  275. +1 −1 odoo/addons/base/ir/ir_actions_report.py
  276. +14 −7 odoo/addons/base/ir/ir_http.py
  277. +5 −0 odoo/addons/base/res/res_users.py
View
@@ -867,16 +867,6 @@ file_filter = addons/website_payment/i18n/<lang>.po
source_file = addons/website_payment/i18n/website_payment.pot
source_lang = en
[odoo-master.website_portal]
file_filter = addons/website_portal/i18n/<lang>.po
source_file = addons/website_portal/i18n/website_portal.pot
source_lang = en
[odoo-master.website_portal_sale]
file_filter = addons/website_portal_sale/i18n/<lang>.po
source_file = addons/website_portal_sale/i18n/website_portal_sale.pot
source_lang = en
[odoo-master.website_portal_purchase]
file_filter = addons/website_portal_purchase/i18n/<lang>.po
source_file = addons/website_portal_purchase/i18n/website_portal_purchase.pot
@@ -1,8 +1,8 @@
# -*- coding: utf-8 -*-
# Part of Odoo. See LICENSE file for full copyright and licensing details.
from . import controllers
from . import models
from . import wizard
from . import report
@@ -11,7 +11,7 @@
'category': 'Accounting',
'website': 'https://www.odoo.com/page/billing',
'images' : ['images/accounts.jpeg','images/bank_statement.jpeg','images/cash_register.jpeg','images/chart_of_accounts.jpeg','images/customer_invoice.jpeg','images/journal_entries.jpeg'],
'depends' : ['base_setup', 'product', 'analytic', 'web_planner'],
'depends' : ['base_setup', 'product', 'analytic', 'web_planner', 'portal'],
'data': [
'security/account_security.xml',
'security/ir.model.access.csv',
@@ -59,6 +59,7 @@
'views/account_config_settings_views.xml',
'views/web_planner_data.xml',
'views/account_journal_dashboard_view.xml',
'views/account_portal_templates.xml',
'report/account_report_payment_receipt_templates.xml',
'data/payment_receipt_data.xml',
],
@@ -1,4 +1,4 @@
# -*- coding: utf-8 -*-
# Part of Odoo. See LICENSE file for full copyright and licensing details.
from . import portal_account
from . import portal
@@ -5,10 +5,10 @@
from odoo.exceptions import AccessError
from odoo.http import request
from odoo.addons.website_portal.controllers.main import website_account
from odoo.addons.portal.controllers.portal import CustomerPortal
class PortalAccount(website_account):
class PortalAccount(CustomerPortal):
def _prepare_portal_layout_values(self):
values = super(PortalAccount, self)._prepare_portal_layout_values()
@@ -53,7 +53,7 @@ def portal_my_invoices(self, page=1, date_begin=None, date_end=None, sortby=None
# count for pager
invoice_count = AccountInvoice.search_count(domain)
# pager
pager = request.website.pager(
pager = request.pager(
url="/my/invoices",
url_args={'date_begin': date_begin, 'date_end': date_end, 'sortby': sortby},
total=invoice_count,
@@ -72,16 +72,18 @@ def portal_my_invoices(self, page=1, date_begin=None, date_end=None, sortby=None
'searchbar_sortings': searchbar_sortings,
'sortby': sortby,
})
return request.render("website_account.portal_my_invoices", values)
return request.render("account.portal_my_invoices", values)
@http.route(['/my/invoices/<int:invoice_id>'], type='http', auth="user", website=True)
def portal_my_invoices_report(self, invoice_id, **kw):
invoice = request.env['account.invoice'].browse(invoice_id)
try:
invoice.check_access_rights('read')
invoice.check_access_rule('read')
# TDE FIXME: does not exist, or maybe, don't know
except AccessError:
return request.render("website.403")
return request.redirect('/my')
# print report as sudo, since it require access to taxes, payment term, ... and portal
# does not have those access rights.
pdf = request.env.ref('account.account_invoices').sudo().render_qweb_pdf([invoice_id])[0]
@@ -5,11 +5,12 @@
from lxml import etree
from datetime import datetime
from dateutil.relativedelta import relativedelta
from werkzeug.urls import url_encode
from odoo import api, fields, models, _
from odoo import api, exceptions, fields, models, _
from odoo.tools import float_is_zero, float_compare, pycompat
from odoo.exceptions import UserError, RedirectWarning, ValidationError, Warning
from odoo.exceptions import AccessError, UserError, RedirectWarning, ValidationError, Warning
from odoo.addons import decimal_precision as dp
import logging
@@ -676,6 +677,57 @@ def action_invoice_cancel(self):
raise UserError(_("Invoice must be in draft or open state in order to be cancelled."))
return self.action_cancel()
@api.multi
def _notification_recipients(self, message, groups):
groups = super(AccountInvoice, self)._notification_recipients(message, groups)
for group_name, group_method, group_data in groups:
group_data['has_button_access'] = True
return groups
@api.multi
def get_access_action(self, access_uid=None):
""" Instead of the classic form view, redirect to the online invoice for portal users. """
self.ensure_one()
user, record = self.env.user, self
if access_uid:
user = self.env['res.users'].sudo().browse(access_uid)
record = self.sudo(user)
if user.share or self.env.context.get('force_website'):
try:
record.check_access_rule('read')
except exceptions.AccessError:
pass
else:
return {
'type': 'ir.actions.act_url',
'url': '/my/invoices?', # No controller /my/invoices/<int>, only a report pdf
'target': 'self',
'res_id': self.id,
}
return super(AccountInvoice, self).get_access_action(access_uid)
def get_mail_url(self):
self.ensure_one()
params = {
'model': self._name,
'res_id': self.id,
}
params.update(self.partner_id.signup_get_auth_param()[self.partner_id.id])
return '/mail/view?' + url_encode(params)
@api.multi
def get_signup_url(self):
self.ensure_one()
return self.partner_id.with_context(signup_valid=True)._get_signup_url_for_action(
action='/mail/view',
model=self._name,
res_id=self.id)[self.partner_id.id]
@api.multi
def get_formview_id(self, access_uid=None):
""" Update form view id of action to open the invoice """
@@ -128,5 +128,19 @@
<field name="domain_force">['|',('company_id','=',False),('company_id','child_of',[user.company_id.id])]</field>
</record>
<!-- Portal for invoice and invoice lines -->
<record id="account_invoice_rule_portal" model="ir.rule">
<field name="name">Portal Personal Account Invoices</field>
<field name="model_id" ref="account.model_account_invoice"/>
<field name="domain_force">[('message_partner_ids','child_of',[user.commercial_partner_id.id])]</field>
<field name="groups" eval="[(4, ref('base.group_portal'))]"/>
</record>
<record id="account_invoice_line_rule_portal" model="ir.rule">
<field name="name">Portal Invoice Lines</field>
<field name="model_id" ref="account.model_account_invoice_line"/>
<field name="domain_force">[('invoice_id.message_partner_ids','child_of',[user.commercial_partner_id.id])]</field>
<field name="groups" eval="[(4, ref('base.group_portal'))]"/>
</record>
</data>
</odoo>
@@ -40,6 +40,8 @@ access_res_currency_account_manager,res.currency account manager,base.model_res_
access_res_currency_rate_account_manager,res.currency.rate account manager,base.model_res_currency_rate,group_account_manager,1,1,1,1
access_account_invoice_user,account.invoice user,model_account_invoice,base.group_user,1,0,0,0
access_account_invoice_user,account.invoice.line user,model_account_invoice_line,base.group_user,1,0,0,0
access_account_invoice_portal,account.invoice.portal,account.model_account_invoice,base.group_portal,1,0,0,0
access_account_invoice_line_portal,account.invoice.line.portal,account.model_account_invoice_line,base.group_portal,1,0,0,0
access_account_payment_term_partner_manager,account.payment.term partner manager,model_account_payment_term,base.group_user,1,0,0,0
access_account_payment_term_line_partner_manager,account.payment.term.line partner manager,model_account_payment_term_line,base.group_user,1,0,0,0
access_account_fiscal_position_product_manager,account.fiscal.position account.manager,model_account_fiscal_position,account.group_account_manager,1,1,1,1
@@ -529,7 +529,7 @@
<filter name="late" string="Overdue" domain="['&amp;', ('date_due', '&lt;', time.strftime('%%Y-%%m-%%d')), ('state', '=', 'open')]" help="Overdue invoices, maturity date passed"/>
<separator/>
<field name="partner_id" operator="child_of"/>
<field name="user_id" string="Salesperson"/>
<field name="user_id" string="Salesperson" domain="[('share','=', False)]"/>
<field name="date" string="Period"/>
<separator/>
<filter domain="[('user_id','=',uid)]" help="My Invoices"/>
@@ -1,13 +1,13 @@
<odoo>
<template id="portal_my_home_menu_invoice" name="Portal layout : invoice menu entries" inherit_id="website_portal.portal_layout" priority="30">
<template id="portal_my_home_menu_invoice" name="Portal layout : invoice menu entries" inherit_id="portal.portal_layout" priority="30">
<xpath expr="//ol[contains(@class,'o_portal_submenu')]" position="inside">
<li t-if="page_name == 'invoice'" class="active">
Invoices
</li>
</xpath>
</template>
<template id="portal_my_home_invoice" name="Portal My Home : invoice entries" inherit_id="website_portal.portal_my_home" priority="30">
<template id="portal_my_home_invoice" name="Portal My Home : invoice entries" inherit_id="portal.portal_my_home" priority="30">
<xpath expr="//ul[contains(@class,'o_portal_docs')]" position="inside">
<li t-if="invoice_count" class="list-group-item">
<span class="badge" t-esc="invoice_count"/>
@@ -17,9 +17,9 @@
</template>
<template id="portal_my_invoices" name="My Invoices and Payments">
<t t-call="website_portal.portal_layout">
<t t-call="portal.portal_layout">
<h3>Invoices
<t t-call="website_portal.portal_searchbar"/>
<t t-call="portal.portal_searchbar"/>
</h3>
<t t-if="not invoices">
<p>There are currently no invoices and payments for your account.</p>
@@ -32,7 +32,6 @@
<th>Invoice Date</th>
<th class='hidden-xs'>Due Date</th>
<th></th>
<th></th>
<th>Amount Due</th>
</tr>
</thead>
@@ -54,15 +53,12 @@
<span class="label label-default"><i class="fa fa-fw fa-remove"></i><span class="hidden-xs"> Cancelled</span></span>
</t>
</td>
<td>
<a t-if="invoice.state == 'open'" t-attf-href="/website_payment/pay?reference=#{invoice.number}&amp;amount=#{invoice.residual}&amp;currency_id=#{invoice.currency_id.id}&amp;country_id=#{invoice.partner_id.country_id.id}" alt="Pay Now" class="btn btn-xs btn-primary"><i class="fa fa-arrow-circle-right"/><span class='hidden-xs'> Pay Now</span></a>
</td>
<td><span t-field="invoice.residual" t-options='{"widget": "monetary", "display_currency": invoice.currency_id}'/></td>
</tr>
</t>
</table></div>
<div t-if="pager" class="o_portal_pager text-center">
<t t-call="website.pager"/>
<t t-call="portal.pager"/>
</div>
</div>
</t>
@@ -1,4 +1,2 @@
# -*- coding: utf-8 -*-
# Part of Odoo. See LICENSE file for full copyright and licensing details.
from . import main
@@ -0,0 +1,21 @@
# -*- coding: utf-8 -*-
{
'name': 'Payment - Account',
'category': 'Accounting',
'summary': 'Account and Payment Link and Portal',
'version': '1.0',
'description': """Link Account and Payment and add Portal Payment
Provide tools for account-related payment as well as portal options to
enable payment.
* UPDATE ME
""",
'depends': ['payment', 'account'],
'data': [
'views/account_portal_templates.xml',
],
'installable': True,
'auto_install': False,
}
@@ -0,0 +1,14 @@
<odoo>
<template id="portal_my_invoices_payment" name="Payment on My Invoices" inherit_id="account.portal_my_invoices">
<xpath expr="//table[contains(@class, 'o_my_status_table')]/thead/tr/th[last()]" position="before">
<th></th>
</xpath>
<xpath expr="//t[@t-foreach='invoices']/tr/td[last()]" position="before">
<td>
<a t-if="invoice.state == 'open'" t-attf-href="/website_payment/pay?reference=#{invoice.number}&amp;amount=#{invoice.residual}&amp;currency_id=#{invoice.currency_id.id}&amp;country_id=#{invoice.partner_id.country_id.id}" alt="Pay Now" class="btn btn-xs btn-primary">
<i class="fa fa-arrow-circle-right"/><span class='hidden-xs'> Pay Now</span>
</a>
</td>
</xpath>
</template>
</odoo>
@@ -1,5 +1,6 @@
# -*- coding: utf-8 -*-
from . import base_config_settings
from . import ir_http
from . import res_partner
from . import res_users
@@ -0,0 +1,19 @@
# -*- coding: utf-8 -*-
# Part of Odoo. See LICENSE file for full copyright and licensing details.
from odoo import models
from odoo.http import request
class Http(models.AbstractModel):
_inherit = 'ir.http'
@classmethod
def _dispatch(cls):
# add signup token or login to the session if given
if 'auth_signup_token' in request.params:
request.session['auth_signup_token'] = request.params['auth_signup_token']
if 'auth_login' in request.params:
request.session['auth_login'] = request.params['auth_login']
return super(Http, cls)._dispatch()
@@ -1,5 +1,4 @@
# -*- coding: utf-8 -*-
# Part of Odoo. See LICENSE file for full copyright and licensing details.
from . import controllers
from . import models
@@ -0,0 +1,16 @@
# -*- coding: utf-8 -*-
# Part of Odoo. See LICENSE file for full copyright and licensing details.
{
'name': 'Web Routing',
'summary': 'Web Routing',
'sequence': '9100',
'category': 'Hidden',
'description': """
Proposes advanced routing options not available in web or base to keep
base modules simple.
""",
'data': [
],
'depends': ['web'],
}
@@ -0,0 +1,5 @@
# -*- coding: utf-8 -*-
# Part of Odoo. See LICENSE file for full copyright and licensing details.
from . import ir_http
from . import ir_ui_view
Oops, something went wrong.

0 comments on commit c3c4265

Please sign in to comment.