Skip to content

Commit

Permalink
🚒 12.0 port
Browse files Browse the repository at this point in the history
  • Loading branch information
fedoranvar committed Aug 13, 2019
1 parent f794412 commit bbd8455
Show file tree
Hide file tree
Showing 24 changed files with 210 additions and 167 deletions.
75 changes: 2 additions & 73 deletions apps_odoo_com/README.rst
Original file line number Original file line Diff line number Diff line change
Expand Up @@ -8,71 +8,6 @@ Odoo App Store administration tool


Tool to work with apps.odoo.com database via xmlrpc. Usefull for sharing administration rights with your colleagues as well as for automation. Tool to work with apps.odoo.com database via xmlrpc. Usefull for sharing administration rights with your colleagues as well as for automation.


Configuration
=============

To use this module, you need to have a password in ``apps.odoo.com`` database.

* Step 1. Ask support team to set some temporar password on apps.odoo.com database
* Step 2. Login to https://apps.odoo.com/web in a usual way (via oauth)
* Step 3. Open browser console and change password by using js code below

.. code:: js
odoo.define('www', function(require) {
"use strict";
var ajax = require('web.ajax');
// will only work after the password has been set by Odoo
ajax.jsonpRpc('/web/session/change_password', 'call', {
'fields' : [
{'name': 'old_pwd', 'value': 'demoo'},
{'name': 'new_password', 'value': 'demooo'},
{'name': 'confirm_pwd', 'value': 'demooo'}
]})
.then(function(o) { console.log(o); });
});
* Step 4. At your odoo database:

* install this module and go to menu ``Odoo App Store >> Settings``
* set login and password
* click ``[Apply]``

Usage
=====

Scan Repo
---------

To call ``[Scan Repo]`` button

* go to ``Odoo App Store >> Tools >> Scan Repo``
* set ``Repository``
* click ``[Scan Repo]``

Adding batch of Repos
---------------------

* go to ``Odoo App Store >> Tools >> Add Repos``
* set ``Version``
* specify list of repos
* click ``[Add Repos]``
* RESULT: it will create and validate the repos. Errors are printed to odoo logs


.. Known issues / Roadmap
.. ======================
..
.. * ...
Bug Tracker
===========

Bugs are tracked on `GitHub Issues
<https://github.com/OCA/{project_repo}/issues>`_. In case of trouble, please
check there if your issue has already been reported. If you spotted it first,
help us smash it by providing detailed and welcomed feedback.

Credits Credits
======= =======


Expand All @@ -86,14 +21,6 @@ Contributors


* Ivan Yelizariev <yelizariev@it-projects.info> * Ivan Yelizariev <yelizariev@it-projects.info>


.. Funders
.. -------
..
.. The development of this module has been financially supported by:
..
.. * Company 1 name
.. * Company 2 name
Maintainer Maintainer
---------- ----------


Expand All @@ -108,3 +35,5 @@ mission is to support the collaborative development of Odoo features and
promote its widespread use. promote its widespread use.


To contribute to this module, please visit https://odoo-community.org. To contribute to this module, please visit https://odoo-community.org.

