Skip to content

Instantly share code, notes, and snippets.

from odoo import api, fields, models
class PosInvoiceReport(models.Model):
_inherit = "pos.invoice.report"
sales_per_invoice_count = fields.Float(
group_operator="SUM(price_subtotal)/COUNT(DISTINCT inv_id)+",
string="Sales per invoice count",
)
diff --git a/addons/website/controllers/main.py b/addons/website/controllers/main.py
index d4f40d72..0c5eeb11 100644
--- a/addons/website/controllers/main.py
+++ b/addons/website/controllers/main.py
@@ -112,7 +112,7 @@ class Website(Home):
if domain_from != domain_to:
# redirect to correct domain for a correct routing map
url_to = werkzeug.urls.url_join(website._get_http_domain(), '/website/force/%s?isredir=1&path=%s' % (website.id, path))
- return request.redirect(url_to)
+ return request.redirect(url_to, local=False)
diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml
index c52f073..80e6e21 100644
--- a/.pre-commit-config.yaml
+++ b/.pre-commit-config.yaml
@@ -12,6 +12,8 @@ exclude: |
/static/(src/)?lib/|
# Repos using Sphinx to generate docs don't need prettying
^docs/_templates/.*\.html$|
+ # всякая *уйня
+ ^sh_pos_all_in_one_retail|
diff --git a/payment_bepaid/models/payment_bepaid.py b/payment_bepaid/models/payment_bepaid.py
index 771e220..63664bf 100644
--- a/payment_bepaid/models/payment_bepaid.py
+++ b/payment_bepaid/models/payment_bepaid.py
@@ -51,7 +51,7 @@ class AcquirerBepaid(models.Model):
"language": "ru",
"customer_fields": {
"visible": ["first_name", "last_name"],
- "read_only": ["email"],
+ "read_only": [],
- if "project_expense_type" in res and "selection" in attributes:
- self.env.cr.execute(
- f"""
-SELECT DISTINCT t.project_expense_type
-FROM {self._table} t
-LEFT JOIN product_product p ON p.id = t.project_expense_type
-LEFT JOIN product_template pt ON pt.id = p.product_tmpl_id
-WHERE project_expense_type IS NOT NULL
- """
- )