Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion shopinvader_address/models/res_partner.py
Original file line number Diff line number Diff line change
Expand Up @@ -119,7 +119,8 @@ def _get_shopinvader_delivery_address(self, address_id: int) -> "ResPartner":
def _create_shopinvader_delivery_address(self, vals: dict) -> "ResPartner":
self.ensure_one()
vals = dict(vals, parent_id=self.id, type="delivery")
return self.env["res.partner"].create(vals)
self.env["res.partner"].check_access("create")
return self.env["res.partner"].sudo().create(vals)

def _update_shopinvader_delivery_address(
self, vals: dict, address: "ResPartner"
Expand Down
6 changes: 1 addition & 5 deletions shopinvader_api_address/README.rst
Original file line number Diff line number Diff line change
@@ -1,7 +1,3 @@
.. image:: https://odoo-community.org/readme-banner-image
:target: https://odoo-community.org/get-involved?utm_source=readme
:alt: Odoo Community Association

=======================
Shopinvader API Address
=======================
Expand All @@ -17,7 +13,7 @@ Shopinvader API Address
.. |badge1| image:: https://img.shields.io/badge/maturity-Beta-yellow.png
:target: https://odoo-community.org/page/development-status
:alt: Beta
.. |badge2| image:: https://img.shields.io/badge/license-AGPL--3-blue.png
.. |badge2| image:: https://img.shields.io/badge/licence-AGPL--3-blue.png
:target: http://www.gnu.org/licenses/agpl-3.0-standalone.html
:alt: License: AGPL-3
.. |badge3| image:: https://img.shields.io/badge/github-shopinvader%2Fodoo--shopinvader-lightgray.png?logo=github
Expand Down
3 changes: 3 additions & 0 deletions shopinvader_api_address/__manifest__.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,9 @@
"extendable_fastapi",
],
"data": [
"security/acl_res_country.xml",
"security/acl_res_lang.xml",
"security/acl_res_partner_title.xml",
"security/res_groups.xml",
"security/res_partner.xml",
],
Expand Down
20 changes: 20 additions & 0 deletions shopinvader_api_address/security/acl_res_country.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
<?xml version="1.0" encoding="utf-8" ?>
<!--
Copyright 2026 Akretion (http://www.akretion.com).
@author Florian Mounier <florian.mounier@akretion.com>
License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).
-->
<odoo>
<record model="ir.model.access" id="shopinvader_res_country_access_view">
<field name="name">res.country shopinvader user read access</field>
<field name="model_id" ref="base.model_res_country" />
<field
name="group_id"
ref="shopinvader_api_security_sale.shopinvader_sale_user_group"
/>
<field name="perm_read" eval="1" />
<field name="perm_create" eval="0" />
<field name="perm_unlink" eval="0" />
<field name="perm_write" eval="0" />
</record>
</odoo>
20 changes: 20 additions & 0 deletions shopinvader_api_address/security/acl_res_lang.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
<?xml version="1.0" encoding="utf-8" ?>
<!--
Copyright 2026 Akretion (http://www.akretion.com).
@author Florian Mounier <florian.mounier@akretion.com>
License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).
-->
<odoo>
<record model="ir.model.access" id="shopinvader_res_lang_access_view">
<field name="name">res.lang shopinvader user read access</field>
<field name="model_id" ref="base.model_res_lang" />
<field
name="group_id"
ref="shopinvader_api_security_sale.shopinvader_sale_user_group"
/>
<field name="perm_read" eval="1" />
<field name="perm_create" eval="0" />
<field name="perm_unlink" eval="0" />
<field name="perm_write" eval="0" />
</record>
</odoo>
20 changes: 20 additions & 0 deletions shopinvader_api_address/security/acl_res_partner_title.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
<?xml version="1.0" encoding="utf-8" ?>
<!--
Copyright 2026 Akretion (http://www.akretion.com).
@author Florian Mounier <florian.mounier@akretion.com>
License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).
-->
<odoo>
<record model="ir.model.access" id="shopinvader_res_partner_title_access_view">
<field name="name">res.partner.title shopinvader user read access</field>
<field name="model_id" ref="base.model_res_partner_title" />
<field
name="group_id"
ref="shopinvader_api_security_sale.shopinvader_sale_user_group"
/>
<field name="perm_read" eval="1" />
<field name="perm_create" eval="0" />
<field name="perm_unlink" eval="0" />
<field name="perm_write" eval="0" />
</record>
</odoo>
24 changes: 9 additions & 15 deletions shopinvader_api_address/static/description/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<meta name="generator" content="Docutils: https://docutils.sourceforge.io/" />
<title>README.rst</title>
<title>Shopinvader API Address</title>
<style type="text/css">

