3 Commits

Author SHA1 Message Date
e04ab5b009 Sync config from odoo-elabore-ci:16.0
Some checks failed
pre-commit / pre-commit (pull_request) Failing after 7m29s
2025-09-17 13:39:54 +00:00
a7c005c839 [IMP]sale_usability_misc:make opportunity_id visible for sale manager group instead of dev mode group 2025-07-23 17:29:58 +02:00
be44c3c5d4 [ADD]pw_sale_total_qty 2024-12-31 14:20:26 +01:00
18 changed files with 303 additions and 215 deletions

View File

@@ -1,42 +0,0 @@
#!/bin/bash
#
# Run the Python tests of the given Odoo modules.
#
# This script is meant to be executed *inside* an Elabore doodba image
# (docker.0k.io/mirror/odoo:rc_<version>-ELABORE-LIGHT), with a
# PostgreSQL service reachable at $PGHOST. The modules under test are
# read from the current working directory (the checked-out repository),
# which is prepended to the addons path so that the PR's code takes
# precedence over the modules already baked in the image.
#
# Usage: odoo-tests.sh <module1,module2,...>
set -euo pipefail
modules="${1:?usage: odoo-tests.sh <module1,module2,...>}"
export PGHOST=postgres
export PGUSER=odoo
export PGPASSWORD=odoopassword
export PGDATABASE="test_$(basename "$PWD" | tr '.-' '__')"
export WITHOUT_DEMO=all
export DB_FILTER='.*'
# Generate /opt/odoo/auto/odoo.conf from the environment and wait for
# the database to accept connections.
/opt/odoo/common/entrypoint
# Odoo test-tags format: "/module1,/module2" (one leading slash).
tags="/$(echo "$modules" | tr ',' ',/')"
exec odoo \
--config=/opt/odoo/auto/odoo.conf \
--max-cron-threads=0 \
--limit-time-real=10000 \
--workers=0 \
--test-enable \
--stop-after-init \
--addons-path="$PWD,/opt/odoo/auto/addons" \
-d "$PGDATABASE" \
-i "$modules" \
--test-tags "$tags"

View File

@@ -2,6 +2,8 @@ name: pre-commit
on:
pull_request:
branches:
- "16.0*"
jobs:
pre-commit:
@@ -13,10 +15,10 @@ jobs:
python-version: "3.11"
- name: Get python version
run: echo "PY=$(python -VV | sha256sum | cut -d' ' -f1)" >> $GITHUB_ENV
- uses: https://gitea.com/actions/cache@v3
with:
path: ~/.cache/pre-commit
key: pre-commit|${{ env.PY }}|${{ hashFiles('.pre-commit-config.yaml') }}
# - uses: actions/cache@v4
# with:
# path: ~/.cache/pre-commit
# key: pre-commit|${{ env.PY }}|${{ hashFiles('.pre-commit-config.yaml') }}
- name: Install pre-commit
run: pip install pre-commit
- name: Run pre-commit

View File