Tested on Odoo 12.0 32c2666d189047db66eb7b1392ea34b086fd341e
1 change: 0 additions & 1 deletion apps_odoo_com/__init__.py
Original file line number Original file line Diff line number Diff line change
@@ -1,4 +1,3 @@
# -*- coding: utf-8 -*-
# Copyright 2017 IT-Projects LLC (<https://it-projects.info>) # Copyright 2017 IT-Projects LLC (<https://it-projects.info>)
# License LGPL-3.0 or later (http://www.gnu.org/licenses/lgpl). # License LGPL-3.0 or later (http://www.gnu.org/licenses/lgpl).
from . import models from . import models
Expand Down
9 changes: 5 additions & 4 deletions apps_odoo_com/__manifest__.py
Original file line number Original file line Diff line number Diff line change
@@ -1,16 +1,17 @@
# -*- coding: utf-8 -*-
# Copyright 2017 IT-Projects LLC (<https://it-projects.info>) # Copyright 2017 IT-Projects LLC (<https://it-projects.info>)
# Copyright 2019 Anvar Kildebekov (<https://it-projects.info/team/kildebekov>)
# License LGPL-3.0 or later (http://www.gnu.org/licenses/lgpl). # License LGPL-3.0 or later (http://www.gnu.org/licenses/lgpl).
{ {
"name": "Odoo App Store administration tool", "name": "Odoo App Store Admin tool",
"summary": "Tool to work with apps.odoo.com database via xmlrpc.", "summary": "Tool to work with apps.odoo.com database via xmlrpc.",
"version": "8.0.1.0.0", "version": "12.0.1.0.0",
"category": "Extra Tools", "category": "Extra Tools",
"images": ["images/main.jpg"],
"website": "https://it-projects.info", "website": "https://it-projects.info",
"author": "IT-Projects LLC, Odoo Community Association (OCA)", "author": "IT-Projects LLC, Odoo Community Association (OCA)",
"license": "LGPL-3", "license": "LGPL-3",
"application": False, "application": False,
"installable": False, "installable": True,
# "pre_init_hook": "pre_init_hook", # "pre_init_hook": "pre_init_hook",
# "post_init_hook": "post_init_hook", # "post_init_hook": "post_init_hook",
# "post_load": "post_load", # "post_load": "post_load",
Expand Down
26 changes: 12 additions & 14 deletions apps_odoo_com/data/ir_config_parameter_data.xml
Original file line number Original file line Diff line number Diff line change
Expand Up @@ -3,20 +3,18 @@
Copyright 2017 IT-Projects LLC (<https://it-projects.info>) Copyright 2017 IT-Projects LLC (<https://it-projects.info>)
License LGPL-3.0 or later (http://www.gnu.org/licenses/lgpl). License LGPL-3.0 or later (http://www.gnu.org/licenses/lgpl).
--> -->
<openerp> <odoo noupdate="1">
<data noupdate="1">


<record id="param_apps_odoo_com_login" model="ir.config_parameter"> <record id="param_apps_odoo_com_login" model="ir.config_parameter">
<field name="key">apps_odoo_com.login</field> <field name="key">apps_odoo_com.login</field>
<field name="value"> </field> <field name="value"> </field>
<field name="group_ids" eval="[(4, ref('apps_odoo_com.apps_odoo_com_group_manager'))]"/> <field name="group_ids" eval="[(4, ref('apps_odoo_com.apps_odoo_com_group_manager'))]"/>
</record> </record>


<record id="param_apps_odoo_com_password" model="ir.config_parameter"> <record id="param_apps_odoo_com_password" model="ir.config_parameter">
<field name="key">apps_odoo_com.password</field> <field name="key">apps_odoo_com.password</field>
<field name="value"> </field> <field name="value"> </field>
<field name="group_ids" eval="[(4, ref('apps_odoo_com.apps_odoo_com_group_manager'))]"/> <field name="group_ids" eval="[(4, ref('apps_odoo_com.apps_odoo_com_group_manager'))]"/>
</record> </record>


</data> </odoo>
</openerp>
4 changes: 4 additions & 0 deletions apps_odoo_com/doc/changelog.rst
Original file line number Original file line Diff line number Diff line change
@@ -0,0 +1,4 @@
`1.0.0`
-------

- **Init version**
75 changes: 75 additions & 0 deletions apps_odoo_com/doc/index.rst
Original file line number Original file line Diff line number Diff line change
@@ -0,0 +1,75 @@
==================================
Odoo App Store administration tool
==================================

Installation
============

* `Install <https://odoo-development.readthedocs.io/en/latest/odoo/usage/install-module.html>`__ this module in a usual way

Configuration
=============

To use this module, you need to have a password in ``apps.odoo.com`` database.

* Step 1. Ask support team to set some temporar password on apps.odoo.com database
* Step 2. Login to https://apps.odoo.com/web in a usual way (via oauth)
* Step 3. Open browser console and change password by using js code below

.. code:: js
odoo.define('www', function(require) {
"use strict";
var ajax = require('web.ajax');
// will only work after the password has been set by Odoo
ajax.jsonpRpc('/web/session/change_password', 'call', {
'fields' : [
{'name': 'old_pwd', 'value': 'demoo'},
{'name': 'new_password', 'value': 'demooo'},
{'name': 'confirm_pwd', 'value': 'demooo'}
]})
.then(function(o) { console.log(o); });
});
* Step 4. At your odoo database:

* install this module and go to menu ``Odoo App Store >> Settings``
* set login and password
* click ``[Apply]``

Usage
=====

Scan Repo
---------

To call ``[Scan Repo]`` button

* go to ``Odoo App Store >> Tools >> Scan Repo``
* set ``Repository``
* click ``[Scan Repo]``

Adding batch of Repos
---------------------

* go to ``Odoo App Store >> Tools >> Add Repos``
* set ``Version``
* specify list of repos
* click ``[Add Repos]``
* RESULT: it will create and validate the repos. Errors are printed to odoo logs


.. Known issues / Roadmap
.. ======================
..
.. * ...
Bug Tracker
===========

Bugs are tracked on `GitHub Issues
<https://github.com/OCA/{project_repo}/issues>`_. In case of trouble, please
check there if your issue has already been reported. If you spotted it first,
help us smash it by providing detailed and welcomed feedback.

* RESULT: {what user gets, how the modules changes default behaviour}
Binary file added apps_odoo_com/images/main.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
1 change: 0 additions & 1 deletion apps_odoo_com/models/__init__.py
Original file line number Original file line Diff line number Diff line change
@@ -1,4 +1,3 @@
# -*- coding: utf-8 -*-
# Copyright 2017 IT-Projects LLC (<https://it-projects.info>) # Copyright 2017 IT-Projects LLC (<https://it-projects.info>)
# License LGPL-3.0 or later (http://www.gnu.org/licenses/lgpl). # License LGPL-3.0 or later (http://www.gnu.org/licenses/lgpl).
from . import res_config from . import res_config
Expand Down
12 changes: 6 additions & 6 deletions apps_odoo_com/models/res_config.py
Original file line number Original file line Diff line number Diff line change
@@ -1,7 +1,6 @@
# -*- coding: utf-8 -*-
# Copyright 2017 IT-Projects LLC (<https://it-projects.info>) # Copyright 2017 IT-Projects LLC (<https://it-projects.info>)
# License LGPL-3.0 or later (http://www.gnu.org/licenses/lgpl). # License LGPL-3.0 or later (http://www.gnu.org/licenses/lgpl).
from openerp import models, fields, api from odoo import models, fields, api


PARAMS = [ PARAMS = [
("apps_login", "apps_odoo_com.login"), ("apps_login", "apps_odoo_com.login"),
Expand All @@ -13,21 +12,22 @@ class Settings(models.TransientModel):


_name = 'apps_odoo_com.settings' _name = 'apps_odoo_com.settings'
_inherit = 'res.config.settings' _inherit = 'res.config.settings'
_description = 'description of settings'


apps_login = fields.Char("Email", help="login of your account at apps.odoo.com") apps_login = fields.Char("Email", help="login of your account at apps.odoo.com")
apps_password = fields.Char("Password", help="Password for apps.odoo.com. Note, that it's not the same as password for odoo.com, chect README for more information") apps_password = fields.Char("Password", help="Password for apps.odoo.com. Note, that it's not the same as password for odoo.com, chect README for more information")


@api.multi @api.multi
def set_params(self): def set_value_params(self):
self.ensure_one() self.ensure_one()


for field_name, key_name in PARAMS: for field_name, key_name in PARAMS:
value = getattr(self, field_name, '').strip() value = getattr(self, field_name, '').strip()
self.env['ir.config_parameter'].set_param(key_name, value) self.env['ir.config_parameter'].sudo().set_param(key_name, value)


@api.multi @api.multi
def get_default_params(self): def get_values_params(self):
res = {} res = {}
for field_name, key_name in PARAMS: for field_name, key_name in PARAMS:
res[field_name] = self.env['ir.config_parameter'].get_param(key_name, '').strip() res[field_name] = self.env['ir.config_parameter'].sudo().get_param(key_name, '').strip()
return res return res
6 changes: 4 additions & 2 deletions apps_odoo_com/models/stats.py
Original file line number Original file line Diff line number Diff line change
@@ -1,13 +1,13 @@
# -*- coding: utf-8 -*-
# Copyright 2017 IT-Projects LLC (<https://it-projects.info>) # Copyright 2017 IT-Projects LLC (<https://it-projects.info>)
# License LGPL-3.0 or later (http://www.gnu.org/licenses/lgpl). # License LGPL-3.0 or later (http://www.gnu.org/licenses/lgpl).
from openerp import models, fields from odoo import models, fields




class User(models.Model): class User(models.Model):


_name = 'apps_odoo_com.user' _name = 'apps_odoo_com.user'
_order = 'odoo_id desc' _order = 'odoo_id desc'
_description = 'description of user'


name = fields.Char(readonly=True) name = fields.Char(readonly=True)
odoo_id = fields.Integer(readonly=True) odoo_id = fields.Integer(readonly=True)
Expand All @@ -17,6 +17,7 @@ class Module(models.Model):


_name = 'apps_odoo_com.module' _name = 'apps_odoo_com.module'
_order = 'odoo_id desc' _order = 'odoo_id desc'
_description = 'description of module'


name = fields.Char(string='Technical Name', readonly=True) name = fields.Char(string='Technical Name', readonly=True)
odoo_id = fields.Integer(readonly=True) odoo_id = fields.Integer(readonly=True)
Expand All @@ -29,6 +30,7 @@ class Purchase(models.Model):


_name = 'apps_odoo_com.purchase' _name = 'apps_odoo_com.purchase'
_order = 'odoo_id desc' _order = 'odoo_id desc'
_description = 'description of purchase'


odoo_id = fields.Integer(readonly=True) odoo_id = fields.Integer(readonly=True)


Expand Down
33 changes: 15 additions & 18 deletions apps_odoo_com/security/res_groups.xml
Original file line number Original file line Diff line number Diff line change
Expand Up @@ -3,26 +3,23 @@
Copyright 2017 IT-Projects LLC (<https://it-projects.info>) Copyright 2017 IT-Projects LLC (<https://it-projects.info>)
License LGPL-3.0 or later (http://www.gnu.org/licenses/lgpl). License LGPL-3.0 or later (http://www.gnu.org/licenses/lgpl).
--> -->
<openerp> <odoo>
<data>


<record id="category" model="ir.module.category">
<field name="name">Odoo App Store</field>
</record>


<record id="category" model="ir.module.category">
<field name="name">Odoo App Store</field>
</record>


<record id="apps_odoo_com_group_user" model="res.groups">
<field name="name">User</field>
<field name="category_id" ref="category"/>
</record>


<record id="apps_odoo_com_group_user" model="res.groups"> <record id="apps_odoo_com_group_manager" model="res.groups">
<field name="name">User</field> <field name="name">Manager</field>
<field name="category_id" ref="category"/> <field name="category_id" ref="category"/>
</record> <field name="implied_ids" eval="[(4, ref('apps_odoo_com_group_user'))]"/>
<field name="users" eval="[(4, ref('base.user_admin'))]"/>
</record>


<record id="apps_odoo_com_group_manager" model="res.groups"> </odoo>
<field name="name">Manager</field>
<field name="category_id" ref="category"/>
<field name="implied_ids" eval="[(4, ref('apps_odoo_com_group_user'))]"/>
<field name="users" eval="[(4, ref('base.user_root'))]"/>
</record>

</data>
</openerp>
Binary file added apps_odoo_com/static/description/icon.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading

0 comments on commit bbd8455

Please sign in to comment.