فهرست منبع

Merge pull request #38 from vimalpatelserpentcs/12.0-mig-mass_editing

[MIG]mass_editing:migration mass editing module from v11 to v12
Serpent Consulting Services Pvt. Ltd 6 سال پیش
والد
کامیت
3784c4f289

+ 2 - 2
.travis.yml

@@ -2,7 +2,7 @@ sudo: false
 cache: pip
 
 addons:
-  postgresql: "9.2" # minimal postgresql version for the daterange method
+  postgresql: "9.5" # minimal postgresql version for the daterange method
   apt:
    packages:
       - expect-dev  # provides unbuffer utility
@@ -16,7 +16,7 @@ python:
 
 env:
   global:
-  - VERSION="11.0" TESTS="0" LINT_CHECK="0" TRANSIFEX="0"
+  - VERSION="12.0" TESTS="0" LINT_CHECK="0" TRANSIFEX="0"
   - TRANSIFEX_USER='transbot@odoo-community.org'
   
   matrix:

+ 1 - 1
README.md

@@ -1,4 +1,4 @@
-[![Build Status](https://travis-ci.org/JayVora-SerpentCS/MassEditing.svg?branch=10.0)](https://travis-ci.org/JayVora-SerpentCS/MassEditing)
+[![Build Status](https://travis-ci.org/JayVora-SerpentCS/MassEditing.svg?branch=12.0)](https://travis-ci.org/JayVora-SerpentCS/MassEditing)
 
 ============
 Mass Editing

+ 3 - 0
mass_editing/ChangeLog.txt

@@ -1,6 +1,9 @@
 ===============================================================================
  Version Change Log (mass_editing)
 ===============================================================================
+1.7 * December 12,2018 : Serpent Consulting Services
+    * Migrated in version 12.0
+    
 1.6 * June 01,2016 : Serpent Consulting Services
     * Added Unit Test Cases
 

+ 1 - 1
mass_editing/README.rst

@@ -37,7 +37,7 @@ This module allows to add, update or remove the values of more than one records
 
 .. image:: https://odoo-community.org/website/image/ir.attachment/5784_f2813bd/datas
    :alt: Try me on Runbot
-   :target: https://runbot.odoo-community.org/runbot/149/10.0
+   :target: https://runbot.odoo-community.org/runbot/149/12.0
 
 As shown in figure you have to configure the object and fields for mass editing.
 

+ 2 - 4
mass_editing/__manifest__.py

@@ -2,7 +2,7 @@
 # License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).
 {
     'name': 'Mass Editing',
-    'version': '11.0.1.0.0',
+    'version': '12.0.1.0.0',
     'author': 'Serpent Consulting Services Pvt. Ltd., '
               'Odoo Community Association (OCA)',
     'contributors': [
@@ -15,9 +15,7 @@
     'license': 'GPL-3 or any later version',
     'summary': 'Mass Editing',
     'uninstall_hook': 'uninstall_hook',
-    'depends': [
-        'base',
-    ],
+    'depends': ['base', 'web'],
     'data': [
         'security/ir.model.access.csv',
         'views/mass_editing_view.xml',

+ 1 - 1
mass_editing/models/mass_object.py

@@ -35,7 +35,7 @@ class MassObject(models.Model):
         model_list = []
         if self.model_id:
             model_obj = self.env['ir.model']
-            model_list = [self.model_id.id]
+            model_list = self.model_id.ids
             active_model_obj = self.env[self.model_id.model]
             if active_model_obj._inherits:
                 model_names = active_model_obj._inherits.keys()

+ 6 - 6
mass_editing/static/description/index.html

@@ -5,7 +5,7 @@
     <h4 class="oe_slogan" style="color:#875A7B;">Mass editing configuration</h4>
     <div class="row mt32" style="font-size:15px">
         <div class="col-md-8 mt16">
-            <img class="img img-responsive" src="mass_editing_configuration.png">
+            <img class="img img-responsive" style="width: 100%;" src="mass_editing_configuration.png">
         </div>
         <div class="col-md-4 text-justify mt32">
             <p>We can configure mass editing from Menu: Settings -> Mass Editing.</p>
@@ -21,14 +21,14 @@
               <p>The user can remove the action by clicking on the "Remove Sidebar Button".</p>
         </div>
         <div class="col-md-8 mt16">
-            <img class="img img-responsive" src="remove_button2.png">
+            <img class="img img-responsive" style="width: 100%;" src="remove_button2.png">
         </div>
     </div>
     
     
      <div class="row mt32" style="font-size:15px">
         <div class="col-md-8 mt16">
-            <img class="img img-responsive" src="mass_edit_menu.png">
+            <img class="img img-responsive" style="width: 100%;" src="mass_edit_menu.png">
         </div>
         <div class="col-md-4 text-justify mt32">
             <p>Go to the model/object in which mass editing is configured (ex. Partner).</p>
@@ -39,7 +39,7 @@
     
     <div class="row mt32" style="overflow: hidden;background: #efefef;box-shadow: none;font-size:15px">
          <div class="col-md-8 mt16">
-            <img class="img img-responsive" src="mass_edit_copy.png">
+            <img class="img img-responsive" style="width: 100%;" src="mass_edit_copy.png">
         </div>
         <div class="col-md-4 text-justify mt32">
               <p>The user can set or remove the value of the fields which were configured in mass editing configuration.
@@ -52,14 +52,14 @@
             <p>You can see the mass editing changes in customer tree view..</p>
         </div>
          <div class="col-md-8 mt16">
-            <img class="img img-responsive" src="mass_edit_tree.png">
+            <img class="img img-responsive" style="width: 100%;" src="mass_edit_tree.png">
         </div>
     </div> 
     
     
      <div class="row mt32" style="overflow: hidden;background: #efefef;box-shadow: none;font-size:15px">
          <div class="col-md-8 mt16">
-            <img class="img img-responsive" src="mass_edit_result.png">
+            <img class="img img-responsive" style="width: 100%;" src="mass_edit_result.png">
         </div>
         <div class="col-md-4 text-justify mt32">
               <p>You can see the mass editing changes in selected customer</p>

+ 1 - 1
mass_editing/tests/test_mass_editing.py

@@ -129,7 +129,7 @@ class TestMassEditing(common.TransactionCase):
         self.assertNotEqual(self.partner.category_id, False,
                             'Partner\'s category should be removed.')
         # Add m2m categories
-        dist_categ_id = self.env.ref('base.res_partner_category_13').id
+        dist_categ_id = self.env.ref('base.res_partner_category_12').id
         vals = {
             'selection__category_id': 'add',
             'category_id': [[6, 0, [dist_categ_id]]],

+ 5 - 19
mass_editing/views/mass_editing_view.xml

@@ -1,7 +1,7 @@
 <?xml version="1.0" encoding="UTF-8"?>
 <odoo>
 
-    <record model="ir.ui.view" id="view_mass_object_form">
+    <record id="view_mass_object_form" model="ir.ui.view">
         <field name="name">mass.object.form</field>
         <field name="model">mass.object</field>
         <field name="arch" type="xml">
@@ -42,7 +42,7 @@
                     <notebook colspan="4">
                         <page string="Fields">
                             <field name="field_ids" context="{'mass_edit':True}" colspan="4" nolabel="1"
-                            domain="[('ttype', 'not in', ['reference', 'function', 'monetary']), ('model_id', 'in', model_list)]"/>
+                            domain="[('ttype', 'not in', ['reference', 'function', 'monetary', 'one2many']), ('model_id', 'in', model_list)]"/>
                         </page>
                         <page string="Advanced" attrs="{'invisible':[('ref_ir_act_window_id','=',False)]}">
                             <group colspan="2" col="2">
@@ -55,7 +55,7 @@
         </field>
     </record>
 
-    <record model="ir.ui.view" id="view_mass_object_tree">
+    <record id="view_mass_object_tree" model="ir.ui.view">
         <field name="name">mass.object.tree</field>
         <field name="model">mass.object</field>
         <field name="arch" type="xml">
@@ -66,31 +66,17 @@
         </field>
     </record>
 
-    <record model="ir.actions.act_window" id="action_mass_object_form">
+    <record id="action_mass_object" model="ir.actions.act_window">
         <field name="name">Mass Editing</field>
         <field name="res_model">mass.object</field>
         <field name="view_type">form</field>
         <field name="view_mode">tree,form</field>
-        <field name="view_id" ref="view_mass_object_tree"/>
-    </record>
-
-    <record id="action_mass_object_form_view1" model="ir.actions.act_window.view">
-        <field eval="10" name="sequence"/>
-        <field name="view_mode">tree</field>
-        <field name="view_id" ref="view_mass_object_tree"/>
-        <field name="act_window_id" ref="action_mass_object_form"/>
-    </record>
-    <record id="action_mass_object_form_view2" model="ir.actions.act_window.view">
-        <field eval="20" name="sequence"/>
-        <field name="view_mode">form</field>
-        <field name="view_id" ref="view_mass_object_form"/>
-        <field name="act_window_id" ref="action_mass_object_form"/>
     </record>
 
     <menuitem id="menu_mass_editing" name="Mass Editing"
         parent="base.menu_administration" sequence="6"/>
 
-    <menuitem id="menu_mass_object_view" action="action_mass_object_form"
+    <menuitem id="menu_mass_object_view" action="action_mass_object"
         parent="menu_mass_editing"/>
 
 </odoo>

+ 1 - 1
mass_editing/views/template.xml

@@ -1,6 +1,6 @@
 <odoo>
     <data>
-        <template id="sale_order_backend" name="sale_order assets" inherit_id="web.assets_backend">
+        <template id="mass_editing_backend" name="mass editing assets" inherit_id="web.assets_backend">
             <xpath expr="." position="inside">
                <script type="text/javascript" src="/mass_editing/static/src/js/mass_editing.js"></script>
             </xpath>