@@ -1,79 +0,0 @@
name: tests
on:
pull_request:
branches:
- "16.0*"
workflow_dispatch:
jobs:
test:
runs-on: odoo-ci
container:
image: docker.0k.io/mirror/odoo:rc_16.0-ELABORE-LIGHT
services:
postgres:
image: docker.0k.io/postgres:17.2.0-myc
env:
POSTGRES_USER: odoo
POSTGRES_PASSWORD: odoopassword
POSTGRES_DB: postgres
steps:
# The doodba image ships no Node.js, so actions/checkout@v4 cannot
# run here. The repository is private, so the job token is required.
- name: Checkout
env:
SECRET_GITEA_TOKEN: ${{ secrets.GITEA_TOKEN }}
SECRET_GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
set -eu
token="${GITEA_TOKEN:-${GITHUB_TOKEN:-${SECRET_GITEA_TOKEN:-${SECRET_GITHUB_TOKEN:-}}}}"
if [ -z "$token" ]; then
echo "::error::No job token available to clone the repository"
exit 1
fi
server="${GITHUB_SERVER_URL:-https://git.elabore.coop}"
repo="${GITHUB_REPOSITORY:?GITHUB_REPOSITORY is not set}"
ref="${GITHUB_REF:-${GITHUB_SHA:?neither GITHUB_REF nor GITHUB_SHA is set}}"
auth_url="$(printf '%s' "${server%/}/${repo}.git" |
sed -E "s#^https://#https://${token}@#")"
git init -q .
git config --global --add safe.directory "$PWD"
git remote add origin "$auth_url"
git fetch -q --depth=1 origin "$ref"
git checkout -q FETCH_HEAD
- name: Detect changed modules
id: changed
run: |
set -eu
if [ -n "${GITHUB_BASE_REF:-}" ]; then
git fetch -q --depth=1 origin "refs/heads/$GITHUB_BASE_REF"
base_rev="FETCH_HEAD"
scope="diff against $GITHUB_BASE_REF"
else
base_rev=""
scope="all installable modules (manual run)"
fi
if [ -n "$base_rev" ]; then
modules="$(
git diff --name-only "$base_rev" HEAD |
awk -F/ '{print $1}' | sort -u |
while read -r dir; do
[ -f "$dir/__manifest__.py" ] && echo "$dir"
done | paste -sd, -
)"
else
modules="$(
for dir in */; do
dir="${dir%/}"
[ -f "$dir/__manifest__.py" ] && echo "$dir"
done | paste -sd, -
)"
fi
echo "modules=$modules" >> "$GITHUB_OUTPUT"
echo "Modules to test ($scope): ${modules:-<none>}"
- name: Run Odoo tests
if: steps.changed.outputs.modules != ''
run: bash .gitea/scripts/odoo-tests.sh "${{ steps.changed.outputs.modules }}"

90
.gitignore vendored
View File

@@ -1,88 +1,2 @@
# Byte-compiled / optimized / DLL files
__pycache__/
*.py[cod]
/.venv
/.pytest_cache
/.ruff_cache
# C extensions
*.so
# Distribution / packaging
.Python
env/
bin/
build/
develop-eggs/
dist/
eggs/
lib64/
parts/
sdist/
var/
*.egg-info/
.installed.cfg
*.egg
*.eggs
# Windows installers
*.msi
# Debian packages
*.deb
# Redhat packages
*.rpm
# MacOS packages
*.dmg
*.pkg
# Installer logs
pip-log.txt
pip-delete-this-directory.txt
# Unit test / coverage reports
htmlcov/
.tox/
.coverage
.cache
nosetests.xml
coverage.xml
# Translations
*.mo
# Pycharm
.idea
# Eclipse
.settings
# Visual Studio cache/options directory
.vs/
.vscode
# OSX Files
.DS_Store
# Django stuff:
*.log
# Mr Developer
.mr.developer.cfg
.project
.pydevproject
# Rope
.ropeproject
# Sphinx documentation
docs/_build/
# Backup files
*~
*.swp
# OCA rules
!static/lib/
*.*~
*.pyc

View File

@@ -49,9 +49,12 @@ repos:
$(git rev-parse --show-toplevel))"'
- id: oca-gen-addon-readme
entry:
bash -c 'oca-gen-addon-readme --addons-dir=. --branch=$(git symbolic-ref
bash -c 'oca-gen-addon-readme
--addons-dir=.
--branch=$(git symbolic-ref
refs/remotes/origin/HEAD | sed "s@^refs/remotes/origin/@@")
--repo-name=$(basename $(git rev-parse --show-toplevel)) --org-name="Elabore"
--repo-name=$(basename $(git rev-parse --show-toplevel))
--org-name="Elabore"
--if-source-changed --keep-source-digest'
- repo: https://github.com/OCA/odoo-pre-commit-hooks

27
pw_sale_total_qty/LICENSE Normal file
View File

