Merge branch 'website' of ssh://gitlab.datenpol.at:122/odoo/tz-austria into website
commit
221b13dd23
|
|
@ -0,0 +1,26 @@
|
||||||
|
[options]
|
||||||
|
|
||||||
|
xmlrpc_port = 8080
|
||||||
|
; This is the password that allows database operations:
|
||||||
|
; admin_passwd = admin
|
||||||
|
db_host = False
|
||||||
|
db_port = 5432
|
||||||
|
db_user = False
|
||||||
|
db_password = False
|
||||||
|
|
||||||
|
addons_path = ext/odoo/addons,ext/custom-addons,ext/3rd-party-addons,ext/clarico-addons
|
||||||
|
; For enterprise use the addons path bellow
|
||||||
|
; addons_path = ext/enterprise-addons,ext/odoo/addons,ext/3rd-party-addons,ext/custom-addons,dmi/run1
|
||||||
|
timezone = Europe/Vienna
|
||||||
|
|
||||||
|
#dbfilter_test = ['.*',]
|
||||||
|
show_debug = 1
|
||||||
|
|
||||||
|
workers = 0
|
||||||
|
server_wide_modules = web,base_sparse_field,queue_job
|
||||||
|
|
||||||
|
portal_url = https://erp.tzaustria.info
|
||||||
|
portal_secret = secret
|
||||||
|
|
||||||
|
[queue_job]
|
||||||
|
channels = root:4
|
||||||
|
|
@ -0,0 +1,55 @@
|
||||||
|
=========================================
|
||||||
|
Multi-website support in Security Rules
|
||||||
|
=========================================
|
||||||
|
|
||||||
|
Allows to use ``website_id`` (current website) in ``domain_force`` field of Record Rules (``ir.rule``), e.g.:
|
||||||
|
|
||||||
|
* ``[('website_ids', 'in', [website_id])]``
|
||||||
|
* ``[('website_id', '=', website_id)]``
|
||||||
|
|
||||||
|
|
||||||
|
Example of usage:
|
||||||
|
|
||||||
|
* Show a blog on specific websites only (TODO: add link to the module)
|
||||||
|
* Show an event on specific websites only (TODO: add link to the module)
|
||||||
|
* Show a product on specific websites only (TODO: add link to the module)
|
||||||
|
|
||||||
|
Odoo 12.0+
|
||||||
|
==========
|
||||||
|
|
||||||
|
We hope this feature will be built-in since Odoo 12.0 at least: https://github.com/odoo/odoo/pull/22743
|
||||||
|
|
||||||
|
Credits
|
||||||
|
=======
|
||||||
|
|
||||||
|
Contributors
|
||||||
|
------------
|
||||||
|
* `Ivan Yelizariev <https://www.it-projects.info/team/yelizariev>`__
|
||||||
|
* `Ildar Nasyrov <https://www.it-projects.info/team/iledarn>`__
|
||||||
|
|
||||||
|
Sponsors
|
||||||
|
--------
|
||||||
|
* `IT-Projects LLC <https://it-projects.info>`__
|
||||||
|
|
||||||
|
Maintainers
|
||||||
|
-----------
|
||||||
|
* `IT-Projects LLC <https://it-projects.info>`__
|
||||||
|
|
||||||
|
To get a guaranteed support you are kindly requested to purchase the module at `odoo apps store <https://apps.odoo.com/apps/modules/11.0/ir_rule_website/>`__.
|
||||||
|
|
||||||
|
Thank you for understanding!
|
||||||
|
|
||||||
|
`IT-Projects Team <https://www.it-projects.info/team>`__
|
||||||
|
|
||||||
|
Further information
|
||||||
|
===================
|
||||||
|
|
||||||
|
Demo: http://runbot.it-projects.info/demo/access-addons/11.0
|
||||||
|
|
||||||
|
HTML Description: https://apps.odoo.com/apps/modules/11.0/ir_rule_website
|
||||||
|
|
||||||
|
Usage instructions: `<doc/index.rst>`_
|
||||||
|
|
||||||
|
Changelog: `<doc/changelog.rst>`_
|
||||||
|
|
||||||
|
Tested on Odoo 11.0 dc61861f90d15797b19f8ebddfb0c8a66d0afa88
|
||||||
|
|
@ -0,0 +1,2 @@
|
||||||
|
# -*- coding: utf-8 -*-
|
||||||
|
from . import models
|
||||||
|
|
@ -0,0 +1,36 @@
|
||||||
|
# -*- coding: utf-8 -*-
|
||||||
|
{
|
||||||
|
"name": """Multi-website support in Security Rules""",
|
||||||
|
"summary": """Provide access depending on current website""",
|
||||||
|
"category": "Access",
|
||||||
|
# "live_test_url": "",
|
||||||
|
"images": [],
|
||||||
|
"version": "1.0.0",
|
||||||
|
"application": False,
|
||||||
|
|
||||||
|
"author": "IT-Projects LLC, Ildar Nasyrov",
|
||||||
|
"support": "apps@it-projects.info",
|
||||||
|
"website": "https://it-projects.info/team/iledarn",
|
||||||
|
"license": "LGPL-3",
|
||||||
|
"price": 20.00,
|
||||||
|
"currency": "EUR",
|
||||||
|
|
||||||
|
"depends": [
|
||||||
|
"base",
|
||||||
|
],
|
||||||
|
"external_dependencies": {"python": [], "bin": []},
|
||||||
|
"data": [
|
||||||
|
],
|
||||||
|
"qweb": [
|
||||||
|
],
|
||||||
|
"demo": [
|
||||||
|
],
|
||||||
|
|
||||||
|
"post_load": None,
|
||||||
|
"pre_init_hook": None,
|
||||||
|
"post_init_hook": None,
|
||||||
|
"uninstall_hook": None,
|
||||||
|
|
||||||
|
"auto_install": False,
|
||||||
|
"installable": True,
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,4 @@
|
||||||
|
`1.0.0`
|
||||||
|
-------
|
||||||
|
|
||||||
|
- Init version
|
||||||
|
|
@ -0,0 +1,30 @@
|
||||||
|
=========================================
|
||||||
|
Multi-website support in Security Rules
|
||||||
|
=========================================
|
||||||
|
|
||||||
|
Installation
|
||||||
|
============
|
||||||
|
|
||||||
|
* `Install <https://odoo-development.readthedocs.io/en/latest/odoo/usage/install-module.html>`__ this module in a usual way
|
||||||
|
|
||||||
|
Configuration
|
||||||
|
=============
|
||||||
|
|
||||||
|
This is a core technical module - no configurations are needed
|
||||||
|
|
||||||
|
Usage
|
||||||
|
=====
|
||||||
|
|
||||||
|
* If you have a model accessible through a website (by means of controller methods) - specify this module into the "depends" section of your manifest file
|
||||||
|
* Now you can create security rules using `website_id` in `domain_force` fields. For example,
|
||||||
|
|
||||||
|
::
|
||||||
|
|
||||||
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
|
<odoo>
|
||||||
|
<record id="blog_rule_all" model="ir.rule">
|
||||||
|
<field name="name">Blogs available only for specifed websites</field>
|
||||||
|
<field name="model_id" ref="model_blog_blog"/>
|
||||||
|
<field name="domain_force">[('website_ids', 'in', [website_id])]</field>
|
||||||
|
</record>
|
||||||
|
</odoo>
|
||||||
|
|
@ -0,0 +1,2 @@
|
||||||
|
# -*- coding: utf-8 -*-
|
||||||
|
from . import ir_rule
|
||||||
|
|
@ -0,0 +1,19 @@
|
||||||
|
# -*- coding: utf-8 -*-
|
||||||
|
|
||||||
|
from odoo import api, models, tools
|
||||||
|
from odoo.addons.base.ir.ir_rule import IrRule as IrRuleOriginal
|
||||||
|
|
||||||
|
|
||||||
|
class IrRule(models.Model):
|
||||||
|
_inherit = 'ir.rule'
|
||||||
|
|
||||||
|
@api.model
|
||||||
|
def _eval_context(self):
|
||||||
|
context = super(IrRule, self)._eval_context()
|
||||||
|
context['website_id'] = self._context.get('website_id')
|
||||||
|
return context
|
||||||
|
|
||||||
|
@api.model
|
||||||
|
@tools.ormcache_context('self._uid', 'model_name', 'mode', keys=["website_id"])
|
||||||
|
def _compute_domain(self, model_name, mode="read"):
|
||||||
|
return IrRuleOriginal._compute_domain.__wrapped__(self, model_name, mode=mode)
|
||||||
Binary file not shown.
|
After Width: | Height: | Size: 3.0 KiB |
|
|
@ -0,0 +1,89 @@
|
||||||
|
<section class="oe_container">
|
||||||
|
<div class="oe_row oe_spaced">
|
||||||
|
<div class="oe_span12">
|
||||||
|
<h2 class="oe_slogan" style="color:#875A7B;">Multi-website support in Security Rules</h2>
|
||||||
|
<h3 class="oe_slogan">Make website-dependent access to pages, products, etc.</h3>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</section>
|
||||||
|
|
||||||
|
<section class="oe_container">
|
||||||
|
<div class="oe_row oe_spaced">
|
||||||
|
<div class="oe_span12">
|
||||||
|
|
||||||
|
<div class="alert alert-info oe_mt32" style="padding:0.3em 0.6em; font-size: 150%;">
|
||||||
|
<i class="fa fa-hand-o-right"></i><b> Technical module that allows implementing different features. For example: </b>
|
||||||
|
<ul class="list-unstyled">
|
||||||
|
|
||||||
|
<li>
|
||||||
|
<i class="fa fa-check-square-o text-primary"></i>
|
||||||
|
Show a blog on specific websites only
|
||||||
|
</li>
|
||||||
|
|
||||||
|
<li>
|
||||||
|
<i class="fa fa-check-square-o text-primary"></i>
|
||||||
|
Show an event on specific websites only
|
||||||
|
</li>
|
||||||
|
|
||||||
|
<li>
|
||||||
|
<i class="fa fa-check-square-o text-primary"></i>
|
||||||
|
Show a product on specific websites only
|
||||||
|
</li>
|
||||||
|
|
||||||
|
</ul>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</section>
|
||||||
|
|
||||||
|
<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>
|
||||||
|
</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(-1deg);
|
||||||
|
-o-transform: rotate(-1deg);
|
||||||
|
-moz-transform: rotate(-1deg);
|
||||||
|
-ms-transform: rotate(-1deg);">
|
||||||
|
Tested on Odoo<br/>11.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/>11.0 enterprise
|
||||||
|
</div>-->
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</section>
|
||||||
|
|
@ -0,0 +1,2 @@
|
||||||
|
# -*- coding: utf-8 -*-
|
||||||
|
from . import test_compute_domain
|
||||||
|
|
@ -0,0 +1,23 @@
|
||||||
|
# -*- coding: utf-8 -*-
|
||||||
|
from openerp.tests.common import TransactionCase
|
||||||
|
|
||||||
|
|
||||||
|
class TestComputeDomain(TransactionCase):
|
||||||
|
at_install = True
|
||||||
|
post_install = True
|
||||||
|
|
||||||
|
def setUp(self):
|
||||||
|
super(TestComputeDomain, self).setUp()
|
||||||
|
self.demo_user = self.env.ref('base.user_demo')
|
||||||
|
self.env['ir.rule'].create({'name': 'test ir_rule_website',
|
||||||
|
'model_id': self.env.ref('base.model_res_partner').id,
|
||||||
|
'domain_force': "[('parent_id', 'in', [website_id])]"})
|
||||||
|
|
||||||
|
def _cached_compute_domain(self, website_id):
|
||||||
|
test_domain = ('parent_id', 'in', [website_id])
|
||||||
|
domain = self.env['ir.rule'].sudo(user=self.demo_user.id).with_context(website_id=website_id)._compute_domain('res.partner')
|
||||||
|
self.assertTrue(test_domain in domain)
|
||||||
|
|
||||||
|
def test_cache(self):
|
||||||
|
self._cached_compute_domain(1)
|
||||||
|
self._cached_compute_domain(2)
|
||||||
|
|
@ -0,0 +1,45 @@
|
||||||
|
==========================================
|
||||||
|
Real Multi Website (eCommerce extension)
|
||||||
|
==========================================
|
||||||
|
|
||||||
|
Multi Website support in eCommerce:
|
||||||
|
|
||||||
|
* adds field ``website_ids`` to payment.acquirer
|
||||||
|
* adds field ``website_ids`` to product.template
|
||||||
|
* adds field ``website_ids`` to product.public.category
|
||||||
|
* use separate sale order (cart) for different companies -- works by adding ``company_dependent`` attribute to ``last_website_so_id`` field
|
||||||
|
|
||||||
|
|
||||||
|
Credits
|
||||||
|
=======
|
||||||
|
|
||||||
|
Contributors
|
||||||
|
------------
|
||||||
|
* `Ivan Yelizariev <https://it-projects.info/team/yelizariev>`__
|
||||||
|
|
||||||
|
Sponsors
|
||||||
|
--------
|
||||||
|
* `IT-Projects LLC <https://it-projects.info>`__
|
||||||
|
|
||||||
|
Maintainers
|
||||||
|
-----------
|
||||||
|
* `IT-Projects LLC <https://it-projects.info>`__
|
||||||
|
|
||||||
|
To get a guaranteed support you are kindly requested to purchase the module at `odoo apps store <https://apps.odoo.com/apps/modules/11.0/website_multi_company_sale/>`__.
|
||||||
|
|
||||||
|
Thank you for understanding!
|
||||||
|
|
||||||
|
`IT-Projects Team <https://www.it-projects.info/team>`__
|
||||||
|
|
||||||
|
Further information
|
||||||
|
===================
|
||||||
|
|
||||||
|
Demo: http://runbot.it-projects.info/demo/website-addons/11.0
|
||||||
|
|
||||||
|
HTML Description: https://apps.odoo.com/apps/modules/11.0/website_multi_company_sale/
|
||||||
|
|
||||||
|
Usage instructions: `<doc/index.rst>`_
|
||||||
|
|
||||||
|
Changelog: `<doc/changelog.rst>`_
|
||||||
|
|
||||||
|
Tested on Odoo 11.0 f34d4d33a09d33a12e427c2490b6526546114486
|
||||||
|
|
@ -0,0 +1,2 @@
|
||||||
|
from . import models
|
||||||
|
from . import controllers
|
||||||
|
|
@ -0,0 +1,42 @@
|
||||||
|
{
|
||||||
|
"name": """Real Multi Website (eCommerce extension)""",
|
||||||
|
"summary": """Multi Website support in eCommerce""",
|
||||||
|
"category": "eCommerce",
|
||||||
|
"live_test_url": "http://apps.it-projects.info/shop/product/website-multi-company?version=11.0",
|
||||||
|
"images": ["images/website_multi_company_sale_main.png"],
|
||||||
|
"version": "11.0.1.2.0",
|
||||||
|
"application": False,
|
||||||
|
|
||||||
|
"author": "IT-Projects LLC, Ivan Yelizariev",
|
||||||
|
"support": "apps@it-projects.info",
|
||||||
|
"website": "https://it-projects.info/team/yelizariev",
|
||||||
|
"license": "LGPL-3",
|
||||||
|
"price": 9.00,
|
||||||
|
"currency": "EUR",
|
||||||
|
|
||||||
|
"depends": [
|
||||||
|
"website_multi_company",
|
||||||
|
"website_sale",
|
||||||
|
"ir_rule_website",
|
||||||
|
],
|
||||||
|
"external_dependencies": {"python": [], "bin": []},
|
||||||
|
"data": [
|
||||||
|
"views/product_public_category_views.xml",
|
||||||
|
"views/website_views.xml",
|
||||||
|
"views/product_template_views.xml",
|
||||||
|
"views/payment_views.xml",
|
||||||
|
"security/website_multi_company_sale_security.xml",
|
||||||
|
],
|
||||||
|
"qweb": [
|
||||||
|
],
|
||||||
|
"demo": [
|
||||||
|
],
|
||||||
|
|
||||||
|
"post_load": None,
|
||||||
|
"pre_init_hook": None,
|
||||||
|
"post_init_hook": None,
|
||||||
|
"uninstall_hook": None,
|
||||||
|
|
||||||
|
"auto_install": False,
|
||||||
|
"installable": True,
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1 @@
|
||||||
|
from . import main
|
||||||
|
|
@ -0,0 +1,19 @@
|
||||||
|
from odoo import http
|
||||||
|
from odoo.http import request
|
||||||
|
from odoo.addons.website_sale.controllers.main import WebsiteSale
|
||||||
|
|
||||||
|
|
||||||
|
class WebsiteMultiCompanySale(WebsiteSale):
|
||||||
|
@http.route()
|
||||||
|
def shop(self, page=0, category=None, search='', ppg=False, **post):
|
||||||
|
response = super(WebsiteMultiCompanySale, self).shop(page=page, category=category, search=search, ppg=ppg, **post)
|
||||||
|
categs = request.env['product.public.category'].search([
|
||||||
|
('parent_id', '=', False),
|
||||||
|
'|',
|
||||||
|
('website_ids', '=', False),
|
||||||
|
('website_ids', 'in', [request.website.id]),
|
||||||
|
])
|
||||||
|
response.qcontext.update({
|
||||||
|
'categories': categs,
|
||||||
|
})
|
||||||
|
return response
|
||||||
|
|
@ -0,0 +1,24 @@
|
||||||
|
`1.2.0`
|
||||||
|
-------
|
||||||
|
|
||||||
|
- **ADD:** you can now specify allowed websites for your payment acquirers
|
||||||
|
|
||||||
|
`1.1.0`
|
||||||
|
-------
|
||||||
|
|
||||||
|
- **ADD:** you can now specify allowed websites for your products
|
||||||
|
|
||||||
|
`1.0.2`
|
||||||
|
-------
|
||||||
|
|
||||||
|
- **ADD:** possibility to specify Salesperson, Sales Channel per each website
|
||||||
|
|
||||||
|
`1.0.1`
|
||||||
|
-------
|
||||||
|
|
||||||
|
- **FIX:** add multi-company support for carts
|
||||||
|
|
||||||
|
`1.0.0`
|
||||||
|
-------
|
||||||
|
|
||||||
|
- Init version
|
||||||
|
|
@ -0,0 +1,72 @@
|
||||||
|
==========================================
|
||||||
|
Real Multi Website (eCommerce extension)
|
||||||
|
==========================================
|
||||||
|
|
||||||
|
Installation
|
||||||
|
============
|
||||||
|
|
||||||
|
* `Install <https://odoo-development.readthedocs.io/en/latest/odoo/usage/install-module.html>`__ this module in a usual way
|
||||||
|
|
||||||
|
Configuration
|
||||||
|
=============
|
||||||
|
|
||||||
|
Follow instruction of the base module `Real Multi Website <https://www.odoo.com/apps/modules/11.0/website_multi_company/>`__.
|
||||||
|
|
||||||
|
Website Orders
|
||||||
|
--------------
|
||||||
|
|
||||||
|
* Open menu ``[[ Website ]] >> Configuration >> Websites``
|
||||||
|
* For each website configure **Salesperson** and **Sales Channel** fields
|
||||||
|
* RESULT: new orders made via website will be assigned to proper Salesperson and Sales Channel
|
||||||
|
|
||||||
|
Multi-categories
|
||||||
|
----------------
|
||||||
|
|
||||||
|
* Open menu ``[[ Website ]] >> Configuration >> Products >> eCommerce Categories``
|
||||||
|
* Only for top-level (i.e. without ``parent_id``) categories: specify **Websites** field
|
||||||
|
|
||||||
|
Multi-products
|
||||||
|
--------------
|
||||||
|
* Open menu ``[[ Sales ]] >> Sales >> Products``
|
||||||
|
* Specify **Allowed websites** for your products
|
||||||
|
* Websites company and product company should be equal. But if you want different company websites then leave the **Company** field empty in your product - in such case you can specify any websites
|
||||||
|
|
||||||
|
Multi-payment-acquirers
|
||||||
|
-----------------------
|
||||||
|
* Open menu ``[[ Website ]] >> Configuration >> eCommerce >> Payment Acquirers``
|
||||||
|
* Specify **Allowed websites** for your payment acquirer. If no website is specified then the acquirer will be available on any website with the same company
|
||||||
|
* Choosen websites companies and acquirer's company should be equal
|
||||||
|
|
||||||
|
|
||||||
|
Usage
|
||||||
|
=====
|
||||||
|
|
||||||
|
Multi-categories
|
||||||
|
----------------
|
||||||
|
|
||||||
|
* Open shop at some of your websites
|
||||||
|
* Login as Administrator
|
||||||
|
* In ``Customize`` section activate ``[x] eCommerce Categories``
|
||||||
|
* RESULT: parent categories for current website and categories without value at **Websites** fields are shown only. **Websites** value of child categories are ignored.
|
||||||
|
|
||||||
|
Multi-cart
|
||||||
|
----------
|
||||||
|
|
||||||
|
* Login as portal or internal user at some of your websites
|
||||||
|
* Add some products to the cart
|
||||||
|
* Open another website that belongs to another company
|
||||||
|
* Login as the same user
|
||||||
|
* RESULT: you have empty cart, rather than one from previous website
|
||||||
|
|
||||||
|
Multi-products
|
||||||
|
--------------
|
||||||
|
|
||||||
|
* Open website shop
|
||||||
|
* RESULT: you should only see products allowed for this website or products with no websites specified
|
||||||
|
|
||||||
|
Multi-payment-acquirers
|
||||||
|
-----------------------
|
||||||
|
|
||||||
|
* Open website shop
|
||||||
|
* Buy a product
|
||||||
|
* On Payment step of checkout there should be available only specified acquirers
|
||||||
Binary file not shown.
|
After Width: | Height: | Size: 298 KiB |
|
|
@ -0,0 +1,4 @@
|
||||||
|
from . import product_public_category
|
||||||
|
from . import sale_order
|
||||||
|
from . import product_template
|
||||||
|
from . import payment_acquirer
|
||||||
|
|
@ -0,0 +1,20 @@
|
||||||
|
from odoo import api, fields, models, _
|
||||||
|
from odoo.exceptions import ValidationError
|
||||||
|
|
||||||
|
|
||||||
|
class PaymentAcquirer(models.Model):
|
||||||
|
_inherit = 'payment.acquirer'
|
||||||
|
|
||||||
|
website_ids = fields.Many2many('website', string='Allowed websites',
|
||||||
|
help='Set the websites this payment acquirer should be available on. Leave empty to allow all.')
|
||||||
|
|
||||||
|
@api.onchange('company_id')
|
||||||
|
def _onchange_company_id(self):
|
||||||
|
return self.company_id and {'domain': {'website_ids': [('company_id', '=', self.company_id.id)]}} or {'domain': {'website_ids': []}}
|
||||||
|
|
||||||
|
@api.constrains('company_id', 'website_ids')
|
||||||
|
def _check_websites_in_company(self):
|
||||||
|
for record in self:
|
||||||
|
website_company = record.website_ids.mapped('company_id')
|
||||||
|
if record.company_id and record.website_ids and (len(website_company) > 1 or website_company[0] != record.company_id):
|
||||||
|
raise ValidationError(_("Error! Only the company's websites are allowed"))
|
||||||
|
|
@ -0,0 +1,11 @@
|
||||||
|
from odoo import models, fields
|
||||||
|
|
||||||
|
|
||||||
|
class ProductPublicCategory(models.Model):
|
||||||
|
_inherit = "product.public.category"
|
||||||
|
|
||||||
|
website_ids = fields.Many2many(
|
||||||
|
'website',
|
||||||
|
string="Websites",
|
||||||
|
help="On which websites show category. Keep empty to show at all websites. The value is ignored if there is Parent Category"
|
||||||
|
)
|
||||||
|
|
@ -0,0 +1,22 @@
|
||||||
|
|
||||||
|
from odoo import api, fields, models, _
|
||||||
|
from odoo.exceptions import ValidationError
|
||||||
|
|
||||||
|
|
||||||
|
class ProductTemplate(models.Model):
|
||||||
|
_inherit = "product.template"
|
||||||
|
|
||||||
|
website_ids = fields.Many2many('website', string='Allowed websites',
|
||||||
|
help='Set the websites this product should be available on. Leave empty to allow all.')
|
||||||
|
|
||||||
|
@api.onchange('company_id')
|
||||||
|
def _onchange_company_id(self):
|
||||||
|
return self.company_id and {'domain': {'website_ids': [('company_id', '=', self.company_id.id)]}} or {'domain': {'website_ids': []}}
|
||||||
|
|
||||||
|
@api.constrains('company_id', 'website_ids')
|
||||||
|
def _check_websites_in_company(self):
|
||||||
|
for record in self:
|
||||||
|
website_company = record.website_ids.mapped('company_id')
|
||||||
|
if record.company_id and record.website_ids and (len(website_company) > 1 or website_company[0] != record.company_id):
|
||||||
|
raise ValidationError(_("Error! Only the company's websites are allowed. \
|
||||||
|
Leave the Company field empty if you want websites from different companies"))
|
||||||
|
|
@ -0,0 +1,24 @@
|
||||||
|
from odoo import models, api, fields
|
||||||
|
from odoo.http import request
|
||||||
|
|
||||||
|
|
||||||
|
class Website(models.Model):
|
||||||
|
_inherit = 'website'
|
||||||
|
|
||||||
|
@api.multi
|
||||||
|
def sale_get_order(self, force_create=False, code=None, update_pricelist=False, force_pricelist=False):
|
||||||
|
company = request.website.company_id
|
||||||
|
if not request.session.get('sale_order_id'):
|
||||||
|
# original sale_get_order uses last_website_so_id only when there is
|
||||||
|
# sale_order_id in the session
|
||||||
|
|
||||||
|
# company.id seems to be the same as self.id, but let's use variant
|
||||||
|
# from original sale_get_order
|
||||||
|
self = self.with_context(force_company=company.id)
|
||||||
|
return super(Website, self).sale_get_order(force_create, code, update_pricelist, force_pricelist)
|
||||||
|
|
||||||
|
|
||||||
|
class ResPartner(models.Model):
|
||||||
|
_inherit = 'res.partner'
|
||||||
|
|
||||||
|
last_website_so_id = fields.Many2one(company_dependent=True)
|
||||||
|
|
@ -0,0 +1,13 @@
|
||||||
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
|
<odoo>
|
||||||
|
<record id="website_multi_company_sale_rule_all" model="ir.rule">
|
||||||
|
<field name="name">Products available only for specifed websites (shops)</field>
|
||||||
|
<field name="model_id" ref="model_product_template"/>
|
||||||
|
<field name="domain_force">['|', ('website_ids', 'in', [website_id]), ('website_ids', '=', False)]</field>
|
||||||
|
</record>
|
||||||
|
<record id="website_multi_company_payment_rule_all" model="ir.rule">
|
||||||
|
<field name="name">Payment acquirers available only for specifed websites (shops)</field>
|
||||||
|
<field name="model_id" ref="model_payment_acquirer"/>
|
||||||
|
<field name="domain_force">['|', ('website_ids', 'in', [website_id]), ('website_ids', '=', False)]</field>
|
||||||
|
</record>
|
||||||
|
</odoo>
|
||||||
Binary file not shown.
|
After Width: | Height: | Size: 2.2 KiB |
|
|
@ -0,0 +1,92 @@
|
||||||
|
<section class="oe_container">
|
||||||
|
<div class="oe_row oe_spaced">
|
||||||
|
<div class="oe_span12">
|
||||||
|
<h2 class="oe_slogan" style="color:#875A7B;">Real Multi Website (eCommerce extension)</h2>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</section>
|
||||||
|
|
||||||
|
<section class="oe_container">
|
||||||
|
<div class="oe_row oe_spaced">
|
||||||
|
<div class="oe_span12">
|
||||||
|
|
||||||
|
<div class="alert alert-info oe_mt32" style="padding:0.3em 0.6em; font-size: 150%;">
|
||||||
|
<i class="fa fa-hand-o-right"></i><b> Key features: </b>
|
||||||
|
<ul class="list-unstyled">
|
||||||
|
|
||||||
|
<li>
|
||||||
|
<i class="fa fa-check-square-o text-primary"></i>
|
||||||
|
All features of <a href="https://apps.odoo.com/apps/modules/11.0/website_multi_company">Real Multi Website</a> module
|
||||||
|
</li>
|
||||||
|
|
||||||
|
<li>
|
||||||
|
<i class="fa fa-check-square-o text-primary"></i>
|
||||||
|
Each eCommerce has configurable list of product categories
|
||||||
|
</li>
|
||||||
|
<li>
|
||||||
|
<i class="fa fa-check-square-o text-primary"></i>
|
||||||
|
eCommerce carts are separate per each company to avoid accounting problems
|
||||||
|
</li>
|
||||||
|
<li>
|
||||||
|
<i class="fa fa-check-square-o text-primary"></i>
|
||||||
|
The same product can be available on several websites (shops)
|
||||||
|
</li>
|
||||||
|
|
||||||
|
</ul>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</section>
|
||||||
|
|
||||||
|
<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>
|
||||||
|
</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(7deg);
|
||||||
|
-o-transform: rotate(7deg);
|
||||||
|
-moz-transform: rotate(7deg);
|
||||||
|
-ms-transform: rotate(7deg);">
|
||||||
|
Tested on Odoo<br/>11.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(-3deg);
|
||||||
|
-o-transform: rotate(-3deg);
|
||||||
|
-moz-transform: rotate(-3deg);
|
||||||
|
-ms-transform: rotate(-3deg);">
|
||||||
|
Tested on Odoo<br/>11.0 enterprise
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</section>
|
||||||
|
|
||||||
|
|
@ -0,0 +1,14 @@
|
||||||
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
|
<odoo>
|
||||||
|
<record id="acquirer_form_view_inherit_website_multi_company_sale" model="ir.ui.view">
|
||||||
|
<field name="name">payment.acquirer.form.inherit.website_multi_company_sale</field>
|
||||||
|
<field name="model">payment.acquirer</field>
|
||||||
|
<field name="inherit_id" ref="payment.acquirer_form"/>
|
||||||
|
<field name="arch" type="xml">
|
||||||
|
<xpath expr="//field[@name='company_id']" position="after">
|
||||||
|
<field name="website_ids" widget="many2many_tags" domain="company_id and [('company_id', '=', company_id)] or []"/>
|
||||||
|
</xpath>
|
||||||
|
</field>
|
||||||
|
</record>
|
||||||
|
</odoo>
|
||||||
|
|
||||||
|
|
@ -0,0 +1,26 @@
|
||||||
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
|
<odoo>
|
||||||
|
|
||||||
|
<record id="product_public_category_form_view" model="ir.ui.view">
|
||||||
|
<field name="name">product.public.category.form</field>
|
||||||
|
<field name="model">product.public.category</field>
|
||||||
|
<field name="inherit_id" ref="website_sale.product_public_category_form_view"/>
|
||||||
|
<field name="arch" type="xml">
|
||||||
|
<xpath expr="//field[@name='sequence']" position="after">
|
||||||
|
<field name="website_ids" widget="many2many_tags" attrs="{'readonly': [('parent_id', '!=', False)]}"/>
|
||||||
|
</xpath>
|
||||||
|
</field>
|
||||||
|
</record>
|
||||||
|
|
||||||
|
<record id="product_public_category_tree_view" model="ir.ui.view">
|
||||||
|
<field name="name">product.public.category.tree</field>
|
||||||
|
<field name="model">product.public.category</field>
|
||||||
|
<field name="inherit_id" ref="website_sale.product_public_category_tree_view"/>
|
||||||
|
<field name="arch" type="xml">
|
||||||
|
<xpath expr="//field[@name='display_name']" position="after">
|
||||||
|
<field name="website_ids" widget="many2many_tags"/>
|
||||||
|
</xpath>
|
||||||
|
</field>
|
||||||
|
</record>
|
||||||
|
|
||||||
|
</odoo>
|
||||||
|
|
@ -0,0 +1,13 @@
|
||||||
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
|
<odoo>
|
||||||
|
<record id="product_template_form_view_inherit_website_multi_comapny_sale" model="ir.ui.view">
|
||||||
|
<field name="name">product.template.form.inherit.website_multi_company_sale</field>
|
||||||
|
<field name="model">product.template</field>
|
||||||
|
<field name="inherit_id" ref="product.product_template_form_view"/>
|
||||||
|
<field name="arch" type="xml">
|
||||||
|
<xpath expr="//field[@name='company_id']" position="after">
|
||||||
|
<field name="website_ids" widget="many2many_tags" domain="company_id and [('company_id', '=', company_id)] or []"/>
|
||||||
|
</xpath>
|
||||||
|
</field>
|
||||||
|
</record>
|
||||||
|
</odoo>
|
||||||
|
|
@ -0,0 +1,17 @@
|
||||||
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
|
<odoo>
|
||||||
|
|
||||||
|
<record id="view_website_multi_company_form" model="ir.ui.view">
|
||||||
|
<field name="model">website</field>
|
||||||
|
<field name="inherit_id" ref="website_multi_company.view_website_multi_company_form"/>
|
||||||
|
<field name="arch" type="xml">
|
||||||
|
<xpath expr="//div[@name='shop']" position="inside">
|
||||||
|
<group string="Assignation of online orders">
|
||||||
|
<field name="salesperson_id"/>
|
||||||
|
<field name="salesteam_id"/>
|
||||||
|
</group>
|
||||||
|
</xpath>
|
||||||
|
</field>
|
||||||
|
</record>
|
||||||
|
|
||||||
|
</odoo>
|
||||||
|
|
@ -490,7 +490,7 @@ class SaleOrderLine(models.Model):
|
||||||
if vals.get('lot_id', False):
|
if vals.get('lot_id', False):
|
||||||
vals.update(intrastat_id=self.env['stock.production.lot'].browse(vals['lot_id']).intrastat_id.id)
|
vals.update(intrastat_id=self.env['stock.production.lot'].browse(vals['lot_id']).intrastat_id.id)
|
||||||
elif vals.get('product_id', False):
|
elif vals.get('product_id', False):
|
||||||
vals.update(intrastat_id=self.env['product.template'].browse(vals['product_id']).intrastat_id.id)
|
vals.update(intrastat_id=self.env['product.product'].browse(vals['product_id']).intrastat_id.id)
|
||||||
return super(SaleOrderLine, self).create(vals)
|
return super(SaleOrderLine, self).create(vals)
|
||||||
|
|
||||||
@api.multi
|
@api.multi
|
||||||
|
|
|
||||||
|
|
@ -52,6 +52,10 @@ ENVIRONMENTS = {
|
||||||
'ab-tz' : Environment('http://localhost', '8080', 'tz-austria_1', 'tz-admin', 'x', 'admin', config = ConfigTZA()),
|
'ab-tz' : Environment('http://localhost', '8080', 'tz-austria_1', 'tz-admin', 'x', 'admin', config = ConfigTZA()),
|
||||||
'ab-glaser' : Environment('http://localhost', '8080', 'tz-austria_1', 'glaser-admin', 'x', 'admin', config = ConfigGlaser()),
|
'ab-glaser' : Environment('http://localhost', '8080', 'tz-austria_1', 'glaser-admin', 'x', 'admin', config = ConfigGlaser()),
|
||||||
|
|
||||||
|
'aw' : Environment('http://localhost', '8080', 'tz-austria_1', 'admin', 'x', 'admin', config = ConfigTZA()),
|
||||||
|
'aw-tz' : Environment('http://localhost', '8080', 'tz-austria_1', 'tz-admin', 'x', 'admin', config = ConfigTZA()),
|
||||||
|
'aw-glaser' : Environment('http://localhost', '8080', 'tz-austria_1', 'glaser-admin', 'x', 'admin', config = ConfigGlaser()),
|
||||||
|
|
||||||
# Remote environments are always listed without passwords!
|
# Remote environments are always listed without passwords!
|
||||||
# Do not store them here, you have to type them anyway!
|
# Do not store them here, you have to type them anyway!
|
||||||
'test': Environment('https://erp.tzaustria.info', '443', 'odoo-test', 'admin', config = ConfigTZA()),
|
'test': Environment('https://erp.tzaustria.info', '443', 'odoo-test', 'admin', config = ConfigTZA()),
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue