-
-
Notifications
You must be signed in to change notification settings - Fork 529
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[10.0][ADD] website_sale_contract #88
[10.0][ADD] website_sale_contract #88
Conversation
97e3c15
to
08a9265
Compare
|
||
ContractCheckout = self.env['contract.checkout'] | ||
|
||
contract_wizard = ContractCheckout.search(['order_id', '=', order.id]) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You should instead give your wizard model a method that takes an order ID and returns existing or creates new
}) | ||
|
||
if not contract_wizard.contract_ids: | ||
contract_wizard._create_temp_lines(sale_lines) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What if the sale lines change after going back? I think instead your model will need to have a method to manage differentials
return super(WebsiteSale, self).payment_confirmation(**post) | ||
|
||
|
||
class SaleContract(http.Controller): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Bad indentation
sale_order_id = request.session.get('sale_last_order_id') | ||
# if not accounts created, | ||
# do _convert_temp_lines_to_accounts() in contract_checkout | ||
# how to tell if been created? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't understand this comment/question. Elaborate?
lambda s: s.product_id.is_contract | ||
) | ||
|
||
sale_lines = sorted(lambda s: s.id, sale_lines) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Move this sort below the if not sale_lines
. Why sort if non-existent?
License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl). --> | ||
|
||
<odoo> | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Blank?
@api.multi | ||
def _create_temp_lines(self, sale_order_lines): | ||
self.ensure_one() | ||
ContractTemp = self.env['contract.temp'] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This seems pretty inefficient & I'm not fully understanding what you're going for. Is this so that you can create a linked list type hierarchy of the contracts for iteration? Is there any other point to the temp contracts?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah exactly about the linked list. That's so they can be looped through during checkout.
You mentioned in the #65 that the contracts won't be created until the final payment process has been completed, so in order to ensure those contracts have the signatory field data saved, there needed to be somewhere to temporarily save them.
for record in self: | ||
for contract in record.contract_ids: | ||
vals = { | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Blank
string='Contract Wizard', | ||
comodel_name='contract.checkout', | ||
) | ||
contract_signature = fields.Binary( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
signature_image
contract_signature = fields.Binary( | ||
string='Contract Signature', | ||
) | ||
signatory = fields.Char( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
signature_name
@yelizariev - FYI we're going to use this to upgrade the e-commerce purchase workflow provided by your SaaS tools, so it may interest you to look at this. |
@lasley here is a quick mockup of the contract view in checkout. Thought this might be an interesting thing to try earlier on since it can be so expensive changing things after the fact in dev. I'm considering moving that 'Accept Order` modal to the left side instead, to match what's done in website_quote (just to ensure js will work when inheriting) Perhaps moving the Back and Next buttons to the bottom might be a better as well. |
Thanks for the mockup @BMW95 - I sent out to a few stakeholders for review & will ponder over the weekend |
@BMW95 feedback on the mockup:
Everything else seems fine - basically identical to the portal, which is what we're going for. |
@rafaelbn I have some local code that's not quite ready to be pushed yet, but once it is I'll rebase :) |
08a9265
to
c177d3b
Compare
4d3344f
to
a376f83
Compare
Alright so this is ready for first round of review. I added a TODO at the top of the PR for the remaining things that need to be done so will be working on those. Page of a contract provided below. The Sign Contract button disappears and a Next link shows up next to Back when the contract has been signed. Couple Initial Questions
|
Thanks for the update @BMW95 - I'll review the code soon. To answer your questions: The pricing section should be switched to say "Terms" I think. Those terms would include how often the invoices for this contract are being created, and the invoice lines themselves would be in the table that's currently there. Isn't an actual sale order created during the confirmation step? AFAIK it's a quote throughout everything, but once the payment happens it should be an order in the |
Oh and we should probably include the product that was linked to the contract in the terms as well. It would be akin to a setup fee. |
Is this going to be finished? |
@pedrobaeza yup! Sorry just tied up with another item right now. Will be back on this soon. |
a376f83
to
3af6b0a
Compare
3af6b0a
to
b332dfb
Compare
b332dfb
to
c3d2c84
Compare
Also an odd thing that happens I've noticed ever since working on this module is the following error when
|
Does the error exist without this module installed?
Unrelated. It looks to be failing on the main branch for the same reason. |
Travis error is not unrelated. Main branch is green (there were some Travis glitches only). |
I double checked the
|
There hasn't been any activity on this pull request in the past 4 months, so it has been marked as stale and it will be closed automatically if no further activity occurs in the next 30 days. |
TODO