Skip to content
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

Master optional products no reload pla #32551

Open
wants to merge 2 commits into
base: master
from

Conversation

Projects
None yet
4 participants
@pla-odoo
Copy link
Contributor

commented Apr 9, 2019

Description of the issue/feature this PR addresses:
Task link: https://www.odoo.com/web?debug#id=1961015&action=333&active_id=131&model=project.task&view_type=form&menu_id=4720

Current behavior before PR:

Desired behavior after PR is merged:

--
I confirm I have signed the CLA and read the PR guidelines at www.odoo.com/submit-pr

@robodoo robodoo added the CI 🤖 label Apr 9, 2019

@C3POdoo C3POdoo added the RD label Apr 9, 2019

@qsm-odoo
Copy link
Contributor

left a comment

Just some conventions comments, could you fix? Is this task finished according to you? :)

@@ -23,13 +23,21 @@ def update(self, line_id, remove=False, unlink=False, order_id=None, access_toke
return False
if unlink:
order_line.unlink()
return False # return False to reload the page, the line must move back to options and the JS doesn't handle it
template = request.env['ir.ui.view'].render_template("sale.sale_order_portal_content", {
'sale_order': order_sudo, 'report_type': "html",

This comment has been minimized.

Copy link
@qsm-odoo

qsm-odoo Apr 10, 2019

Contributor

Two lines for this

template = request.env['ir.ui.view'].render_template("sale.sale_order_portal_content", {
'sale_order': order_sudo, 'report_type': "html",
})
return {'amount': str(order_sudo.amount_total), 'sale_order_portal_content': template}

This comment has been minimized.

Copy link
@qsm-odoo

qsm-odoo Apr 10, 2019

Contributor

Make the dict definition over multiple lines:

{
    'amount': ...,
...
'quantity': str(quantity),
'amount': str(order_sudo.amount_total),
'price_subtotal': str(order_line.price_subtotal)
}

This comment has been minimized.

Copy link
@qsm-odoo

qsm-odoo Apr 10, 2019

Contributor

Wrong indentation

return [str(quantity), str(order_sudo.amount_total)]

@http.route(["/my/orders/<int:order_id>/add_option/<int:option_id>"], type='http', auth="public", website=True)
value = {

This comment has been minimized.

Copy link
@qsm-odoo

qsm-odoo Apr 10, 2019

Contributor

Why using a temporary variable for this ? Just return the dict

var orderID = href.match(/my\/orders\/([0-9]+)/);
var lineID = href.match(/update_line\/([0-9]+)/);
var $input = $(ev.currentTarget);
this.$input = $input;

This comment has been minimized.

Copy link
@qsm-odoo

qsm-odoo Apr 10, 2019

Contributor

Why saving the input variable in this ?

}
self.$el.closest('.input-group').find('.js_quantity').val(data[0]);
$('[data-id="total_amount"] > span').html(data[1]);
else {

This comment has been minimized.

Copy link
@qsm-odoo

qsm-odoo Apr 10, 2019

Contributor

Else on the same line as the closing brace of the if, see https://github.com/odoo/odoo/wiki/Javascript-coding-guidelines

window.location.reload();
if (!data['quantity']) {
self.$el.find('.sale_order_portal').empty();
self.$el.find('.sale_order_portal').append($(data['sale_order_portal_content']).children());

This comment has been minimized.

Copy link
@qsm-odoo

qsm-odoo Apr 10, 2019

Contributor

self.$el.find( => self.$(


/**
* @private
*/

This comment has been minimized.

Copy link
@qsm-odoo

qsm-odoo Apr 10, 2019

Contributor

Wrong indentation + Missing @param

@robodoo robodoo added CI 🤖 and removed CI 🤖 labels Apr 10, 2019

@pla-odoo pla-odoo force-pushed the odoo-dev:master-optional-products-no-reload-pla branch from 16a32b8 to ccdca87 Apr 10, 2019

@robodoo robodoo removed the CI 🤖 label Apr 10, 2019

@pla-odoo

This comment has been minimized.

Copy link
Contributor Author

commented Apr 10, 2019

Just some conventions comments, could you fix? Is this task finished according to you? :)

Hello @qsm-odoo changes are done. Please check it!

@pla-odoo pla-odoo force-pushed the odoo-dev:master-optional-products-no-reload-pla branch from ccdca87 to 5b3359d Apr 11, 2019

@robodoo robodoo added the CI 🤖 label Apr 11, 2019

@mba-odoo mba-odoo force-pushed the odoo-dev:master-optional-products-no-reload-pla branch from 5b3359d to 479d550 Apr 15, 2019

@robodoo robodoo removed the CI 🤖 label Apr 15, 2019

@mba-odoo mba-odoo force-pushed the odoo-dev:master-optional-products-no-reload-pla branch 5 times, most recently from 6882953 to 2bd9621 Apr 15, 2019

@robodoo robodoo added the CI 🤖 label Apr 15, 2019

@mba-odoo mba-odoo force-pushed the odoo-dev:master-optional-products-no-reload-pla branch from 2bd9621 to 44649b3 Apr 16, 2019

@robodoo robodoo removed the CI 🤖 label Apr 16, 2019

@mba-odoo mba-odoo force-pushed the odoo-dev:master-optional-products-no-reload-pla branch 3 times, most recently from f6d2a56 to 3afc620 Apr 16, 2019

mba-odoo added a commit to odoo-dev/odoo that referenced this pull request Apr 16, 2019

[IMP] sale, sale_management: avoid reload when add optional product a…
…dded in portal

porpose of the task is to avoid the reload of the web client
when you add an optional product, in the customer portal

commit will also fix the below issue:
 - Sidebar total was not updated on optional product quanity change
 - optional product quantity layout issue fixed
 - optional product quantity update it was allowed minus (-) values
which was prevent there should be minimum 1 value required.

Task-1961015
Closes : odoo#32551

pla-odoo added some commits Apr 4, 2019

[IMP] sale, sale_management: avoid reload when add optional product a…
…dded in portal

porpose of the task is to avoid the reload of the web client
when you add an optional product, in the customer portal

commit will also fix the below issue:
 - Sidebar total was not updated on optional product quanity change
 - optional product quantity layout issue fixed
 - optional product quantity update remove the line if qunaity will be 0.
 - make quantity input box readonly as it was not change anything if user
update qty directly from input.

Task-1961015
Closes : #32551

@mba-odoo mba-odoo force-pushed the odoo-dev:master-optional-products-no-reload-pla branch from 3afc620 to aad8914 Apr 16, 2019

@robodoo robodoo added the CI 🤖 label Apr 16, 2019

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.