How to update Destination Location of selected lines in Odoo V8How can I do a line break (line continuation) in Python?How to randomly select an item from a list?How can I know which radio button is selected via jQuery?How can I select an element with multiple classes in jQuery?How can I select an element by name with jQuery?How to read a file line-by-line into a list?How do I pass command line arguments to a Node.js program?How do I update each dependency in package.json to the latest version?Error when try to convert order in invoiceODOO, calendar.event : bool have no attribute replace

How can I successfully establish a nationwide combat training program for a large country?

Indicating multiple different modes of speech (fantasy language or telepathy)

Have I saved too much for retirement so far?

Resetting two CD4017 counters simultaneously, only one resets

No idea how to draw this using tikz

Lightning Web Component - do I need to track changes for every single input field in a form

Word describing multiple paths to the same abstract outcome

Is exact Kanji stroke length important?

Taylor series of product of two functions

Who must act to prevent Brexit on March 29th?

Superhero words!

Greatest common substring

What is the oldest known work of fiction?

Is there enough fresh water in the world to eradicate the drinking water crisis?

Lifted its hind leg on or lifted its hind leg towards?

Is a naturally all "male" species possible?

I'm in charge of equipment buying but no one's ever happy with what I choose. How to fix this?

How to deal with or prevent idle in the test team?

Can I create an upright 7-foot × 5-foot wall with the Minor Illusion spell?

What is the term when two people sing in harmony, but they aren't singing the same notes?

How to prevent YouTube from showing already watched videos?

The One-Electron Universe postulate is true - what simple change can I make to change the whole universe?

Did US corporations pay demonstrators in the German demonstrations against article 13?

Can the harmonic series explain the origin of the major scale?



How to update Destination Location of selected lines in Odoo V8


How can I do a line break (line continuation) in Python?How to randomly select an item from a list?How can I know which radio button is selected via jQuery?How can I select an element with multiple classes in jQuery?How can I select an element by name with jQuery?How to read a file line-by-line into a list?How do I pass command line arguments to a Node.js program?How do I update each dependency in package.json to the latest version?Error when try to convert order in invoiceODOO, calendar.event : bool have no attribute replace













1















I have a problem in the Function Python for updating the destination location of selected lines in a Delivery order.



This is my javascript for selecting lines (in the JS, i call the function update_locations()) :



openerp.web_one2many_selectable = function(instance, m) 

var _t = instance.web._t,
_lt = instance.web._lt;
QWeb = instance.web.qweb;

instance.web.form.widgets = instance.web.form.widgets.extend(

'one2many_selectable' : 'instance.web.form.One2ManySelectable',
);

instance.web.form.One2ManySelectable =
instance.web.form.FieldOne2Many.extend(

multi_selection: true,
start: function()

this._super.apply(this, arguments);
var self=this;
self.on("change:effective_readonly", this, function()
if(this.get("effective_readonly"))
self.$(".ep_button_confirm").attr("disabled", "");
else
self.$(".ep_button_confirm").removeAttr("disabled", "");
);
this.$el.prepend(QWeb.render("One2ManySelectable", widget: this));
this.$el.find(".ep_button_confirm").click(function()
self.action_selected_lines();
);
,

action_selected_lines: function()

var self=this;
selected_ids=self.get_selected_ids_one2many();

var model_obj=new instance.web.Model("stock.picking");
model_obj.call('update_locations',
[selected_ids],context:self.dataset.context)
.then(function(result)
);

,
get_selected_ids_one2many: function ()

var ids =[];
this.$el.find('th.oe_list_record_selector input:checked')
.closest('tr').each(function ()
ids.push(parseInt($(this).context.dataset.id));
);
return ids;
,
);



And here is my Class Python (I think the problem is in the function update_locations() ) :



from openerp import models, fields, api


class stock_picking(models.Model):
_inherit = 'stock.picking'

new_location_dest_id = fields.Many2one(
'stock.location', 'Destination Location',
readonly=True,
states=
'draft': [('readonly', False)],
'waiting': [('readonly', False)],
'confirmed': [('readonly', False)],
,
help="Location where the system will stock the finished products. This will be the default of the associated stock moves.")

@api.one
def update_locations(self):
vals =
'location_dest_id': self.new_location_dest_id.id

self.move_lines.write(vals)


When i select some lines and specify the location destination and click on the button for changing destination. a Message Error Appears :



Odoo MissingError One of the documents you are trying to access has been deleted, please try again after refreshing