@@ -0,0 +1,27 @@
Odoo Proprietary License v1.0
This software and associated files (the "Software") may only be used (executed,
modified, executed after modifications) if you have purchased a valid license
from the authors, typically via Odoo Apps, or if you have received a written
agreement from the authors of the Software (see the COPYRIGHT file).
You may develop Odoo modules that use the Software as a library (typically
by depending on it, importing it and using its resources), but without copying
any source code or material from the Software. You may distribute those
modules under the license of your choice, provided that this license is
compatible with the terms of the Odoo Proprietary License (For example:
LGPL, MIT, or proprietary licenses similar to this one).
It is forbidden to publish, distribute, sublicense, or sell copies of the Software
or modified copies of the Software.
The above copyright notice and this permission notice must be included in all
copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,
DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
DEALINGS IN THE SOFTWARE.

View File

@@ -0,0 +1,3 @@
# -*- coding: utf-8 -*-
from . import models

View File

@@ -0,0 +1,21 @@
# -*- coding: utf-8 -*-
{
"name": "Sale Order Total Quantity",
'version': '16.0.1.0.1',
'author': 'Preway IT Solutions',
'category': 'Sales',
'depends': ['sale'],
'summary': 'This module helps you to show total qty, delivered qty, invoiced qty and remaining qty on sale order | Sale Order Total Quantity | Sale Total Qty | Total Quantity Of Sale Order Line',
'description': """
- Sale Order Total Quantity
""",
'data': [
"views/sale_order_view.xml",
],
'price': 3.0,
'currency': "EUR",
'application': True,
'installable': True,
"license": "LGPL-3",
"images":["static/description/Banner.png"],
}

View File

@@ -0,0 +1,61 @@
# Translation of Odoo Server.
# This file contains the translation of the following modules:
# * pw_sale_total_qty
#
msgid ""
msgstr ""
"Project-Id-Version: Odoo Server 16.0\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2024-12-31 13:03+0000\n"
"PO-Revision-Date: 2024-12-31 13:03+0000\n"
"Last-Translator: \n"
"Language-Team: \n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: \n"
"Plural-Forms: \n"
#. module: pw_sale_total_qty
#: model:ir.model.fields,field_description:pw_sale_total_qty.field_sale_order__pw_remaining_delivery
msgid "Pending Delivery Qty"
msgstr "Quantités à livrer"
#. module: pw_sale_total_qty
#: model:ir.model.fields,field_description:pw_sale_total_qty.field_sale_order__pw_remaining_invoice
msgid "Pending Invoice Qty"
msgstr "Quantités à facturer"
#. module: pw_sale_total_qty
#: model:ir.model,name:pw_sale_total_qty.model_sale_order
msgid "Sales Order"
msgstr "Bon de commande"
#. module: pw_sale_total_qty
#: model:ir.model.fields,field_description:pw_sale_total_qty.field_sale_order__pw_total_qty_delivered
msgid "Total Delivered Qty"
msgstr "Total quantités livrées"
#. module: pw_sale_total_qty
#: model_terms:ir.ui.view,arch_db:pw_sale_total_qty.view_order_form_inherit_pw_total_qty
msgid "Total Deliverted"
msgstr "Total quantités"
#. module: pw_sale_total_qty
#: model_terms:ir.ui.view,arch_db:pw_sale_total_qty.view_order_form_inherit_pw_total_qty
msgid "Total Demand"
msgstr " Total commandé"
#. module: pw_sale_total_qty
#: model:ir.model.fields,field_description:pw_sale_total_qty.field_sale_order__pw_total_product_uom_qty
msgid "Total Demand Qty"
msgstr " Total quantités commandées"
#. module: pw_sale_total_qty
#: model_terms:ir.ui.view,arch_db:pw_sale_total_qty.view_order_form_inherit_pw_total_qty
msgid "Total Invoiced"
msgstr "Total facturé"
#. module: pw_sale_total_qty
#: model:ir.model.fields,field_description:pw_sale_total_qty.field_sale_order__pw_total_qty_invoiced
msgid "Total Invoiced Qty"
msgstr "Total quantités facturées"

View File

