Odoo Help

Welcome!

This community is for beginners and experts willing to share their Odoo knowledge. It's not a forum to discuss ideas, but a knowledge base of questions and their answers.

0

Adding a button to a row in one2many_list widget

By
Simon Lee
on 3/19/16, 8:29 AM 297 views

Hi All,

I am trying to find a way to implement a way to split a line of an incoming shipment by adding a button to a row of the one2many_list widget.

Here's the scenario.

1) I create a PO0001 with just one item in it

    Ice Cream     20 pcs     $10/pc            $200

2) When I receive the shipment, the goods have 2 different expiry dates, 20160730 and 20160830

    The odoo9 incoming shipment form will show one row:

    Ice Cream    20 pcs      blank-to-be-fill-with-expiry-date


    I want to add a button to each row of the one2many_list widget as followed:

    Ice Cream    20 pcs      blank-to-be-fill-with-expiry-date    Split-Button-Icon


    When the "Split-Button-Icon" of the row is pressed, it will duplicate the line so it will look like this:

    Ice Cream    10 pcs      blank-to-be-fill-with-expiry-date    Split-Button-Icon

    Ice Cream    10 pcs      blank-to-be-fill-with-expiry-date    Split-Button-Icon


    Now I can enter the expiry date and the quantity accordingly as followed and confirm the receipt.

    Ice Cream    10 pcs      20160730    Split-Button-Icon

    Ice Cream    10 pcs      20160830    Split-Button-Icon


My question is to have an example of adding an icon-button to the odoo9 one2many_list widget. Also, when clicking on the button, how to write an action to duplicate and insert the current row right after the current row in the one2many_list widget. Your kind advise is much appreciated.

Simon Lee



Your Answer

Please try to give a substantial answer. If you wanted to comment on the question or answer, just use the commenting tool. Please remember that you can always revise your answers - no need to answer the same question twice. Also, please don't forget to vote - it really helps to select the best questions and answers!

About This Community

This community is for professionals and enthusiasts of our products and services. Read Guidelines

Question tools

1 follower(s)

Stats

Asked: 3/19/16, 8:29 AM
Seen: 297 times
Last updated: 3/19/16, 9:29 AM