i'm available for more informations, Thank you for your help guys.










share|improve this question


























    1















    I have a problem in the Function Python for updating the destination location of selected lines in a Delivery order.



    This is my javascript for selecting lines (in the JS, i call the function update_locations()) :



    openerp.web_one2many_selectable = function(instance, m) 

    var _t = instance.web._t,
    _lt = instance.web._lt;
    QWeb = instance.web.qweb;

    instance.web.form.widgets = instance.web.form.widgets.extend(

    'one2many_selectable' : 'instance.web.form.One2ManySelectable',
    );

    instance.web.form.One2ManySelectable =
    instance.web.form.FieldOne2Many.extend(

    multi_selection: true,
    start: function()

    this._super.apply(this, arguments);
    var self=this;
    self.on("change:effective_readonly", this, function()
    if(this.get("effective_readonly"))
    self.$(".ep_button_confirm").attr("disabled", "");
    else
    self.$(".ep_button_confirm").removeAttr("disabled", "");
    );
    this.$el.prepend(QWeb.render("One2ManySelectable", widget: this));
    this.$el.find(".ep_button_confirm").click(function()
    self.action_selected_lines();
    );
    ,

    action_selected_lines: function()

    var self=this;
    selected_ids=self.get_selected_ids_one2many();

    var model_obj=new instance.web.Model("stock.picking");
    model_obj.call('update_locations',
    [selected_ids],context:self.dataset.context)
    .then(function(result)
    );

    ,
    get_selected_ids_one2many: function ()

    var ids =[];
    this.$el.find('th.oe_list_record_selector input:checked')
    .closest('tr').each(function ()
    ids.push(parseInt($(this).context.dataset.id));
    );
    return ids;
    ,
    );



    And here is my Class Python (I think the problem is in the function update_locations() ) :



    from openerp import models, fields, api


    class stock_picking(models.Model):
    _inherit = 'stock.picking'

    new_location_dest_id = fields.Many2one(
    'stock.location', 'Destination Location',
    readonly=True,
    states=
    'draft': [('readonly', False)],
    'waiting': [('readonly', False)],
    'confirmed': [('readonly', False)],
    ,
    help="Location where the system will stock the finished products. This will be the default of the associated stock moves.")

    @api.one
    def update_locations(self):
    vals =
    'location_dest_id': self.new_location_dest_id.id

    self.move_lines.write(vals)


    When i select some lines and specify the location destination and click on the button for changing destination. a Message Error Appears :



    Odoo MissingError One of the documents you are trying to access has been deleted, please try again after refreshing



    i'm available for more informations, Thank you for your help guys.










    share|improve this question
























      1












      1








      1








      I have a problem in the Function Python for updating the destination location of selected lines in a Delivery order.



      This is my javascript for selecting lines (in the JS, i call the function update_locations()) :



      openerp.web_one2many_selectable = function(instance, m) 

      var _t = instance.web._t,
      _lt = instance.web._lt;
      QWeb = instance.web.qweb;

      instance.web.form.widgets = instance.web.form.widgets.extend(

      'one2many_selectable' : 'instance.web.form.One2ManySelectable',
      );

      instance.web.form.One2ManySelectable =
      instance.web.form.FieldOne2Many.extend(

      multi_selection: true,
      start: function()

      this._super.apply(this, arguments);
      var self=this;
      self.on("change:effective_readonly", this, function()
      if(this.get("effective_readonly"))
      self.$(".ep_button_confirm").attr("disabled", "");
      else
      self.$(".ep_button_confirm").removeAttr("disabled", "");
      );
      this.$el.prepend(QWeb.render("One2ManySelectable", widget: this));
      this.$el.find(".ep_button_confirm").click(function()
      self.action_selected_lines();
      );
      ,

      action_selected_lines: function()

      var self=this;
      selected_ids=self.get_selected_ids_one2many();

      var model_obj=new instance.web.Model("stock.picking");
      model_obj.call('update_locations',
      [selected_ids],context:self.dataset.context)
      .then(function(result)
      );

      ,
      get_selected_ids_one2many: function ()

      var ids =[];
      this.$el.find('th.oe_list_record_selector input:checked')
      .closest('tr').each(function ()
      ids.push(parseInt($(this).context.dataset.id));
      );
      return ids;
      ,
      );



      And here is my Class Python (I think the problem is in the function update_locations() ) :



      from openerp import models, fields, api


      class stock_picking(models.Model):
      _inherit = 'stock.picking'

      new_location_dest_id = fields.Many2one(
      'stock.location', 'Destination Location',
      readonly=True,
      states=
      'draft': [('readonly', False)],
      'waiting': [('readonly', False)],
      'confirmed': [('readonly', False)],
      ,
      help="Location where the system will stock the finished products. This will be the default of the associated stock moves.")

      @api.one
      def update_locations(self):
      vals =
      'location_dest_id': self.new_location_dest_id.id

      self.move_lines.write(vals)


      When i select some lines and specify the location destination and click on the button for changing destination. a Message Error Appears :



      Odoo MissingError One of the documents you are trying to access has been deleted, please try again after refreshing



      i'm available for more informations, Thank you for your help guys.










      share|improve this question














      I have a problem in the Function Python for updating the destination location of selected lines in a Delivery order.



      This is my javascript for selecting lines (in the JS, i call the function update_locations()) :



      openerp.web_one2many_selectable = function(instance, m) 

      var _t = instance.web._t,
      _lt = instance.web._lt;
      QWeb = instance.web.qweb;

      instance.web.form.widgets = instance.web.form.widgets.extend(

      'one2many_selectable' : 'instance.web.form.One2ManySelectable',
      );

      instance.web.form.One2ManySelectable =
      instance.web.form.FieldOne2Many.extend(

      multi_selection: true,
      start: function()

      this._super.apply(this, arguments);
      var self=this;
      self.on("change:effective_readonly", this, function()
      if(this.get("effective_readonly"))
      self.$(".ep_button_confirm").attr("disabled", "");
      else
      self.$(".ep_button_confirm").removeAttr("disabled", "");
      );
      this.$el.prepend(QWeb.render("One2ManySelectable", widget: this));
      this.$el.find(".ep_button_confirm").click(function()
      self.action_selected_lines();
      );
      ,

      action_selected_lines: function()

      var self=this;
      selected_ids=self.get_selected_ids_one2many();

      var model_obj=new instance.web.Model("stock.picking");
      model_obj.call('update_locations',
      [selected_ids],context:self.dataset.context)
      .then(function(result)
      );

      ,
      get_selected_ids_one2many: function ()

      var ids =[];
      this.$el.find('th.oe_list_record_selector input:checked')
      .closest('tr').each(function ()
      ids.push(parseInt($(this).context.dataset.id));
      );
      return ids;
      ,
      );



      And here is my Class Python (I think the problem is in the function update_locations() ) :



      from openerp import models, fields, api


      class stock_picking(models.Model):
      _inherit = 'stock.picking'

      new_location_dest_id = fields.Many2one(
      'stock.location', 'Destination Location',
      readonly=True,
      states=
      'draft': [('readonly', False)],
      'waiting': [('readonly', False)],
      'confirmed': [('readonly', False)],
      ,
      help="Location where the system will stock the finished products. This will be the default of the associated stock moves.")

      @api.one
      def update_locations(self):
      vals =
      'location_dest_id': self.new_location_dest_id.id

      self.move_lines.write(vals)


      When i select some lines and specify the location destination and click on the button for changing destination. a Message Error Appears :



      Odoo MissingError One of the documents you are trying to access has been deleted, please try again after refreshing



      i'm available for more informations, Thank you for your help guys.







      javascript python function odoo odoo-8






      share|improve this question













      share|improve this question











      share|improve this question




      share|improve this question










      asked Mar 7 at 10:08









      Hamza LarmoudHamza Larmoud

      183




      183






















          1 Answer
          1






          active

          oldest

          votes


















          0














          I think that you do not need javascript, just a small module with a wizard, written using python and xml only. In the source code of Odoo itself you have a lot of them as examples, just look for the model used, models.TransientModel.






          share|improve this answer






















            Your Answer






            StackExchange.ifUsing("editor", function ()
            StackExchange.using("externalEditor", function ()
            StackExchange.using("snippets", function ()
            StackExchange.snippets.init();
            );
            );
            , "code-snippets");

            StackExchange.ready(function()
            var channelOptions =
            tags: "".split(" "),
            id: "1"
            ;
            initTagRenderer("".split(" "), "".split(" "), channelOptions);

            StackExchange.using("externalEditor", function()
            // Have to fire editor after snippets, if snippets enabled
            if (StackExchange.settings.snippets.snippetsEnabled)
            StackExchange.using("snippets", function()
            createEditor();
            );

            else
            createEditor();

            );

            function createEditor()
            StackExchange.prepareEditor(
            heartbeatType: 'answer',
            autoActivateHeartbeat: false,
            convertImagesToLinks: true,
            noModals: true,
            showLowRepImageUploadWarning: true,
            reputationToPostImages: 10,
            bindNavPrevention: true,
            postfix: "",
            imageUploader:
            brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
            contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
            allowUrls: true
            ,
            onDemand: true,
            discardSelector: ".discard-answer"
            ,immediatelyShowMarkdownHelp:true
            );



            );













            draft saved

            draft discarded


















            StackExchange.ready(
            function ()
            StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f55041073%2fhow-to-update-destination-location-of-selected-lines-in-odoo-v8%23new-answer', 'question_page');

            );

            Post as a guest















            Required, but never shown

























            1 Answer
            1






            active

            oldest

            votes








            1 Answer
            1






            active

            oldest

            votes









            active

            oldest

            votes






            active

            oldest

            votes









            0














            I think that you do not need javascript, just a small module with a wizard, written using python and xml only. In the source code of Odoo itself you have a lot of them as examples, just look for the model used, models.TransientModel.






            share|improve this answer



























              0














              I think that you do not need javascript, just a small module with a wizard, written using python and xml only. In the source code of Odoo itself you have a lot of them as examples, just look for the model used, models.TransientModel.






              share|improve this answer

























                0












                0








                0







                I think that you do not need javascript, just a small module with a wizard, written using python and xml only. In the source code of Odoo itself you have a lot of them as examples, just look for the model used, models.TransientModel.






                share|improve this answer













                I think that you do not need javascript, just a small module with a wizard, written using python and xml only. In the source code of Odoo itself you have a lot of them as examples, just look for the model used, models.TransientModel.







                share|improve this answer












                share|improve this answer



                share|improve this answer










                answered Mar 15 at 15:27









                Victor G.Victor G.

                365




                365





























                    draft saved

                    draft discarded
















































                    Thanks for contributing an answer to Stack Overflow!


                    • Please be sure to answer the question. Provide details and share your research!

                    But avoid


                    • Asking for help, clarification, or responding to other answers.

                    • Making statements based on opinion; back them up with references or personal experience.

                    To learn more, see our tips on writing great answers.




                    draft saved


                    draft discarded














                    StackExchange.ready(
                    function ()
                    StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f55041073%2fhow-to-update-destination-location-of-selected-lines-in-odoo-v8%23new-answer', 'question_page');

                    );

                    Post as a guest















                    Required, but never shown





















































                    Required, but never shown














                    Required, but never shown












                    Required, but never shown







                    Required, but never shown

































                    Required, but never shown














                    Required, but never shown












                    Required, but never shown







                    Required, but never shown







                    Popular posts from this blog

                    Save data to MySQL database using ExtJS and PHP [closed]2019 Community Moderator ElectionHow can I prevent SQL injection in PHP?Which MySQL data type to use for storing boolean valuesPHP: Delete an element from an arrayHow do I connect to a MySQL Database in Python?Should I use the datetime or timestamp data type in MySQL?How to get a list of MySQL user accountsHow Do You Parse and Process HTML/XML in PHP?Reference — What does this symbol mean in PHP?How does PHP 'foreach' actually work?Why shouldn't I use mysql_* functions in PHP?

                    Compiling GNU Global with universal-ctags support Announcing the arrival of Valued Associate #679: Cesar Manara Planned maintenance scheduled April 23, 2019 at 23:30 UTC (7:30pm US/Eastern) Data science time! April 2019 and salary with experience The Ask Question Wizard is Live!Tags for Emacs: Relationship between etags, ebrowse, cscope, GNU Global and exuberant ctagsVim and Ctags tips and trickscscope or ctags why choose one over the other?scons and ctagsctags cannot open option file “.ctags”Adding tag scopes in universal-ctagsShould I use Universal-ctags?Universal ctags on WindowsHow do I install GNU Global with universal ctags support using Homebrew?Universal ctags with emacsHow to highlight ctags generated by Universal Ctags in Vim?

                    Add ONERROR event to image from jsp tldHow to add an image to a JPanel?Saving image from PHP URLHTML img scalingCheck if an image is loaded (no errors) with jQueryHow to force an <img> to take up width, even if the image is not loadedHow do I populate hidden form field with a value set in Spring ControllerStyling Raw elements Generated from JSP tagds with Jquery MobileLimit resizing of images with explicitly set width and height attributeserror TLD use in a jsp fileJsp tld files cannot be resolved