@@ -0,0 +1,61 @@
# Translation of Odoo Server.
# This file contains the translation of the following modules:
# * pw_sale_total_qty
#
msgid ""
msgstr ""
"Project-Id-Version: Odoo Server 16.0\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2024-12-31 13:03+0000\n"
"PO-Revision-Date: 2024-12-31 13:03+0000\n"
"Last-Translator: \n"
"Language-Team: \n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: \n"
"Plural-Forms: \n"
#. module: pw_sale_total_qty
#: model:ir.model.fields,field_description:pw_sale_total_qty.field_sale_order__pw_remaining_delivery
msgid "Pending Delivery Qty"
msgstr ""
#. module: pw_sale_total_qty
#: model:ir.model.fields,field_description:pw_sale_total_qty.field_sale_order__pw_remaining_invoice
msgid "Pending Invoice Qty"
msgstr ""
#. module: pw_sale_total_qty
#: model:ir.model,name:pw_sale_total_qty.model_sale_order
msgid "Sales Order"
msgstr ""
#. module: pw_sale_total_qty
#: model:ir.model.fields,field_description:pw_sale_total_qty.field_sale_order__pw_total_qty_delivered
msgid "Total Delivered Qty"
msgstr ""
#. module: pw_sale_total_qty
#: model_terms:ir.ui.view,arch_db:pw_sale_total_qty.view_order_form_inherit_pw_total_qty
msgid "Total Deliverted"
msgstr ""
#. module: pw_sale_total_qty
#: model_terms:ir.ui.view,arch_db:pw_sale_total_qty.view_order_form_inherit_pw_total_qty
msgid "Total Demand"
msgstr ""
#. module: pw_sale_total_qty
#: model:ir.model.fields,field_description:pw_sale_total_qty.field_sale_order__pw_total_product_uom_qty
msgid "Total Demand Qty"
msgstr ""
#. module: pw_sale_total_qty
#: model_terms:ir.ui.view,arch_db:pw_sale_total_qty.view_order_form_inherit_pw_total_qty
msgid "Total Invoiced"
msgstr ""
#. module: pw_sale_total_qty
#: model:ir.model.fields,field_description:pw_sale_total_qty.field_sale_order__pw_total_qty_invoiced
msgid "Total Invoiced Qty"
msgstr ""

View File

@@ -0,0 +1,2 @@
# -*- coding: utf-8 -*-
from . import sale_order

View File

@@ -0,0 +1,40 @@
# -*- coding: utf-8 -*-
from odoo import models, fields, api, _
from odoo.exceptions import UserError, ValidationError
class SaleOrder(models.Model):
_inherit = 'sale.order'
pw_total_product_uom_qty = fields.Float(string="Total Demand Qty", compute='_compute_pw_total_product_uom_qty')
pw_total_qty_delivered = fields.Float(string="Total Delivered Qty", compute='_compute_pw_total_qty_delivered')
pw_total_qty_invoiced = fields.Float(string="Total Invoiced Qty", compute='_compute_pw_total_qty_invoiced')
pw_remaining_delivery = fields.Float(string="Pending Delivery Qty", compute="_compute_pw_remaining_delivery")
pw_remaining_invoice = fields.Float(string="Pending Invoice Qty", compute="_compute_pw_remaining_invoice")
@api.depends('order_line.product_uom_qty')
def _compute_pw_total_product_uom_qty(self):
for order in self:
order.pw_total_product_uom_qty = sum(order.order_line.mapped('product_uom_qty'))
@api.depends('order_line.qty_delivered')
def _compute_pw_total_qty_delivered(self):
for order in self:
order.pw_total_qty_delivered = sum(order.order_line.mapped('qty_delivered'))
@api.depends('order_line.qty_invoiced')
def _compute_pw_total_qty_invoiced(self):
for order in self:
order.pw_total_qty_invoiced = sum(order.order_line.mapped('qty_invoiced'))
@api.depends('order_line.product_uom_qty', 'order_line.qty_delivered')
def _compute_pw_remaining_delivery(self):
for order in self:
delivery_qty = sum(order.order_line.filtered(lambda x: x.product_id.type != 'service').mapped('product_uom_qty'))
delivered_qty = sum(order.order_line.mapped('qty_delivered'))
order.pw_remaining_delivery = delivery_qty - delivered_qty
@api.depends('pw_total_product_uom_qty', 'pw_total_qty_invoiced')
def _compute_pw_remaining_invoice(self):
for order in self:
order.pw_remaining_invoice = order.pw_total_product_uom_qty - order.pw_total_qty_invoiced

