Skip to content

Commit 2471716

Browse files
committed
[ADD] Improvements to avoid unexpected identations
1 parent 30d88a3 commit 2471716

22 files changed

+72
-85
lines changed

Common/python/Attributes/attribute-constraints-odoo.sublime-snippet

+2-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,8 @@
11
<!-- Odoo Python Snippets -->
22

33
<snippet>
4-
<content><![CDATA[@api.constrains('${1:field}')
4+
<content><![CDATA[
5+
@api.constrains('${1:field}')
56
def ${2:_check_method}(self):
67
$0
78
if ${3:Test}:

Common/python/Base/__init__base.sublime-snippet

+1-2
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,8 @@
22

33
<snippet>
44
<content><![CDATA[
5-
# -*- coding: utf-8 -*-
65
# Copyright ${1:YEAR(S)}, ${2:AUTHOR(S)}
7-
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html).
6+
# License LGPL-3.0 or later (http://www.gnu.org/licenses/lgpl.html).
87
98
from . import $0
109
]]></content>

Common/python/Base/__openerp__base.sublime-snippet

+2-3
Original file line numberDiff line numberDiff line change
@@ -2,17 +2,16 @@
22

33
<snippet>
44
<content><![CDATA[
5-
# -*- coding: utf-8 -*-
65
# Copyright ${1:YEAR(S)}, ${2:AUTHOR(S)}
7-
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html).
6+
# License LGPL-3.0 or later (http://www.gnu.org/licenses/lgpl.html).
87
{
98
'name': '${3:Module name}',
109
'summary': '${4:Module summary}',
1110
'version': '${5:13.0.1.0.0}',
1211
'category': '${6:Uncategorized}',
1312
'website': '${7:https://odoo-community.org/}',
1413
'author': '<${2:AUTHOR(S)}>, Odoo Community Association (OCA)',
15-
'license': 'AGPL-3',
14+
'license': 'LGPL-3',
1615
'application': False,
1716
'installable': True,
1817
'external_dependencies': {

Common/python/Base/import-base-odoo.sublime-snippet

+1-2
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,8 @@
22

33
<snippet>
44
<content><![CDATA[
5-
# -*- coding: utf-8 -*-
65
# Copyright ${1:YEAR(S)}, ${2:AUTHOR(S)}
7-
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html).
6+
# License LGPL-3.0 or later (http://www.gnu.org/licenses/lgpl.html).
87
98
from odoo import fields, models
109

Common/python/Classes/class-base-odoo.sublime-snippet

+4-3
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,8 @@
11
<!-- Odoo Python Snippets -->
22

33
<snippet>
4-
<content><![CDATA[class ${1:ClassName}(models.Model):
4+
<content><![CDATA[
5+
class ${1:ClassName}(models.Model):
56
_name = '${2:Odoo.model}'
67
_description = '${3:Description}'
78
@@ -10,8 +11,8 @@
1011
size=${6:64},
1112
required=${7:False},
1213
readonly=${8:False},
13-
defaults={$9:False}
14-
)$0
14+
default={$9:False}
15+
)$0
1516
]]></content>
1617
<tabTrigger>class</tabTrigger>
1718
<scope>source.python</scope>

Common/python/Doc/doc-odoo.sublime-snippet

+1-2
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,7 @@
11
<!-- Odoo Python Snippets -->
22

33
<snippet>
4-
<content><![CDATA["""
5-
$0
4+
<content><![CDATA[""" $0
65
"""]]></content>
76
<tabTrigger>doc</tabTrigger>
87
<scope>source.python</scope>

Common/python/Doc/doc_method-odoo.sublime-snippet

+8-4
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,15 @@
11
<!-- Odoo Python Snippets -->
22

33
<snippet>
4-
<content><![CDATA["""
5-
${1:Method Description}
6-
@param ${2:param_1}: ${3:Param Description}
4+
<content><![CDATA[
5+
""" ${1:Method Description}
76
8-
@return: ${4:Description of the return}
7+
:param ${2:parameter_name}: ${3:Parameter Description}
8+
:type: ${4:Type of Parameter (string,boolean,etc...)}
9+
:param ${2:parameter_2}: ${3:Parameter 2 Description}
10+
:type: ${4:Type of Parameter 2 (string,boolean,etc...)}
11+
:return: ${5:Description of the return}
12+
:rtype: ${6:Type of the return (string,boolean,etc...)}
913
"""
1014
$0]]></content>
1115
<tabTrigger>doc_method</tabTrigger>

Common/python/Field_Attribute/field_attribute-select.sublime-snippet

+1-1
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
<snippet>
44
<content><![CDATA[
5-
select = True, $0
5+
select=True, $0
66
]]></content>
77
<tabTrigger>select</tabTrigger>
88
<scope>source.python</scope>

Common/python/Field_Attribute/field_attribute-states.sublime-snippet

+1-1
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
<snippet>
44
<content><![CDATA[
5-
states={'${1:draft}':[('readonly',${2:False})$0]}
5+
states={'${1:draft}': [('readonly',${2:False})$0]}
66
]]></content>
77
<tabTrigger>states</tabTrigger>
88
<scope>source.python</scope>

Common/python/Methods/method-copy-odoo.sublime-snippet

+9-8
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,17 @@
11
<!-- Odoo Python Snippets -->
22

33
<snippet>
4-
<content><![CDATA[def copy(self, default=None):
4+
<content><![CDATA[
5+
def copy(self, default=None):
6+
""" Create a new record in ${1:ModelName} model from existing one
7+
:param default: dict type contains the values to be override during copy of object
8+
:type: dictionary or None
9+
:return: returns a recordset of newly created records
510
"""
6-
Create a new record in ${1:ModelName} model from existing one
7-
@param default: dict type contains the values to be override during copy of object
8-
9-
@return: returns a id of newly created record
10-
"""
11-
11+
for rec in self:
12+
$0
1213
return super(${1:ModelName}, self).copy(default)
13-
]]></content>
14+
]]></content>
1415
<tabTrigger>def</tabTrigger>
1516
<scope>source.python</scope>
1617
<description>Method copy Odoo</description>

Common/python/Methods/method-create-odoo.sublime-snippet

+9-8
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,16 @@
11
<!-- Odoo Python Snippets -->
22

33
<snippet>
4-
<content><![CDATA[@api.model
5-
def create(self, values):
4+
<content><![CDATA[
5+
@api.model
6+
def create(self, values):
7+
""" Create a new record for a model ${1:ModelName}
8+
:param values: provides a data for new record
9+
:type: dictionary
10+
:return: returns recordset of new records
11+
:rtype: object
612
"""
7-
Create a new record for a model ${1:ModelName}
8-
@param values: provides a data for new record
9-
10-
@return: returns a id of new record
11-
"""
12-
13+
$0
1314
return super(${1:Model_Name}, self).create(values)
1415
]]></content>
1516
<tabTrigger>def</tabTrigger>

Common/python/Methods/method-onchange-odoo.sublime-snippet

+5-3
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,11 @@
11
<!-- Odoo Python Snippets -->
22

33
<snippet>
4-
<content><![CDATA[@api.onchange('${1:field_name}')
5-
def _onchange_${1:field_name}(self):
6-
$0]]></content>
4+
<content><![CDATA[
5+
@api.onchange('${1:field_name}')
6+
def _onchange_${1:field_name}(self):
7+
$0
8+
]]></content>
79
<tabTrigger>onchange</tabTrigger>
810
<scope>source.python</scope>
911
<description>Method on_change Odoo</description>

Common/python/Methods/method-unlink-odoo.sublime-snippet

+7-6
Original file line numberDiff line numberDiff line change
@@ -2,17 +2,18 @@
22

33
<snippet>
44
<content><![CDATA[
5-
def unlink(self):
6-
"""
7-
Delete all record(s) from table heaving record id in ids
8-
return True on success, False otherwise
5+
def unlink(self):
6+
""" Delete all record(s) from table heaving record id in ids
7+
return True on success, False otherwise
98
10-
@return: True on success, False otherwise
9+
:return: True on success, False otherwise
10+
:rtype: Boolean
1111
"""
1212
for rec in self:
1313
$0
1414
15-
return super(${1:ModelName}, self).unlink()]]></content>
15+
return super(${1:ModelName}, self).unlink()
16+
]]></content>
1617
<tabTrigger>def</tabTrigger>
1718
<scope>source.python</scope>
1819
<description>Method unlink Odoo</description>

Common/python/Methods/method-write-odoo.sublime-snippet

+9-9
Original file line numberDiff line numberDiff line change
@@ -2,18 +2,18 @@
22

33
<snippet>
44
<content><![CDATA[
5-
def write(self, vals):
6-
"""
7-
Update record(s) with new value comes as {values}
8-
return True on success, False otherwise
9-
10-
@param values: dict of new values to be set
11-
12-
@return: True on success, False otherwise
5+
def write(self, vals):
6+
""" Update record(s) with new value comes as {values}
7+
return True on success, False otherwise
8+
:param values: dict of new values to be set
9+
:type: dictionary
10+
:return: True on success, False otherwise
11+
:rtype: Boolean
1312
"""
1413
for rec in self:
1514
$0
16-
return super(${1:ModelName}, self).write(values)]]></content>
15+
return super(${1:ModelName}, self).write(values)
16+
]]></content>
1717
<tabTrigger>def</tabTrigger>
1818
<scope>source.python</scope>
1919
<description>Method write Odoo</description>

Common/rst/readme-module.sublime-snippet

+3-3
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
<snippet>
22
<content><![CDATA[
3-
.. image:: https://img.shields.io/badge/licence-AGPL--3-blue.svg
4-
:target: http://www.gnu.org/licenses/agpl-3.0-standalone.html
5-
:alt: License: AGPL-3
3+
.. image:: https://img.shields.io/badge/licence-LGPL--3-blue.svg
4+
:target: http://www.gnu.org/licenses/lgpl-3.0-standalone.html
5+
:alt: License: LGPL-3
66
77
==============
88
${1:module_title}

Common/rst/readme-repo.sublime-snippet

+2-2
Original file line numberDiff line numberDiff line change
@@ -14,13 +14,13 @@ Available addons
1414
----------------
1515
addon | version | summary
1616
--- | --- | ---
17-
[module1](module1/) | 9.0.1.0.0 | Module 1 summary
17+
[module1](module1/) | 13.0.1.0.0 | Module 1 summary
1818
1919
Unported addons
2020
---------------
2121
addon | version | summary
2222
--- | --- | ---
23-
[module2](module2/) | 9.0.1.0.0 (unported) | Module 2 summary
23+
[module2](module2/) | 13.0.1.0.0 (unported) | Module 2 summary
2424
2525
[//]: # (end addons)
2626

Common/xml/Base/base-xml-odoo.sublime-snippet

+2-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,8 @@
11
<!-- Odoo XML Snippets -->
22

33
<snippet>
4-
<content><![CDATA[<?xml version="1.0" encoding="UTF-8"?>
4+
<content><![CDATA[
5+
<?xml version="1.0" encoding="UTF-8"?>
56
<odoo>
67
$0
78
</odoo>

Common/xml/Objects/object-form-view.sublime-snippet

+2-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
<snippet>
2-
<content><![CDATA[<record model="ir.ui.view" id="${1:name_id}_form">
2+
<content><![CDATA[
3+
<record model="ir.ui.view" id="${1:name_id}_form">
34
<field name="name">${1:name_id}.form</field>
45
<field name="model">${2:model.name}</field>
56
<field name="arch" type="xml">

Common/xml/Objects/object-search.sublime-snippet

+2-2
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,8 @@
55
<field name="model">${2:model}</field>
66
<field name="arch" type="xml">
77
<search string="${3:String}">
8-
<filter string="${4:name}" icon="terp-gtk-media-pause" domain="[("${5:field}","${6:=}","${7:value}")]"/>
9-
<filter string="${9:name}" domain="[]" context="{"group_by" : "${10:field}"}" />
8+
<filter name="${4:name}" string="${5:string}" domain="[("${6:field}","${7:=}","${8:value}")]"/>
9+
<filter name="${9:name}" string="${9:string}" domain="[]" context="{"group_by" : "${10:field}"}"/>
1010
</search>
1111
</field>
1212
</record>

Common/xml/Objects/object-workflow.sublime-snippet

-13
This file was deleted.

Common/yaml/base-test-yaml-odoo.sublime-snippet

-10
This file was deleted.

Models/fields-binary.sublime-snippet

+1
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44
<content><![CDATA[
55
${1:field_name} = fields.Binary(
66
string='${2:Field Label}',
7+
attachment=True,
78
)$0
89
]]></content>
910
<tabTrigger>fields.Binary</tabTrigger>

0 commit comments

Comments
 (0)