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 3847b20
Show file tree
Hide file tree
Showing 24 changed files with 208 additions and 167 deletions.
75 changes: 2 additions & 73 deletions apps_odoo_com/README.rst
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.

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
=======

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

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

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

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

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
@@ -1,4 +1,3 @@
# -*- coding: utf-8 -*-
# Copyright 2017 IT-Projects LLC (<https://it-projects.info>)
# License LGPL-3.0 or later (http://www.gnu.org/licenses/lgpl).
from . import models
Expand Down
9 changes: 5 additions & 4 deletions apps_odoo_com/__manifest__.py
@@ -1,16 +1,17 @@
# -*- coding: utf-8 -*-
# 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).
{
"name": "Odoo App Store administration tool",
"name": "Odoo App Store Admin tool",
"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",
"images": ["images/main.jpg"],
"website": "https://it-projects.info",
"author": "IT-Projects LLC, Odoo Community Association (OCA)",
"license": "LGPL-3",
"application": False,
"installable": False,
"installable": True,
# "pre_init_hook": "pre_init_hook",
# "post_init_hook": "post_init_hook",
# "post_load": "post_load",
Expand Down
24 changes: 10 additions & 14 deletions apps_odoo_com/data/ir_config_parameter_data.xml
Expand Up @@ -3,20 +3,16 @@
Copyright 2017 IT-Projects LLC (<https://it-projects.info>)
License LGPL-3.0 or later (http://www.gnu.org/licenses/lgpl).
-->
<openerp>
<data noupdate="1">
<odoo noupdate="1">

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

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

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

- **Init version**
75 changes: 75 additions & 0 deletions apps_odoo_com/doc/index.rst
@@ -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
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
@@ -1,4 +1,3 @@
# -*- coding: utf-8 -*-
# Copyright 2017 IT-Projects LLC (<https://it-projects.info>)
# License LGPL-3.0 or later (http://www.gnu.org/licenses/lgpl).
from . import res_config
Expand Down
12 changes: 6 additions & 6 deletions apps_odoo_com/models/res_config.py
@@ -1,7 +1,6 @@
# -*- coding: utf-8 -*-
# Copyright 2017 IT-Projects LLC (<https://it-projects.info>)
# 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 = [
("apps_login", "apps_odoo_com.login"),
Expand All @@ -13,21 +12,22 @@ class Settings(models.TransientModel):

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

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")

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

for field_name, key_name in PARAMS:
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
def get_default_params(self):
def get_values_params(self):
res = {}
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
6 changes: 4 additions & 2 deletions apps_odoo_com/models/stats.py
@@ -1,13 +1,13 @@
# -*- coding: utf-8 -*-
# Copyright 2017 IT-Projects LLC (<https://it-projects.info>)
# 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):

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

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

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

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

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

odoo_id = fields.Integer(readonly=True)

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

<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">
<field name="name">User</field>
<field name="category_id" ref="category"/>
</record>
<record id="apps_odoo_com_group_manager" model="res.groups">
<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_admin'))]"/>
</record>

<record id="apps_odoo_com_group_manager" model="res.groups">
<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>
</odoo>
Binary file added apps_odoo_com/static/description/icon.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
52 changes: 52 additions & 0 deletions apps_odoo_com/static/description/index.html
@@ -0,0 +1,52 @@
<section class="oe_container">
<div class="oe_row oe_spaced">
<div class="oe_span8">
<h2>Need our service?</h2>
<p class="oe_mt32">Contact us by <a href="mailto:apps@it-projects.info">email</a> or fill out <a href="https://www.it-projects.info/page/website.contactus " target="_blank">request form</a></p>
<ul>
<li><a href="mailto:apps@it-projects.info">apps@it-projects.info <i class="fa fa-envelope-o"></i></a></li>
<li><a href="https://www.it-projects.info/page/website.contactus " target="_blank">https://www.it-projects.info/page/website.contactus <i class="fa fa-list-alt"></i></a></li>
<li><a href="https://m.me/itprojectsllc" target="_blank">https://m.me/itprojectsllc <i class="fa fa-facebook-square"></i></a></li>
<li>skype@it-projects.info <i class="fa fa-skype"></i></li>
</ul>
</div>
<div class="oe_span4">
<div class="stamp" style="width:200px;">
<div style="margin-top: 15px;
position: relative;
font-family:'Vollkorn', serif;
font-size: 16px;
line-height: 25px;
text-transform: uppercase;
font-weight: bold;
color: #75526b;
border: 3px dashed #75526b;
float: left;
padding: 4px 12px;
-webkit-transform: rotate(8deg);
-o-transform: rotate(8deg);
-moz-transform: rotate(8deg);
-ms-transform: rotate(8deg);">
Tested on Odoo<br/>12.0 community
</div>
<!--<div style="margin-top: 15px;
position: relative;
font-family:'Vollkorn', serif;
font-size: 16px;
line-height: 25px;
text-transform: uppercase;
font-weight: bold;
color: #75526b;
border: 3px dashed #75526b;
float: left;
padding: 4px 12px;
-webkit-transform: rotate(6deg);
-o-transform: rotate(6deg);
-moz-transform: rotate(6deg);
-ms-transform: rotate(6deg);">
Tested on Odoo<br/>10.0 enterprise
</div>-->
</div>
</div>
</div>
</section>

0 comments on commit 3847b20

Please sign in to comment.