changeset 910ec3282814 in modules/stock:6.2
details: https://hg.tryton.org/modules/stock?cmd=changeset&node=910ec3282814
description:
        Rename inventory count button action

        This is to avoid collision with the ModelStorage.count method added by
        issue10623.

        issue11466
        review447071003
        (grafted from 765394e19ac2585b35ba931270ceaf80038ff719)
diffstat:

 inventory.py                             |  4 ++--
 inventory.xml                            |  2 +-
 tests/scenario_stock_inventory_count.rst |  2 +-
 view/inventory_form.xml                  |  2 +-
 4 files changed, 5 insertions(+), 5 deletions(-)

diffs (57 lines):

diff -r ba3fad95d8d4 -r 910ec3282814 inventory.py
--- a/inventory.py      Wed Apr 27 18:29:56 2022 +0200
+++ b/inventory.py      Sat May 07 18:48:45 2022 +0200
@@ -91,7 +91,7 @@
                     'readonly': Eval('state') != 'draft',
                     'depends': ['state'],
                     },
-                'count': {
+                'do_count': {
                     'readonly': Eval('state') != 'draft',
                     'depends': ['state'],
                     },
@@ -316,7 +316,7 @@
 
     @classmethod
     @ModelView.button_action('stock.wizard_inventory_count')
-    def count(cls, inventories):
+    def do_count(cls, inventories):
         cls.complete_lines(inventories)
 
 
diff -r ba3fad95d8d4 -r 910ec3282814 inventory.xml
--- a/inventory.xml     Wed Apr 27 18:29:56 2022 +0200
+++ b/inventory.xml     Sat May 07 18:48:45 2022 +0200
@@ -144,7 +144,7 @@
         </record>
 
         <record model="ir.model.button" id="inventory_count_button">
-            <field name="name">count</field>
+            <field name="name">do_count</field>
             <field name="string">Count</field>
             <field name="help">Launch the wizard to count products</field>
             <field name="model" search="[('model', '=', 'stock.inventory')]"/>
diff -r ba3fad95d8d4 -r 910ec3282814 tests/scenario_stock_inventory_count.rst
--- a/tests/scenario_stock_inventory_count.rst  Wed Apr 27 18:29:56 2022 +0200
+++ b/tests/scenario_stock_inventory_count.rst  Sat May 07 18:48:45 2022 +0200
@@ -68,7 +68,7 @@
 
 Count inventory::
 
-    >>> _ = inventory.click('count')
+    >>> _ = inventory.click('do_count')
     >>> count = Wizard('stock.inventory.count', [inventory])
 
     >>> count.form.search = product
diff -r ba3fad95d8d4 -r 910ec3282814 view/inventory_form.xml
--- a/view/inventory_form.xml   Wed Apr 27 18:29:56 2022 +0200
+++ b/view/inventory_form.xml   Sat May 07 18:48:45 2022 +0200
@@ -22,7 +22,7 @@
     <group colspan="2" col="-1" id="buttons">
         <button name="cancel" icon="tryton-cancel"/>
         <button name="complete_lines"/>
-        <button name="count"/>
+        <button name="do_count"/>
         <button name="confirm" icon="tryton-ok"/>
     </group>
 </form>

Reply via email to