[10.0][ADD] Add website_portal_contract#62
Conversation
bc4b43c to
31674b3
Compare
|
@BMW95 what is your issue in the controller test? Did you try an That JS selects some elements matching some selectors inside of |
|
@lasley thanks for the help. Got the JS issue fixed, however I'm still having issues with the tests, and also rendering a pdf report. Issues below: Tests
Reports
|
|
@BMW95 with the controller, why not just use a tour to make sure that the rendered template contains what's needed? Look at this sample, making sure to set it up in Python and including the tour in assets when in demo mode |
|
Regarding the report, why are you creating a PDF? This is a website based addon. |
|
I was following what was being done in website_quote, which allows the customer to print their quotes from website to a pdf. Will remove that feature. |
|
Let's add that to roadmap |
b91b562 to
f6ae2a2
Compare
| { | ||
| content: 'Click on Your Contracts', | ||
| trigger: "a:contains('Your Contracts')", | ||
| }, |
There was a problem hiding this comment.
@lasley so I built this tour for the js testing. This first step passes, however the next step fails I believe because it's a new url page.
I want the trigger to redirect the url to a new page, but not sure if this is the way to do that. Is this correct?
There was a problem hiding this comment.
You should perform the interactions to get to the page you need. How would the user do it?
There was a problem hiding this comment.
hrmmm this doesn't make sense. Everything works fine now in my browser when I run the test, but it's not happy in travis.
One of the travis tests are passing currently, and when I pushed the last WIP commit, all the tests passed on the LasLabs side.
There was a problem hiding this comment.
Maybe something with the cross merge. Try rebasing onto current OCA/10.0 to at least if we can make the fail consistent across Travis
b3ccf89 to
b241ebf
Compare
c1d4a1c to
84d5ac5
Compare
|
Updated! |
|
|
||
| def test_template_view(self): | ||
| """ It should respond with 200 status """ | ||
| response = self.url_open('/contract/template/1') |
There was a problem hiding this comment.
You're not triggering the controller, which means you're likely throwing in a bad ID. Are you sure the template ID is 1? Why not use an env.ref().id instead
There was a problem hiding this comment.
Nope. You're not logged in, so it's sending you to the login page.
self.authenticate('admin', 'admin')
self.url_open
There was a problem hiding this comment.
oh i see interesting. The id in this case is definitely 1, but ye better idea to do ref.
I didn't realize you had to explicitly authenticate in this case, which solves my confusion as to why the method wasn't being covered.
|
Hmm. Everything seems to be passing except odoo/odoo travis. |
|
Hey! I approved with travis 💚 😄 Review: |
9bfabb0 to
60c64b3
Compare
|
@rafaelbn I'm having some consistency issues with the builds. With the extra test in, all LasLabs builds were passing, runbot was passing, and the OCA/OCB build was passing here as well, however the Odoo/Odoo travis was posting the error you have commented, which seems to be that it's timing out. There was one time where it was passing, so not entirely sure what the issue is there. I decided to remove the extra test if that's ok with you. def test_template_view(self):
""" It should respond with 200 status """
contract = self.env.ref(
'website_portal_contract.'
'website_contract_template_default'
)
self.authenticate('admin', 'admin')
response = self.url_open(
'/contract/template/%d' % contract.id
)
self.assertEquals(
response.getcode(),
200,
) |
|
@BMW95 - that is an invalid URL. Have you attempted a URL open on the contract template slug instead of the ID? |
|
Realistically you should still be receiving a 30x code (redirect), but something could be wonky with the internal test request or something. Never know |
60c64b3 to
060a6ca
Compare
|
Woot changing all the tests to HTTPCase worked! We can thank @sylvain-garancher for that one (OCA/report-print-send#95 (comment)) |
dab5bab to
e074076
Compare
|
Tests passing! |
|
@rafaelbn - have your comments been attended to? |
rafaelbn
left a comment
There was a problem hiding this comment.
Great 👍 . Please review if you can squash commits before merge
When calling _compute_payslip_line() call it on the payslip object and not recordset 'self'.

Hi there,
This module adds website templates to contracts as well as the ability to view them in
My Account.TODO
Need Help
Thanks!
Brett
@lasley