Binary file not shown.

After

Width:  |  Height:  |  Size: 100 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 63 KiB

View File

@@ -0,0 +1,45 @@
<section class="oe_container oe_dark" style="overflow: hidden;
background: #cddae8;
border-radius: 15px;">
<div class="mt32 mb32">
<div class="col-md-12">
<h2 class="oe_slogan" style="font-family: Quicksand; font-size: 35px;"><b>Sale Order Total Quantity</b></h2>
<h3 class="oe_slogn" style="font-family: Quicksand; text-align: center;">This module helps you to show total qty, delivered qty, invoiced qty and remaining qty on sale order
</h3>
</div>
</div>
</section>
<br/><br/>
<section class="oe_container">
<div class="alert" style="color: black;background-color: #cddae8;border-color: black;">
<i class="fa fa-hand-o-right"></i><b> App Features</b>
</div>
<ul class="list-unstyled mr32 ml32">
<li><i class="fa fa-check" style="color: #cddae8;"></i> Show Total Demand Qty, Delivered and Invoiced Quantity on Sale Order </li>
<li><i class="fa fa-check" style="color: #cddae8;"></i> Show Remaining Delivery and Invoice Quantity on Sale Order</li>
<li><i class="fa fa-check" style="color: #cddae8;"></i> Also compatible with community and enterprise</li>
</ul>
<div class="alert text-center mt32" style="background-color: #cddae8;border-color: black;">
<b>Sale Order Total Quantity</b>
</div>
<br/>Total Demand, Delivered, Invoiced, Pending Delivery and Pending Invoiced Quanatity on sale order. (Service product not count in pending delivery)<br/>
<img class="img-border img-responsive thumbnail mt32" src="sale1.png" style="width: 100%;">
</section>
<section class="oe_container" style="overflow: hidden;">
<div class="mt32 mb32">
<div class="col-md-12" style="text-align: center;">
<img src="pw_logo.png" style="width: 300px;" /><br>
</div><br>
<div class="oe_slogan text-center">
<h2 class="oe_slogan">
Contact US
</h2>
<p class="btn btn-success mt8" style="background-color: #2355a6; color: #FFFFFF !important;font-size:20px;"> Email : prewayit@gmail.com </p>
</div>
<div style="text-align: center;">
<p>Note: We give free support incase any bug or issue in our apps (Except data recovery).</p>
</div>
</div>
</section>

Binary file not shown.

After

Width:  |  Height:  |  Size: 45 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 255 KiB

View File

@@ -0,0 +1,30 @@
<?xml version="1.0" encoding="UTF-8"?>
<odoo>
<data>
<record id="view_order_form_inherit_pw_total_qty" model="ir.ui.view">
<field name="name">sale.order.form.inherit.pw.total.qty</field>
<field name="model">sale.order</field>
<field name="inherit_id" ref="sale.view_order_form" />
<field name="arch" type="xml">
<xpath expr="//field[@name='note']" position="before">
<group>
<field name="pw_total_product_uom_qty"/>
<field name="pw_total_qty_delivered"/>
<field name="pw_total_qty_invoiced"/>
<field name="pw_remaining_delivery"/>
<field name="pw_remaining_invoice"/>
</group>
</xpath>
<xpath expr="//field[@name='order_line']//tree//field[@name='product_uom_qty']" position="attributes">
<attribute name="sum">Total Demand</attribute>
</xpath>
<xpath expr="//field[@name='order_line']//tree//field[@name='qty_delivered']" position="attributes">
<attribute name="sum">Total Deliverted</attribute>
</xpath>
<xpath expr="//field[@name='order_line']//tree//field[@name='qty_invoiced']" position="attributes">
<attribute name="sum">Total Invoiced</attribute>
</xpath>
</field>
</record>
</data>
</odoo>