-
Notifications
You must be signed in to change notification settings - Fork 17
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
[16.0][ADD] website_sale_product_compatibility and website_sale_product_contract_gift #351
base: 16.0
Are you sure you want to change the base?
Conversation
This module is a base module for adding compatibility check between product in a sale order for the e-commerce. This comes with the refactoring of the module website_sale_restrict_sepa_dd.
Add product contract that can be set as gift and therefore generate some specific compatibilities and flow.
647cecb
to
96eeae1
Compare
b0ed365
to
187c521
Compare
187c521
to
a3d82cd
Compare
Create new partner or match existing partner when creating contract for gift. Create user when the invoice is generated at the gift date. Missing sending an email to the user for telling them they get a gift.
all() retrun true with an empty recordset. Which in this case is not correct.
@@ -0,0 +1 @@ | |||
Form to order subscription product |
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 doesn’t match the module summary. moreover, this module needs a little more explanation for the reader to understand what its purpose is.
suggestion: This is a utility module that can be used by other modules to check whether different products are allowed to be added to the same e-commerce sale order.
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.
the name of the class should be updated.
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 file shouldn’t be in this module.
|
||
:product_id: The id of the product to check compatibility. | ||
:rtype: str | ||
:retrun: warning message to be shown on the web interface. |
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.
:retrun: warning message to be shown on the web interface. | |
:return: warning message to be shown on the web interface. |
:retrun: warning message to be shown on the web interface. | ||
""" | ||
self.ensure_one() | ||
return "" |
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 think that returning None
is more clean than an empty string.
invoices.mapped("line_ids") | ||
.mapped("contract_line_id") | ||
.mapped("contract_id") | ||
.mapped("is_gift") |
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.
invoices.mapped("line_ids") | |
.mapped("contract_line_id") | |
.mapped("contract_id") | |
.mapped("is_gift") | |
invoices.line_ids.contract_line_id.contract_id | |
.mapped("is_gift") |
<b>Date of the gift:</b> <span | ||
t-field="website_sale_order.gift_date" | ||
/> |
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 is the difference between gift_date
and date_for_gift
?
</template> | ||
|
||
<template id="checkout" inherit_id="website_sale.checkout"> | ||
<!-- Add date for gift formular --> |
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.
formular → form
<!-- Replace confirm button --> | ||
<xpath expr="//a[@href='/shop/confirm_order']" position="attributes"> | ||
<attribute name="style">display: none;</attribute> | ||
</xpath> | ||
|
||
<xpath expr="//a[@href='/shop/confirm_order']" position="after"> | ||
<button id="gift_form_confirm_button" class="btn btn-primary mb32"> | ||
Confirm | ||
<i class="fa fa-chevron-right" /> | ||
</button> | ||
</xpath> |
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.
hiding a button with css and adding another one is kind of ugly. can’t the original button be used differently instead (by overriding some maybe)?
expr="//div[hasclass('oe_cart')]//h3[@class='o_page_header mt16 mb4']" | ||
position="after" | ||
> | ||
<h3 |
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.
two <h3>
one right after the other seems strange. i think it should either be a <h4>
or the existing <h3>
should be modified.
Error when computing gift_date on an order without gift product.
Description
Move compatibility features in a new module.
Create gift module.
Odoo task (if applicable)
task
Checklist before approval