/*
Expand Down Expand Up @@ -360,21 +360,16 @@
</style>
</head>
<body>
<div class="document">
<div class="document" id="shopinvader-api-address">
<h1 class="title">Shopinvader API Address</h1>


<a class="reference external image-reference" href="https://odoo-community.org/get-involved?utm_source=readme">
<img alt="Odoo Community Association" src="https://odoo-community.org/readme-banner-image" />
</a>
<div class="section" id="shopinvader-api-address">
<h1>Shopinvader API Address</h1>
<!-- !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
!! This file is generated by oca-gen-addon-readme !!
!! changes will be overwritten. !!
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
!! source digest: sha256:bee1accb340e1ba5c796a2b55e1e9465c561bf6fb5dfdbbc787dea55107c8b80
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! -->
<p><a class="reference external image-reference" href="https://odoo-community.org/page/development-status"><img alt="Beta" src="https://img.shields.io/badge/maturity-Beta-yellow.png" /></a> <a class="reference external image-reference" href="http://www.gnu.org/licenses/agpl-3.0-standalone.html"><img alt="License: AGPL-3" src="https://img.shields.io/badge/license-AGPL--3-blue.png" /></a> <a class="reference external image-reference" href="https://github.com/shopinvader/odoo-shopinvader/tree/18.0/shopinvader_api_address"><img alt="shopinvader/odoo-shopinvader" src="https://img.shields.io/badge/github-shopinvader%2Fodoo--shopinvader-lightgray.png?logo=github" /></a></p>
<p><a class="reference external image-reference" href="https://odoo-community.org/page/development-status"><img alt="Beta" src="https://img.shields.io/badge/maturity-Beta-yellow.png" /></a> <a class="reference external image-reference" href="http://www.gnu.org/licenses/agpl-3.0-standalone.html"><img alt="License: AGPL-3" src="https://img.shields.io/badge/licence-AGPL--3-blue.png" /></a> <a class="reference external image-reference" href="https://github.com/shopinvader/odoo-shopinvader/tree/18.0/shopinvader_api_address"><img alt="shopinvader/odoo-shopinvader" src="https://img.shields.io/badge/github-shopinvader%2Fodoo--shopinvader-lightgray.png?logo=github" /></a></p>
<p>This addon adds a web API on top of the res.partner model to ease the
management of addresses from Web frontend.</p>
<p><strong>Table of contents</strong></p>
Expand All @@ -390,23 +385,23 @@ <h1>Shopinvader API Address</h1>
</ul>
</div>
<div class="section" id="bug-tracker">
<h2><a class="toc-backref" href="#toc-entry-1">Bug Tracker</a></h2>
<h1><a class="toc-backref" href="#toc-entry-1">Bug Tracker</a></h1>
<p>Bugs are tracked on <a class="reference external" href="https://github.com/shopinvader/odoo-shopinvader/issues">GitHub Issues</a>.
In case of trouble, please check there if your issue has already been reported.
If you spotted it first, help us to smash it by providing a detailed and welcomed
<a class="reference external" href="https://github.com/shopinvader/odoo-shopinvader/issues/new?body=module:%20shopinvader_api_address%0Aversion:%2018.0%0A%0A**Steps%20to%20reproduce**%0A-%20...%0A%0A**Current%20behavior**%0A%0A**Expected%20behavior**">feedback</a>.</p>
<p>Do not contact contributors directly about support or help with technical issues.</p>
</div>
<div class="section" id="credits">
<h2><a class="toc-backref" href="#toc-entry-2">Credits</a></h2>
<h1><a class="toc-backref" href="#toc-entry-2">Credits</a></h1>
<div class="section" id="authors">
<h3><a class="toc-backref" href="#toc-entry-3">Authors</a></h3>
<h2><a class="toc-backref" href="#toc-entry-3">Authors</a></h2>
<ul class="simple">
<li>ACSONE SA/NV</li>
</ul>
</div>
<div class="section" id="contributors">
<h3><a class="toc-backref" href="#toc-entry-4">Contributors</a></h3>
<h2><a class="toc-backref" href="#toc-entry-4">Contributors</a></h2>
<ul class="simple">
<li>Laurent Mignon &lt;<a class="reference external" href="mailto:laurent.mignon&#64;acsone.eu">laurent.mignon&#64;acsone.eu</a>&gt;</li>
<li>Marie Lejeune &lt;<a class="reference external" href="mailto:marie.lejeune&#64;acsone.eu">marie.lejeune&#64;acsone.eu</a>&gt;</li>
Expand All @@ -415,12 +410,11 @@ <h3><a class="toc-backref" href="#toc-entry-4">Contributors</a></h3>
</ul>
</div>
<div class="section" id="maintainers">
<h3><a class="toc-backref" href="#toc-entry-5">Maintainers</a></h3>
<h2><a class="toc-backref" href="#toc-entry-5">Maintainers</a></h2>
<p>This module is part of the <a class="reference external" href="https://github.com/shopinvader/odoo-shopinvader/tree/18.0/shopinvader_api_address">shopinvader/odoo-shopinvader</a> project on GitHub.</p>
<p>You are welcome to contribute.</p>
</div>
</div>
</div>
</div>
</body>
</html>
3 changes: 2 additions & 1 deletion shopinvader_sale_cart/models/sale_order.py
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,8 @@ def _prepare_cart(self, partner_id):
def _create_empty_cart(self, partner_id):
"""Create a new empty cart for a given partner"""
vals = self._prepare_cart(partner_id)
return self.create(vals)
self.check_access("create")
return self.sudo().create(vals)

def _get_cart_line(self, **kwargs):
"""
Expand Down
Loading