Compare commits

..

54 Commits

Author SHA1 Message Date
Alexis de Lattre
993fb49ab5 [IMP] base_usability: hide industry_id on form view of partners for contacts 2025-11-03 12:17:25 +01:00
Alexis de Lattre
1ba485392a [IMP] commission_simple: allow removal of commission lines 2025-10-31 09:14:24 +00:00
Alexis de Lattre
faca51f126 [IMP] commission_simple: allow to restart commission computation on the same period without deleting all commission results 2025-10-24 14:49:42 +00:00
Alexis de Lattre
3a9a97c742 [IMP] commission_simple: add validation in list view 2025-10-18 07:50:13 +02:00
Alexis de Lattre
647106f508 [IMP] base_usability: restore monkey-patch for formatLang() 2025-10-17 21:34:37 +00:00
Alexis de Lattre
b289980665 Update fr translation for commission_simple and commission_simple_agent 2025-10-17 22:51:54 +02:00
Alexis de Lattre
93e62455ad [IMP] commission_simple: add index=True on the M2O of account.move.line
This speeds-up the opening of commission results
2025-10-17 16:25:55 +00:00
Alexis de Lattre
9fff149835 [IMP] commission_simple: add commission_amount to account.invoice.report 2025-10-17 17:55:50 +02:00
Alexis de Lattre
59148b0522 [IMP] base_usability: add insdustry_id in partner tree and search view
Always show insdustry_id on form view, even when is_company=False
2025-10-17 17:46:11 +02:00
Alexis de Lattre
bfb499d4ca [IMP] commission_simple: fine-tune access rights 2025-10-15 15:11:13 +00:00
Alexis de Lattre
e8f8069a87 [IMP] commission_simple: periodicity moved from company to profile
Update commission_simple_agent_purchase to adapt config page form view
accordingly
2025-10-15 17:04:31 +02:00
Alexis de Lattre
f12218c4a0 [FIX] commission_simple_*: backport from 16 to 14 2025-10-15 09:31:57 +02:00
Alexis de Lattre
204df0e1e8 [IMP] commission_simple: add total base amount in view and XLSX report 2025-10-15 09:22:24 +02:00
Alexis de Lattre
cfb1d2ce1e [IMP] commission_simple: update fr translation 2025-10-15 09:22:24 +02:00
Alexis de Lattre
00ca8789de [IMP] commission_simple: allow use of lambda in inherit of commission result lines 2025-10-15 09:22:24 +02:00
Alexis de Lattre
dfdd09260d [IMP] commission_simple: XSLX report sorted by date (inheritable) 2025-10-15 09:22:24 +02:00
Alexis de Lattre
79032cb217 [IMP] commission_simple*: add XLSX report + improve PO generation
Add message un chatter of PO
2025-10-15 09:22:24 +02:00
Akretion Git Bot
d83bc929aa [ADD] setup.py 2025-10-15 07:21:18 +00:00
Akretion Git Bot
58ff5677dd [ADD] icon.png 2025-10-15 07:21:17 +00:00
Alexis de Lattre
adf62785d9 [ADD] commission_simple_agent_purchase 2025-10-15 09:20:58 +02:00
Alexis de Lattre
eaa9a6fa2d [IMP] commission_simple: improve views and add description for rule list views 2025-10-15 09:06:09 +02:00
Akretion Git Bot
3a4d79b1b2 [ADD] setup.py 2025-05-11 22:19:07 +00:00
Akretion Git Bot
2f0f66280c [ADD] icon.png 2025-05-11 22:19:07 +00:00
Alexis de Lattre
7dee4a7d5b [ADD] purchase_stock_partner_default_picking_type 2025-05-12 00:18:49 +02:00
Akretion Git Bot
a8d93ed2a9 [UPD] README.rst 2025-05-08 12:19:43 +00:00
Alexis de Lattre
a98490706f [IMP] Remove full access on uom.uom and uom.category to sale manager, stock manager, purchase manager, POS manager, MRP manager
We only keep full access to uom.uom and uom.category to the group Administration/Configuration
2025-05-08 12:18:30 +00:00
Akretion Git Bot
47afd81567 [ADD] setup.py 2025-04-01 07:40:56 +00:00
Akretion Git Bot
1247e99f3c [ADD] icon.png 2025-04-01 07:40:55 +00:00
Alexis de Lattre
e5632abb97 Add module stock_valuation_xlsx_viewer 2025-04-01 09:40:34 +02:00
Alexis de Lattre
041aae3e17 stock_valuation_xlsx: update group in ACL 2025-04-01 09:39:53 +02:00
Alexis de Lattre
75a3f69508 [FIX] commission_simple: fix filtering on invoice lines 2025-03-28 15:46:24 +01:00
Akretion Git Bot
ce7a3a382a [ADD] setup.py 2025-03-15 06:28:32 +00:00
Akretion Git Bot
16e7233adb [ADD] icon.png 2025-03-15 06:28:31 +00:00
Alexis de Lattre
6e54d026a6 [ADD] commission_simple, commission_simple_agent, sale_agent
3 modules backported from v16
2025-03-15 07:28:20 +01:00
Alexis de Lattre
ed1a6641ce [IMP] stock_usability: add index on picking_type_id on stock.picking 2025-03-14 16:40:57 +00:00
Alexis de Lattre
51aa9bb58f [IMP] pos_usability: remove order_id from default measures in report pivot view 2025-03-14 13:44:24 +00:00
Alexis de Lattre
47b7b4a133 [IMP] pos_usability: add filters Today and Yesterday on report.pos.order 2025-03-14 13:37:10 +00:00
Alexis de Lattre
99c1f45951 [IMP] sale_usability: qty by default from Sales Stats from product list view 2025-03-14 12:55:50 +00:00
Alexis de Lattre
e33453c1a5 [IMP] sale_usability: add Sale Statistics in product list view 2025-03-12 23:28:15 +01:00
Akretion Git Bot
4804917f37 [UPD] README.rst 2025-02-25 17:52:15 +00:00
Alexis de Lattre
4b658203cc [IMP] mrp_usability: add lot on mrp production report 2025-02-25 18:51:27 +01:00
Alexis de Lattre
e6d801a43a [FIX] product_usability: fix crash when searching on main supplier 2025-02-17 19:39:43 +01:00
Akretion Bot
8510656382 [ADD] setup.py 2025-01-30 02:36:08 +00:00
Akretion Bot
c35c200ead [ADD] icon.png 2025-01-30 02:36:08 +00:00
Akretion Bot
1b99fedd38 [UPD] README.rst 2025-01-30 02:36:08 +00:00
Benoît
e155a7b821 small fixes on sale_show_transaction views 2025-01-23 15:31:33 +01:00
Alexis de Lattre
cec64f83d8 [IMP] account_usability: add internal_group to account type form/tree views 2025-01-23 09:34:49 +01:00
Alexis de Lattre
3e7298f465 stock_usability: add confirm pop-up on inventory validation 2025-01-07 17:35:59 +01:00
Kévin Roche
82b910491a Merge pull request #228 from akretion/14.0-add-account_default_report_without_paiement
[14.0][ADD] account_default_report_without_paiement
2024-12-21 14:29:33 +01:00
Kev-Roche
7a3f5cd05b [14.0][ADD] account_default_report_without_paiement 2024-12-21 14:26:27 +01:00
Alexis de Lattre
1d96cc4c83 stock_usability: add tracking on important fields of stock.production.lot
Code cleanup
2024-12-19 17:30:14 +01:00
beau sebastien
2ff3ea6dcd Merge pull request #214 from akretion/14.0-fix-product_usability
product_usability: seller_id can not be store as muti-company will be broken
2024-12-12 01:39:21 +01:00
Sébastien BEAU
a1f8ab32dd product_usability: make the field seller_id searcheable 2024-12-12 01:38:25 +01:00
Sébastien BEAU
0fa2024dab product_usability: seller_id can not be store as muti-company will be broken
do not store the field as shared product can have different supplier
depending on the company logged
Use compute as related will always pick the first one whatever the
company logged
2024-06-02 22:25:10 +02:00
346 changed files with 4829 additions and 193 deletions

Binary file not shown.

After

Width:  |  Height:  |  Size: 9.2 KiB

View File

@@ -0,0 +1,68 @@
=======================================
Account Default Report Without Paiement
=======================================
..
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
!! This file is generated by oca-gen-addon-readme !!
!! changes will be overwritten. !!
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
!! source digest: sha256:2035514c3af2d372479b91ca5314fe2f5ff90523f11fb8cc874b4fac8b375f50
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
.. |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/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-akretion%2Fodoo--usability-lightgray.png?logo=github
:target: https://github.com/akretion/odoo-usability/tree/14.0/account_default_report_without_paiement
:alt: akretion/odoo-usability
|badge1| |badge2| |badge3|
This module switch the default account report to the one without paiement
**Table of contents**
.. contents::
:local:
Bug Tracker
===========
Bugs are tracked on `GitHub Issues <https://github.com/akretion/odoo-usability/issues>`_.
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
`feedback <https://github.com/akretion/odoo-usability/issues/new?body=module:%20account_default_report_without_paiement%0Aversion:%2014.0%0A%0A**Steps%20to%20reproduce**%0A-%20...%0A%0A**Current%20behavior**%0A%0A**Expected%20behavior**>`_.
Do not contact contributors directly about support or help with technical issues.
Credits
=======
Authors
~~~~~~~
* Akretion
Contributors
~~~~~~~~~~~~
* Kévin Roche <kevin.roche@akretion.com>
Maintainers
~~~~~~~~~~~
.. |maintainer-Kev-Roche| image:: https://github.com/Kev-Roche.png?size=40px
:target: https://github.com/Kev-Roche
:alt: Kev-Roche
Current maintainer:
|maintainer-Kev-Roche|
This module is part of the `akretion/odoo-usability <https://github.com/akretion/odoo-usability/tree/14.0/account_default_report_without_paiement>`_ project on GitHub.
You are welcome to contribute.

View File

@@ -0,0 +1,22 @@
# Copyright 2024 Akretion (https://www.akretion.com).
# @author Kévin Roche <kevin.roche@akretion.com>
# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl).
{
"name": "Account Default Report Without Paiement",
"summary": "Account Default Report Without Paiement",
"version": "14.0.1.0.0",
"category": "reports",
"website": "https://github.com/OCA/account",
"author": "Akretion, Odoo Community Association (OCA)",
"license": "AGPL-3",
"maintainers":["Kev-Roche"],
"application": False,
"installable": True,
"depends": [
"account",
],
"data": [
"data/data.xml",
],
}

View File

@@ -0,0 +1,16 @@
<?xml version="1.0" encoding="UTF-8" ?>
<!-- Copyright (C) 2024 Akretion (<http://www.akretion.com>).
@author Kévin Roche <kevin.roche@akretion.com>
License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl). -->
<odoo>
<record id="account.account_invoices" model="ir.actions.report">
<field name="report_name">account.report_invoice</field>
<field name="report_file">account.report_invoice</field>
</record>
<record id="account.account_invoices_without_payment" model="ir.actions.report">
<field name="name">Factures avec paiement</field>
<field name="report_name">account.report_invoice_with_payments</field>
<field name="report_file">account.report_invoice_with_payments</field>
</record>
</odoo>

View File

@@ -0,0 +1 @@
* Kévin Roche <kevin.roche@akretion.com>

View File

@@ -0,0 +1 @@
This module switch the default account report to the one without paiement

Binary file not shown.

After

Width:  |  Height:  |  Size: 9.2 KiB

View File

@@ -0,0 +1,418 @@
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<meta name="generator" content="Docutils: https://docutils.sourceforge.io/" />
<title>Account Default Report Without Paiement</title>
<style type="text/css">
/*
:Author: David Goodger (goodger@python.org)
:Id: $Id: html4css1.css 9511 2024-01-13 09:50:07Z milde $
:Copyright: This stylesheet has been placed in the public domain.
Default cascading style sheet for the HTML output of Docutils.
Despite the name, some widely supported CSS2 features are used.
See https://docutils.sourceforge.io/docs/howto/html-stylesheets.html for how to
customize this style sheet.
*/
/* used to remove borders from tables and images */
.borderless, table.borderless td, table.borderless th {
border: 0 }
table.borderless td, table.borderless th {
/* Override padding for "table.docutils td" with "! important".
The right padding separates the table cells. */
padding: 0 0.5em 0 0 ! important }
.first {
/* Override more specific margin styles with "! important". */
margin-top: 0 ! important }
.last, .with-subtitle {
margin-bottom: 0 ! important }
.hidden {
display: none }
.subscript {
vertical-align: sub;
font-size: smaller }
.superscript {
vertical-align: super;
font-size: smaller }
a.toc-backref {
text-decoration: none ;
color: black }
blockquote.epigraph {
margin: 2em 5em ; }
dl.docutils dd {
margin-bottom: 0.5em }
object[type="image/svg+xml"], object[type="application/x-shockwave-flash"] {
overflow: hidden;
}
/* Uncomment (and remove this text!) to get bold-faced definition list terms
dl.docutils dt {
font-weight: bold }
*/
div.abstract {
margin: 2em 5em }
div.abstract p.topic-title {
font-weight: bold ;
text-align: center }
div.admonition, div.attention, div.caution, div.danger, div.error,
div.hint, div.important, div.note, div.tip, div.warning {
margin: 2em ;
border: medium outset ;
padding: 1em }
div.admonition p.admonition-title, div.hint p.admonition-title,
div.important p.admonition-title, div.note p.admonition-title,
div.tip p.admonition-title {
font-weight: bold ;
font-family: sans-serif }
div.attention p.admonition-title, div.caution p.admonition-title,
div.danger p.admonition-title, div.error p.admonition-title,
div.warning p.admonition-title, .code .error {
color: red ;
font-weight: bold ;
font-family: sans-serif }
/* Uncomment (and remove this text!) to get reduced vertical space in
compound paragraphs.
div.compound .compound-first, div.compound .compound-middle {
margin-bottom: 0.5em }
div.compound .compound-last, div.compound .compound-middle {
margin-top: 0.5em }
*/
div.dedication {
margin: 2em 5em ;
text-align: center ;
font-style: italic }
div.dedication p.topic-title {
font-weight: bold ;
font-style: normal }
div.figure {
margin-left: 2em ;
margin-right: 2em }
div.footer, div.header {
clear: both;
font-size: smaller }
div.line-block {
display: block ;
margin-top: 1em ;
margin-bottom: 1em }
div.line-block div.line-block {
margin-top: 0 ;
margin-bottom: 0 ;
margin-left: 1.5em }
div.sidebar {
margin: 0 0 0.5em 1em ;
border: medium outset ;
padding: 1em ;
background-color: #ffffee ;
width: 40% ;
float: right ;
clear: right }
div.sidebar p.rubric {
font-family: sans-serif ;
font-size: medium }
div.system-messages {
margin: 5em }
div.system-messages h1 {
color: red }
div.system-message {
border: medium outset ;
padding: 1em }
div.system-message p.system-message-title {
color: red ;
font-weight: bold }
div.topic {
margin: 2em }
h1.section-subtitle, h2.section-subtitle, h3.section-subtitle,
h4.section-subtitle, h5.section-subtitle, h6.section-subtitle {
margin-top: 0.4em }
h1.title {
text-align: center }
h2.subtitle {
text-align: center }
hr.docutils {
width: 75% }
img.align-left, .figure.align-left, object.align-left, table.align-left {
clear: left ;
float: left ;
margin-right: 1em }
img.align-right, .figure.align-right, object.align-right, table.align-right {
clear: right ;
float: right ;
margin-left: 1em }
img.align-center, .figure.align-center, object.align-center {
display: block;
margin-left: auto;
margin-right: auto;
}
table.align-center {
margin-left: auto;
margin-right: auto;
}
.align-left {
text-align: left }
.align-center {
clear: both ;
text-align: center }
.align-right {
text-align: right }
/* reset inner alignment in figures */
div.align-right {
text-align: inherit }
/* div.align-center * { */
/* text-align: left } */
.align-top {
vertical-align: top }
.align-middle {
vertical-align: middle }
.align-bottom {
vertical-align: bottom }
ol.simple, ul.simple {
margin-bottom: 1em }
ol.arabic {
list-style: decimal }
ol.loweralpha {
list-style: lower-alpha }
ol.upperalpha {
list-style: upper-alpha }
ol.lowerroman {
list-style: lower-roman }
ol.upperroman {
list-style: upper-roman }
p.attribution {
text-align: right ;
margin-left: 50% }
p.caption {
font-style: italic }
p.credits {
font-style: italic ;
font-size: smaller }
p.label {
white-space: nowrap }
p.rubric {
font-weight: bold ;
font-size: larger ;
color: maroon ;
text-align: center }
p.sidebar-title {
font-family: sans-serif ;
font-weight: bold ;
font-size: larger }
p.sidebar-subtitle {
font-family: sans-serif ;
font-weight: bold }
p.topic-title {
font-weight: bold }
pre.address {
margin-bottom: 0 ;
margin-top: 0 ;
font: inherit }
pre.literal-block, pre.doctest-block, pre.math, pre.code {
margin-left: 2em ;
margin-right: 2em }
pre.code .ln { color: gray; } /* line numbers */
pre.code, code { background-color: #eeeeee }
pre.code .comment, code .comment { color: #5C6576 }
pre.code .keyword, code .keyword { color: #3B0D06; font-weight: bold }
pre.code .literal.string, code .literal.string { color: #0C5404 }
pre.code .name.builtin, code .name.builtin { color: #352B84 }
pre.code .deleted, code .deleted { background-color: #DEB0A1}
pre.code .inserted, code .inserted { background-color: #A3D289}
span.classifier {
font-family: sans-serif ;
font-style: oblique }
span.classifier-delimiter {
font-family: sans-serif ;
font-weight: bold }
span.interpreted {
font-family: sans-serif }
span.option {
white-space: nowrap }
span.pre {
white-space: pre }
span.problematic, pre.problematic {
color: red }
span.section-subtitle {
/* font-size relative to parent (h1..h6 element) */
font-size: 80% }
table.citation {
border-left: solid 1px gray;
margin-left: 1px }
table.docinfo {
margin: 2em 4em }
table.docutils {
margin-top: 0.5em ;
margin-bottom: 0.5em }
table.footnote {
border-left: solid 1px black;
margin-left: 1px }
table.docutils td, table.docutils th,
table.docinfo td, table.docinfo th {
padding-left: 0.5em ;
padding-right: 0.5em ;
vertical-align: top }
table.docutils th.field-name, table.docinfo th.docinfo-name {
font-weight: bold ;
text-align: left ;
white-space: nowrap ;
padding-left: 0 }
/* "booktabs" style (no vertical lines) */
table.docutils.booktabs {
border: 0px;
border-top: 2px solid;
border-bottom: 2px solid;
border-collapse: collapse;
}
table.docutils.booktabs * {
border: 0px;
}
table.docutils.booktabs th {
border-bottom: thin solid;
text-align: left;
}
h1 tt.docutils, h2 tt.docutils, h3 tt.docutils,
h4 tt.docutils, h5 tt.docutils, h6 tt.docutils {
font-size: 100% }
ul.auto-toc {
list-style-type: none }
</style>
</head>
<body>
<div class="document" id="account-default-report-without-paiement">
<h1 class="title">Account Default Report Without Paiement</h1>
<!-- !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
!! This file is generated by oca-gen-addon-readme !!
!! changes will be overwritten. !!
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
!! source digest: sha256:2035514c3af2d372479b91ca5314fe2f5ff90523f11fb8cc874b4fac8b375f50
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! -->
<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/akretion/odoo-usability/tree/14.0/account_default_report_without_paiement"><img alt="akretion/odoo-usability" src="https://img.shields.io/badge/github-akretion%2Fodoo--usability-lightgray.png?logo=github" /></a></p>
<p>This module switch the default account report to the one without paiement</p>
<p><strong>Table of contents</strong></p>
<div class="contents local topic" id="contents">
<ul class="simple">
<li><a class="reference internal" href="#bug-tracker" id="toc-entry-1">Bug Tracker</a></li>
<li><a class="reference internal" href="#credits" id="toc-entry-2">Credits</a><ul>
<li><a class="reference internal" href="#authors" id="toc-entry-3">Authors</a></li>
<li><a class="reference internal" href="#contributors" id="toc-entry-4">Contributors</a></li>
<li><a class="reference internal" href="#maintainers" id="toc-entry-5">Maintainers</a></li>
</ul>
</li>
</ul>
</div>
<div class="section" id="bug-tracker">
<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/akretion/odoo-usability/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/akretion/odoo-usability/issues/new?body=module:%20account_default_report_without_paiement%0Aversion:%2014.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">
<h1><a class="toc-backref" href="#toc-entry-2">Credits</a></h1>
<div class="section" id="authors">
<h2><a class="toc-backref" href="#toc-entry-3">Authors</a></h2>
<ul class="simple">
<li>Akretion</li>
</ul>
</div>
<div class="section" id="contributors">
<h2><a class="toc-backref" href="#toc-entry-4">Contributors</a></h2>
<ul class="simple">
<li>Kévin Roche &lt;<a class="reference external" href="mailto:kevin.roche&#64;akretion.com">kevin.roche&#64;akretion.com</a>&gt;</li>
</ul>
</div>
<div class="section" id="maintainers">
<h2><a class="toc-backref" href="#toc-entry-5">Maintainers</a></h2>
<p>Current maintainer:</p>
<p><a class="reference external image-reference" href="https://github.com/Kev-Roche"><img alt="Kev-Roche" src="https://github.com/Kev-Roche.png?size=40px" /></a></p>
<p>This module is part of the <a class="reference external" href="https://github.com/akretion/odoo-usability/tree/14.0/account_default_report_without_paiement">akretion/odoo-usability</a> project on GitHub.</p>
<p>You are welcome to contribute.</p>
</div>
</div>
</div>
</body>
</html>

Binary file not shown.

After

Width:  |  Height:  |  Size: 9.2 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 9.2 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 9.2 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 9.2 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 9.2 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 9.2 KiB

View File

@@ -2,10 +2,13 @@
Account Usability
=================
.. !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
..
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
!! This file is generated by oca-gen-addon-readme !!
!! changes will be overwritten. !!
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
!! source digest: sha256:0a1f18d3ec52ddde3b0ffdb507573d43a38ec1609a578fae0c43f5e5a65026be
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
.. |badge1| image:: https://img.shields.io/badge/maturity-Beta-yellow.png
:target: https://odoo-community.org/page/development-status
@@ -14,10 +17,10 @@ Account Usability
:target: http://www.gnu.org/licenses/agpl-3.0-standalone.html
:alt: License: AGPL-3
.. |badge3| image:: https://img.shields.io/badge/github-akretion%2Fodoo--usability-lightgray.png?logo=github
:target: https://github.com/akretion/odoo-usability/tree/12.0/account_usability
:target: https://github.com/akretion/odoo-usability/tree/14.0/account_usability
:alt: akretion/odoo-usability
|badge1| |badge2| |badge3|
|badge1| |badge2| |badge3|
This modules adds the following functions:
@@ -52,7 +55,6 @@ This modules adds the following functions:
* don't attach PDF upon invoice report generation on supplier invoices/refunds
* Add filter on debit and credit amount for Move Lines
* Add supplier invoice number in invoice tree view
* Add date in outstanding payment widget on invoice form view (requires `odoo PR 84180 <https://github.com/odoo/odoo/pull/84180>`_)
Together with this module, I recommend the use of the following modules:
@@ -70,8 +72,8 @@ Bug Tracker
Bugs are tracked on `GitHub Issues <https://github.com/akretion/odoo-usability/issues>`_.
In case of trouble, please check there if your issue has already been reported.
If you spotted it first, help us smashing it by providing a detailed and welcomed
`feedback <https://github.com/akretion/odoo-usability/issues/new?body=module:%20account_usability%0Aversion:%2012.0%0A%0A**Steps%20to%20reproduce**%0A-%20...%0A%0A**Current%20behavior**%0A%0A**Expected%20behavior**>`_.
If you spotted it first, help us to smash it by providing a detailed and welcomed
`feedback <https://github.com/akretion/odoo-usability/issues/new?body=module:%20account_usability%0Aversion:%2014.0%0A%0A**Steps%20to%20reproduce**%0A-%20...%0A%0A**Current%20behavior**%0A%0A**Expected%20behavior**>`_.
Do not contact contributors directly about support or help with technical issues.
@@ -92,6 +94,6 @@ Contributors
Maintainers
~~~~~~~~~~~
This module is part of the `akretion/odoo-usability <https://github.com/akretion/odoo-usability/tree/12.0/account_usability>`_ project on GitHub.
This module is part of the `akretion/odoo-usability <https://github.com/akretion/odoo-usability/tree/14.0/account_usability>`_ project on GitHub.
You are welcome to contribute.

View File

@@ -1,20 +1,20 @@
<?xml version="1.0" encoding="utf-8" ?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<meta name="generator" content="Docutils 0.15.1: http://docutils.sourceforge.net/" />
<meta name="generator" content="Docutils: https://docutils.sourceforge.io/" />
<title>Account Usability</title>
<style type="text/css">
/*
:Author: David Goodger (goodger@python.org)
:Id: $Id: html4css1.css 7952 2016-07-26 18:15:59Z milde $
:Id: $Id: html4css1.css 9511 2024-01-13 09:50:07Z milde $
:Copyright: This stylesheet has been placed in the public domain.
Default cascading style sheet for the HTML output of Docutils.
Despite the name, some widely supported CSS2 features are used.
See http://docutils.sf.net/docs/howto/html-stylesheets.html for how to
See https://docutils.sourceforge.io/docs/howto/html-stylesheets.html for how to
customize this style sheet.
*/
@@ -275,7 +275,7 @@ pre.literal-block, pre.doctest-block, pre.math, pre.code {
margin-left: 2em ;
margin-right: 2em }
pre.code .ln { color: grey; } /* line numbers */
pre.code .ln { color: gray; } /* line numbers */
pre.code, code { background-color: #eeeeee }
pre.code .comment, code .comment { color: #5C6576 }
pre.code .keyword, code .keyword { color: #3B0D06; font-weight: bold }
@@ -301,7 +301,7 @@ span.option {
span.pre {
white-space: pre }
span.problematic {
span.problematic, pre.problematic {
color: red }
span.section-subtitle {
@@ -366,8 +366,10 @@ ul.auto-toc {
<!-- !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
!! This file is generated by oca-gen-addon-readme !!
!! changes will be overwritten. !!
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
!! source digest: sha256:0a1f18d3ec52ddde3b0ffdb507573d43a38ec1609a578fae0c43f5e5a65026be
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! -->
<p><a class="reference external" 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" 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" href="https://github.com/akretion/odoo-usability/tree/12.0/account_usability"><img alt="akretion/odoo-usability" src="https://img.shields.io/badge/github-akretion%2Fodoo--usability-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/akretion/odoo-usability/tree/14.0/account_usability"><img alt="akretion/odoo-usability" src="https://img.shields.io/badge/github-akretion%2Fodoo--usability-lightgray.png?logo=github" /></a></p>
<p>This modules adds the following functions:</p>
<ul class="simple">
<li>Add an <em>Overdue</em> filter on invoice search view (this feature was previously
@@ -411,41 +413,41 @@ located in te module <em>account_invoice_overdue_filter</em>)</li>
<p><strong>Table of contents</strong></p>
<div class="contents local topic" id="contents">
<ul class="simple">
<li><a class="reference internal" href="#bug-tracker" id="id1">Bug Tracker</a></li>
<li><a class="reference internal" href="#credits" id="id2">Credits</a><ul>
<li><a class="reference internal" href="#authors" id="id3">Authors</a></li>
<li><a class="reference internal" href="#contributors" id="id4">Contributors</a></li>
<li><a class="reference internal" href="#maintainers" id="id5">Maintainers</a></li>
<li><a class="reference internal" href="#bug-tracker" id="toc-entry-1">Bug Tracker</a></li>
<li><a class="reference internal" href="#credits" id="toc-entry-2">Credits</a><ul>
<li><a class="reference internal" href="#authors" id="toc-entry-3">Authors</a></li>
<li><a class="reference internal" href="#contributors" id="toc-entry-4">Contributors</a></li>
<li><a class="reference internal" href="#maintainers" id="toc-entry-5">Maintainers</a></li>
</ul>
</li>
</ul>
</div>
<div class="section" id="bug-tracker">
<h1><a class="toc-backref" href="#id1">Bug Tracker</a></h1>
<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/akretion/odoo-usability/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 smashing it by providing a detailed and welcomed
<a class="reference external" href="https://github.com/akretion/odoo-usability/issues/new?body=module:%20account_usability%0Aversion:%2012.0%0A%0A**Steps%20to%20reproduce**%0A-%20...%0A%0A**Current%20behavior**%0A%0A**Expected%20behavior**">feedback</a>.</p>
If you spotted it first, help us to smash it by providing a detailed and welcomed
<a class="reference external" href="https://github.com/akretion/odoo-usability/issues/new?body=module:%20account_usability%0Aversion:%2014.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">
<h1><a class="toc-backref" href="#id2">Credits</a></h1>
<h1><a class="toc-backref" href="#toc-entry-2">Credits</a></h1>
<div class="section" id="authors">
<h2><a class="toc-backref" href="#id3">Authors</a></h2>
<h2><a class="toc-backref" href="#toc-entry-3">Authors</a></h2>
<ul class="simple">
<li>Akretion</li>
</ul>
</div>
<div class="section" id="contributors">
<h2><a class="toc-backref" href="#id4">Contributors</a></h2>
<h2><a class="toc-backref" href="#toc-entry-4">Contributors</a></h2>
<ul class="simple">
<li>Alexis de Lattre &lt;<a class="reference external" href="mailto:alexis.delattre&#64;akretion.com">alexis.delattre&#64;akretion.com</a>&gt;</li>
<li>David Beal &lt;<a class="reference external" href="mailto:david.beal&#64;akretion.com">david.beal&#64;akretion.com</a>&gt;</li>
</ul>
</div>
<div class="section" id="maintainers">
<h2><a class="toc-backref" href="#id5">Maintainers</a></h2>
<p>This module is part of the <a class="reference external" href="https://github.com/akretion/odoo-usability/tree/12.0/account_usability">akretion/odoo-usability</a> project on GitHub.</p>
<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/akretion/odoo-usability/tree/14.0/account_usability">akretion/odoo-usability</a> project on GitHub.</p>
<p>You are welcome to contribute.</p>
</div>
</div>

View File

@@ -7,12 +7,24 @@
<odoo>
<record id="view_account_type_form" model="ir.ui.view">
<field name="name">account_usability.account_account_type.form</field>
<field name="model">account.account.type</field>
<field name="inherit_id" ref="account.view_account_type_form" />
<field name="arch" type="xml">
<field name="type" position="after">
<field name="internal_group"/>
</field>
</field>
</record>
<record id="view_account_type_tree" model="ir.ui.view">
<field name="name">account_usability.account_type_tree</field>
<field name="name">account_usability.account_account_type_tree</field>
<field name="model">account.account.type</field>
<field name="inherit_id" ref="account.view_account_type_tree" />
<field name="arch" type="xml">
<field name="type" position="after">
<field name="internal_group" optional="show"/>
<field name="include_initial_balance" optional="show"/>
</field>
</field>

View File

@@ -21,12 +21,10 @@ class AccountMoveReversal(models.TransientModel):
moves = amo.browse(self._context['active_ids'])
if len(moves) == 1 and moves.move_type not in ('out_invoice', 'in_invoice'):
res['date'] = moves.date + relativedelta(days=1)
entry_moves = moves.filtered(lambda m: m.move_type == "entry")
if entry_moves:
reversed_move = amo.search([('reversed_entry_id', 'in', entry_moves.ids)], limit=1)
if reversed_move:
raise UserError(_(
"Move '%s' has already been reversed by move '%s'.") % (
reversed_move.reversed_entry_id.display_name,
reversed_move.display_name))
reversed_move = amo.search([('reversed_entry_id', 'in', moves.ids)], limit=1)
if reversed_move:
raise UserError(_(
"Move '%s' has already been reversed by move '%s'.") % (
reversed_move.reversed_entry_id.display_name,
reversed_move.display_name))
return res

View File

@@ -2,10 +2,13 @@
Base Company Extension
======================
.. !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
..
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
!! This file is generated by oca-gen-addon-readme !!
!! changes will be overwritten. !!
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
!! source digest: sha256:f1f2fb39af0682210c6ac91e106869ab7bfffe1c397becc289eaaf68b707e933
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
.. |badge1| image:: https://img.shields.io/badge/maturity-Beta-yellow.png
:target: https://odoo-community.org/page/development-status
@@ -14,24 +17,28 @@ Base Company Extension
:target: http://www.gnu.org/licenses/agpl-3.0-standalone.html
:alt: License: AGPL-3
.. |badge3| image:: https://img.shields.io/badge/github-akretion%2Fodoo--usability-lightgray.png?logo=github
:target: https://github.com/akretion/odoo-usability/tree/12.0/base_company_extension
:target: https://github.com/akretion/odoo-usability/tree/14.0/base_company_extension
:alt: akretion/odoo-usability
|badge1| |badge2| |badge3|
This module adds the following fields on the company:
|badge1| |badge2| |badge3|
This module adds the following fields to the ResCompany model:
* Capital Amount
* Legal Type
This is useful to display the legal name of the company in reports.
This is useful to display the legal name of the company in reports
**Table of contents**
.. contents::
:local:
Bug Tracker
===========
Bugs are tracked on `GitHub Issues <https://github.com/akretion/odoo-usability/issues>`_.
In case of trouble, please check there if your issue has already been reported.
If you spotted it first, help us smashing it by providing a detailed and welcomed
If you spotted it first, help us to smash it by providing a detailed and welcomed
`feedback <https://github.com/akretion/odoo-usability/issues/new?body=module:%20base_company_extension%0Aversion:%2014.0%0A%0A**Steps%20to%20reproduce**%0A-%20...%0A%0A**Current%20behavior**%0A%0A**Expected%20behavior**>`_.
Do not contact contributors directly about support or help with technical issues.
@@ -52,6 +59,6 @@ Contributors
Maintainers
~~~~~~~~~~~
This module is part of the `akretion/odoo-usability <https://github.com/akretion/odoo-usability/tree/12.0/base_company_extension>`_ project on GitHub.
This module is part of the `akretion/odoo-usability <https://github.com/akretion/odoo-usability/tree/14.0/base_company_extension>`_ project on GitHub.
You are welcome to contribute.

Binary file not shown.

After

Width:  |  Height:  |  Size: 9.2 KiB

View File

@@ -1,20 +1,20 @@
<?xml version="1.0" encoding="utf-8" ?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<meta name="generator" content="Docutils 0.15.1: http://docutils.sourceforge.net/" />
<meta name="generator" content="Docutils: https://docutils.sourceforge.io/" />
<title>Base Company Extension</title>
<style type="text/css">
/*
:Author: David Goodger (goodger@python.org)
:Id: $Id: html4css1.css 7952 2016-07-26 18:15:59Z milde $
:Id: $Id: html4css1.css 9511 2024-01-13 09:50:07Z milde $
:Copyright: This stylesheet has been placed in the public domain.
Default cascading style sheet for the HTML output of Docutils.
Despite the name, some widely supported CSS2 features are used.
See http://docutils.sf.net/docs/howto/html-stylesheets.html for how to
See https://docutils.sourceforge.io/docs/howto/html-stylesheets.html for how to
customize this style sheet.
*/
@@ -275,7 +275,7 @@ pre.literal-block, pre.doctest-block, pre.math, pre.code {
margin-left: 2em ;
margin-right: 2em }
pre.code .ln { color: grey; } /* line numbers */
pre.code .ln { color: gray; } /* line numbers */
pre.code, code { background-color: #eeeeee }
pre.code .comment, code .comment { color: #5C6576 }
pre.code .keyword, code .keyword { color: #3B0D06; font-weight: bold }
@@ -301,7 +301,7 @@ span.option {
span.pre {
white-space: pre }
span.problematic {
span.problematic, pre.problematic {
color: red }
span.section-subtitle {
@@ -366,8 +366,10 @@ ul.auto-toc {
<!-- !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
!! This file is generated by oca-gen-addon-readme !!
!! changes will be overwritten. !!
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
!! source digest: sha256:f1f2fb39af0682210c6ac91e106869ab7bfffe1c397becc289eaaf68b707e933
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! -->
<p><a class="reference external" 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" 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" href="https://github.com/akretion/odoo-usability/tree/12.0/base_company_extension"><img alt="akretion/odoo-usability" src="https://img.shields.io/badge/github-akretion%2Fodoo--usability-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/akretion/odoo-usability/tree/14.0/base_company_extension"><img alt="akretion/odoo-usability" src="https://img.shields.io/badge/github-akretion%2Fodoo--usability-lightgray.png?logo=github" /></a></p>
<p>This module adds the following fields to the ResCompany model:
* Capital Amount
* Legal Type</p>
@@ -375,40 +377,40 @@ ul.auto-toc {
<p><strong>Table of contents</strong></p>
<div class="contents local topic" id="contents">
<ul class="simple">
<li><a class="reference internal" href="#bug-tracker" id="id1">Bug Tracker</a></li>
<li><a class="reference internal" href="#credits" id="id2">Credits</a><ul>
<li><a class="reference internal" href="#authors" id="id3">Authors</a></li>
<li><a class="reference internal" href="#contributors" id="id4">Contributors</a></li>
<li><a class="reference internal" href="#maintainers" id="id5">Maintainers</a></li>
<li><a class="reference internal" href="#bug-tracker" id="toc-entry-1">Bug Tracker</a></li>
<li><a class="reference internal" href="#credits" id="toc-entry-2">Credits</a><ul>
<li><a class="reference internal" href="#authors" id="toc-entry-3">Authors</a></li>
<li><a class="reference internal" href="#contributors" id="toc-entry-4">Contributors</a></li>
<li><a class="reference internal" href="#maintainers" id="toc-entry-5">Maintainers</a></li>
</ul>
</li>
</ul>
</div>
<div class="section" id="bug-tracker">
<h1><a class="toc-backref" href="#id1">Bug Tracker</a></h1>
<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/akretion/odoo-usability/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 smashing it by providing a detailed and welcomed
<a class="reference external" href="https://github.com/akretion/odoo-usability/issues/new?body=module:%20base_company_extension%0Aversion:%2012.0%0A%0A**Steps%20to%20reproduce**%0A-%20...%0A%0A**Current%20behavior**%0A%0A**Expected%20behavior**">feedback</a>.</p>
If you spotted it first, help us to smash it by providing a detailed and welcomed
<a class="reference external" href="https://github.com/akretion/odoo-usability/issues/new?body=module:%20base_company_extension%0Aversion:%2014.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">
<h1><a class="toc-backref" href="#id2">Credits</a></h1>
<h1><a class="toc-backref" href="#toc-entry-2">Credits</a></h1>
<div class="section" id="authors">
<h2><a class="toc-backref" href="#id3">Authors</a></h2>
<h2><a class="toc-backref" href="#toc-entry-3">Authors</a></h2>
<ul class="simple">
<li>Akretion</li>
</ul>
</div>
<div class="section" id="contributors">
<h2><a class="toc-backref" href="#id4">Contributors</a></h2>
<h2><a class="toc-backref" href="#toc-entry-4">Contributors</a></h2>
<ul class="simple">
<li>Alexis de Lattre &lt;<a class="reference external" href="mailto:alexis.delattre&#64;akretion.com">alexis.delattre&#64;akretion.com</a>&gt;</li>
</ul>
</div>
<div class="section" id="maintainers">
<h2><a class="toc-backref" href="#id5">Maintainers</a></h2>
<p>This module is part of the <a class="reference external" href="https://github.com/akretion/odoo-usability/tree/12.0/base_company_extension">akretion/odoo-usability</a> project on GitHub.</p>
<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/akretion/odoo-usability/tree/14.0/base_company_extension">akretion/odoo-usability</a> project on GitHub.</p>
<p>You are welcome to contribute.</p>
</div>
</div>

Binary file not shown.

After

Width:  |  Height:  |  Size: 9.2 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 9.2 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 9.2 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 9.2 KiB

View File

@@ -2,10 +2,13 @@
Base Usability
==============
.. !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
..
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
!! This file is generated by oca-gen-addon-readme !!
!! changes will be overwritten. !!
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
!! source digest: sha256:34b38099c08b1967a5082dd802765b1b34015403159badf256ee845648d9e6da
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
.. |badge1| image:: https://img.shields.io/badge/maturity-Beta-yellow.png
:target: https://odoo-community.org/page/development-status
@@ -14,10 +17,10 @@ Base Usability
:target: http://www.gnu.org/licenses/agpl-3.0-standalone.html
:alt: License: AGPL-3
.. |badge3| image:: https://img.shields.io/badge/github-akretion%2Fodoo--usability-lightgray.png?logo=github
:target: https://github.com/akretion/odoo-usability/tree/12.0/base_usability
:target: https://github.com/akretion/odoo-usability/tree/14.0/base_usability
:alt: akretion/odoo-usability
|badge1| |badge2| |badge3|
|badge1| |badge2| |badge3|
This module adds the following functions:
@@ -55,8 +58,8 @@ Bug Tracker
Bugs are tracked on `GitHub Issues <https://github.com/akretion/odoo-usability/issues>`_.
In case of trouble, please check there if your issue has already been reported.
If you spotted it first, help us smashing it by providing a detailed and welcomed
`feedback <https://github.com/akretion/odoo-usability/issues/new?body=module:%20base_usability%0Aversion:%2012.0%0A%0A**Steps%20to%20reproduce**%0A-%20...%0A%0A**Current%20behavior**%0A%0A**Expected%20behavior**>`_.
If you spotted it first, help us to smash it by providing a detailed and welcomed
`feedback <https://github.com/akretion/odoo-usability/issues/new?body=module:%20base_usability%0Aversion:%2014.0%0A%0A**Steps%20to%20reproduce**%0A-%20...%0A%0A**Current%20behavior**%0A%0A**Expected%20behavior**>`_.
Do not contact contributors directly about support or help with technical issues.
@@ -72,11 +75,12 @@ Contributors
~~~~~~~~~~~~
* Alexis de Lattre <alexis.delattre@akretion.com>
* Raphaël Valyi <rvalyi@akretion.com>
* David Beal <david.beal@akretion.com>
Maintainers
~~~~~~~~~~~
This module is part of the `akretion/odoo-usability <https://github.com/akretion/odoo-usability/tree/12.0/base_usability>`_ project on GitHub.
This module is part of the `akretion/odoo-usability <https://github.com/akretion/odoo-usability/tree/14.0/base_usability>`_ project on GitHub.
You are welcome to contribute.

View File

@@ -6,3 +6,4 @@ from . import res_company
from . import ir_mail_server
from . import ir_actions_report
from . import ir_model
from . import misc

View File

@@ -0,0 +1,36 @@
# Copyright 2016-2025 Akretion France (https://www.akretion.com/)
# @author: Alexis de Lattre <alexis.delattre@akretion.com>
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).
from odoo import models
from odoo.tools import misc, float_compare
class BaseUsabilityInstalled(models.AbstractModel):
_name = "base.usability.installed"
_description = "Base Usability Installed"
formatLang_original = misc.formatLang
def formatLang(
env, value, digits=None, grouping=True,
monetary=False, dp=False, currency_obj=False, int_no_digits=True):
if (
'base.usability.installed' in env and
int_no_digits and
not monetary and
isinstance(value, float) and
dp):
prec = env['decimal.precision'].precision_get(dp)
if not float_compare(value, int(value), precision_digits=prec):
digits = 0
dp = False
res = formatLang_original(
env, value, digits=digits, grouping=grouping,
monetary=monetary, dp=dp, currency_obj=currency_obj)
return res
misc.formatLang = formatLang

View File

@@ -1,20 +1,20 @@
<?xml version="1.0" encoding="utf-8" ?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<meta name="generator" content="Docutils 0.15.1: http://docutils.sourceforge.net/" />
<meta name="generator" content="Docutils: https://docutils.sourceforge.io/" />
<title>Base Usability</title>
<style type="text/css">
/*
:Author: David Goodger (goodger@python.org)
:Id: $Id: html4css1.css 7952 2016-07-26 18:15:59Z milde $
:Id: $Id: html4css1.css 9511 2024-01-13 09:50:07Z milde $
:Copyright: This stylesheet has been placed in the public domain.
Default cascading style sheet for the HTML output of Docutils.
Despite the name, some widely supported CSS2 features are used.
See http://docutils.sf.net/docs/howto/html-stylesheets.html for how to
See https://docutils.sourceforge.io/docs/howto/html-stylesheets.html for how to
customize this style sheet.
*/
@@ -275,7 +275,7 @@ pre.literal-block, pre.doctest-block, pre.math, pre.code {
margin-left: 2em ;
margin-right: 2em }
pre.code .ln { color: grey; } /* line numbers */
pre.code .ln { color: gray; } /* line numbers */
pre.code, code { background-color: #eeeeee }
pre.code .comment, code .comment { color: #5C6576 }
pre.code .keyword, code .keyword { color: #3B0D06; font-weight: bold }
@@ -301,7 +301,7 @@ span.option {
span.pre {
white-space: pre }
span.problematic {
span.problematic, pre.problematic {
color: red }
span.section-subtitle {
@@ -366,8 +366,10 @@ ul.auto-toc {
<!-- !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
!! This file is generated by oca-gen-addon-readme !!
!! changes will be overwritten. !!
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
!! source digest: sha256:34b38099c08b1967a5082dd802765b1b34015403159badf256ee845648d9e6da
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! -->
<p><a class="reference external" 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" 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" href="https://github.com/akretion/odoo-usability/tree/12.0/base_usability"><img alt="akretion/odoo-usability" src="https://img.shields.io/badge/github-akretion%2Fodoo--usability-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/akretion/odoo-usability/tree/14.0/base_usability"><img alt="akretion/odoo-usability" src="https://img.shields.io/badge/github-akretion%2Fodoo--usability-lightgray.png?logo=github" /></a></p>
<p>This module adds the following functions:</p>
<ul class="simple">
<li>Adds <em>track_visibility=onchange</em> on all the important fields of the Partner object</li>
@@ -397,41 +399,42 @@ ul.auto-toc {
<p><strong>Table of contents</strong></p>
<div class="contents local topic" id="contents">
<ul class="simple">
<li><a class="reference internal" href="#bug-tracker" id="id1">Bug Tracker</a></li>
<li><a class="reference internal" href="#credits" id="id2">Credits</a><ul>
<li><a class="reference internal" href="#authors" id="id3">Authors</a></li>
<li><a class="reference internal" href="#contributors" id="id4">Contributors</a></li>
<li><a class="reference internal" href="#maintainers" id="id5">Maintainers</a></li>
<li><a class="reference internal" href="#bug-tracker" id="toc-entry-1">Bug Tracker</a></li>
<li><a class="reference internal" href="#credits" id="toc-entry-2">Credits</a><ul>
<li><a class="reference internal" href="#authors" id="toc-entry-3">Authors</a></li>
<li><a class="reference internal" href="#contributors" id="toc-entry-4">Contributors</a></li>
<li><a class="reference internal" href="#maintainers" id="toc-entry-5">Maintainers</a></li>
</ul>
</li>
</ul>
</div>
<div class="section" id="bug-tracker">
<h1><a class="toc-backref" href="#id1">Bug Tracker</a></h1>
<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/akretion/odoo-usability/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 smashing it by providing a detailed and welcomed
<a class="reference external" href="https://github.com/akretion/odoo-usability/issues/new?body=module:%20base_usability%0Aversion:%2012.0%0A%0A**Steps%20to%20reproduce**%0A-%20...%0A%0A**Current%20behavior**%0A%0A**Expected%20behavior**">feedback</a>.</p>
If you spotted it first, help us to smash it by providing a detailed and welcomed
<a class="reference external" href="https://github.com/akretion/odoo-usability/issues/new?body=module:%20base_usability%0Aversion:%2014.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">
<h1><a class="toc-backref" href="#id2">Credits</a></h1>
<h1><a class="toc-backref" href="#toc-entry-2">Credits</a></h1>
<div class="section" id="authors">
<h2><a class="toc-backref" href="#id3">Authors</a></h2>
<h2><a class="toc-backref" href="#toc-entry-3">Authors</a></h2>
<ul class="simple">
<li>Akretion</li>
</ul>
</div>
<div class="section" id="contributors">
<h2><a class="toc-backref" href="#id4">Contributors</a></h2>
<h2><a class="toc-backref" href="#toc-entry-4">Contributors</a></h2>
<ul class="simple">
<li>Alexis de Lattre &lt;<a class="reference external" href="mailto:alexis.delattre&#64;akretion.com">alexis.delattre&#64;akretion.com</a>&gt;</li>
<li>Raphaël Valyi &lt;<a class="reference external" href="mailto:rvalyi&#64;akretion.com">rvalyi&#64;akretion.com</a>&gt;</li>
<li>David Beal &lt;<a class="reference external" href="mailto:david.beal&#64;akretion.com">david.beal&#64;akretion.com</a>&gt;</li>
</ul>
</div>
<div class="section" id="maintainers">
<h2><a class="toc-backref" href="#id5">Maintainers</a></h2>
<p>This module is part of the <a class="reference external" href="https://github.com/akretion/odoo-usability/tree/12.0/base_usability">akretion/odoo-usability</a> project on GitHub.</p>
<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/akretion/odoo-usability/tree/14.0/base_usability">akretion/odoo-usability</a> project on GitHub.</p>
<p>You are welcome to contribute.</p>
</div>
</div>

View File

@@ -24,6 +24,9 @@
<xpath expr="//div[hasclass('o_address_format')]/field[@name='city']" position="before">
<field name="zip" position="move"/>
</xpath>
<field name="industry_id" position="attributes">
<attribute name="attrs">{'invisible': [('parent_id', '!=', False)]}</attribute>
</field>
</field>
</record>
@@ -60,6 +63,9 @@
<field name="phone" position="after">
<field name="mobile" optional="show" widget="phone" class="o_force_ltr"/>
</field>
<field name="category_id" position="after">
<field name="industry_id" optional="hide"/>
</field>
</field>
</record>
@@ -73,6 +79,9 @@
<!-- for 'ref', change '=' to 'start with' -->
<attribute name="filter_domain">['|','|',('display_name','ilike',self),('ref','=ilike',self + '%'),('email','ilike',self)]</attribute>
</field>
<filter name="group_country" position="after">
<filter name="industry_groupby" string="Industry" context="{'group_by': 'industry_id'}"/>
</filter>
</field>
</record>

View File

@@ -0,0 +1,3 @@
from . import models
from . import wizards
from . import reports

View File

@@ -0,0 +1,47 @@
# Copyright 2019-2025 Akretion France (http://www.akretion.com)
# @author Alexis de Lattre <alexis.delattre@akretion.com>
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).
{
'name': 'Commission Simple',
'version': '14.0.1.0.0',
'category': 'Sales',
'license': 'AGPL-3',
'summary': 'Compute commissions for salesman',
'description': """
Commission Simple
=================
This module is a **simple** module to compute commission for salesman. From my experience, companies often use very specific methods to compute commissions and it's impossible to develop a module that can support all of them. So the goal of this module is just to have a simple base to build the company-specific commissionning system by inheriting this simple module.
Here is a short description of this module:
* create commission profiles using rules (per product category, per product, per product and customer, etc.),
* the commission rules can have a start and end date (optional),
* commissionning can happen on invoicing or on payment,
* each invoice line can only be commissionned to one salesman,
* commission reports are stored in Odoo.
This module has been written by Alexis de Lattre from Akretion
<alexis.delattre@akretion.com>.
""",
'author': 'Akretion',
'website': 'https://github.com/akretion/odoo-usability',
'depends': [
'account',
'date_range',
'report_xlsx',
],
'data': [
'security/ir.model.access.csv',
'security/rule.xml',
'reports/report.xml',
'data/decimal_precision.xml',
'views/commission_profile.xml',
'views/commission_rule.xml',
'views/commission_result.xml',
'views/account_move_line.xml',
'wizards/commission_compute_view.xml',
],
'installable': True,
}

View File

@@ -0,0 +1,11 @@
<?xml version="1.0" encoding="utf-8"?>
<odoo noupdate="1">
<record forcecreate="True" id="commission_rate" model="decimal.precision">
<field name="name">Commission Rate</field>
<field name="digits">2</field>
</record>
</odoo>

View File

@@ -0,0 +1,819 @@
# Translation of Odoo Server.
# This file contains the translation of the following modules:
# * commission_simple
#
msgid ""
msgstr ""
"Project-Id-Version: Odoo Server 14.0\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2025-10-17 20:36+0000\n"
"PO-Revision-Date: 2025-10-17 20:36+0000\n"
"Last-Translator: Alexis de Lattre <alexis.delattre@akretion.com>\n"
"Language-Team: \n"
"Language: fr\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: \n"
"Plural-Forms: \n"
#. module: commission_simple
#: code:addons/commission_simple/wizards/commission_compute.py:0
#, python-format
msgid ""
"%(count)s commissions already exist(s) with start date %(date_start)s in "
"company %(company)s."
msgstr ""
"%(count)s il existe déjà des commissions avec la date de début "
"%(date_start)s dans la société %(company)s."
#. module: commission_simple
#: model:ir.model.constraint,message:commission_simple.constraint_commission_result_salesman_period_company_unique
msgid ""
"A commission result already exists for this salesman/agent for the same "
"period."
msgstr ""
"Un état des commissions existe déjà pour ce vendeur/agent pour la même "
"période."
#. module: commission_simple
#: code:addons/commission_simple/models/commission_profile.py:0
#, python-format
msgid "A salesman must be selected when the assignment type is 'Salesman'."
msgstr ""
"Un vendeur doit être sélectionné lorsque le type d'affectation est "
"\"Vendeur\"."
#. module: commission_simple
#: code:addons/commission_simple/models/commission_rule.py:0
#, python-format
msgid "AND"
msgstr "ET"
#. module: commission_simple
#: model:ir.model.fields,field_description:commission_simple.field_commission_result__message_needaction
msgid "Action Needed"
msgstr "Action requise"
#. module: commission_simple
#: model:ir.model.fields,field_description:commission_simple.field_commission_profile__active
#: model:ir.model.fields,field_description:commission_simple.field_commission_rule__active
msgid "Active"
msgstr "Actif"
#. module: commission_simple
#: model:ir.model.fields,field_description:commission_simple.field_commission_result__activity_ids
msgid "Activities"
msgstr "Activités"
#. module: commission_simple
#: model:ir.model.fields,field_description:commission_simple.field_commission_result__activity_exception_decoration
msgid "Activity Exception Decoration"
msgstr "Style d'affichage de l'activité-alerte"
#. module: commission_simple
#: model:ir.model.fields,field_description:commission_simple.field_commission_result__activity_state
msgid "Activity State"
msgstr "État de l'activité"
#. module: commission_simple
#: model:ir.model.fields,field_description:commission_simple.field_commission_result__activity_type_icon
msgid "Activity Type Icon"
msgstr "Îcone du type d'activité"
#. module: commission_simple
#: code:addons/commission_simple/reports/commission_result_xlsx.py:0
#, python-format
msgid "Amount Total"
msgstr "Montant Total"
#. module: commission_simple
#: model:ir.model.fields,field_description:commission_simple.field_commission_rule__applied_on
msgid "Apply On"
msgstr "Conditions"
#. module: commission_simple
#: model_terms:ir.ui.view,arch_db:commission_simple.commission_profile_form
#: model_terms:ir.ui.view,arch_db:commission_simple.commission_profile_search
#: model_terms:ir.ui.view,arch_db:commission_simple.commission_rule_search
msgid "Archived"
msgstr "Archivé"
#. module: commission_simple
#: model_terms:ir.ui.view,arch_db:commission_simple.commission_result_form
msgid "Are you sure you want to go back to draft?"
msgstr "Êtes-vous sûr de vouloir revenir à l'état brouillon ?"
#. module: commission_simple
#: model:ir.model.fields,field_description:commission_simple.field_commission_result__assign_type
#: model_terms:ir.ui.view,arch_db:commission_simple.commission_result_search
msgid "Assign Type"
msgstr "Type d'affectation"
#. module: commission_simple
#: model:ir.model.fields,field_description:commission_simple.field_commission_profile__assign_ids
#: model_terms:ir.ui.view,arch_db:commission_simple.commission_profile_form
msgid "Assignments"
msgstr "Assignations"
#. module: commission_simple
#: model:ir.model.fields,field_description:commission_simple.field_commission_result__message_attachment_count
msgid "Attachment Count"
msgstr "Nombre de pièces jointes"
#. module: commission_simple
#: model_terms:ir.ui.view,arch_db:commission_simple.commission_result_form
msgid "Back to Draft"
msgstr "Remettre en brouillon"
#. module: commission_simple
#: code:addons/commission_simple/reports/commission_result_xlsx.py:0
#, python-format
msgid "Base Total"
msgstr "Total Base"
#. module: commission_simple
#: model_terms:ir.ui.view,arch_db:commission_simple.commission_compute_form
msgid "Cancel"
msgstr "Annuler"
#. module: commission_simple
#: model_terms:ir.ui.view,arch_db:commission_simple.view_move_line_form
msgid "Commission"
msgstr "Commission"
#. module: commission_simple
#: code:addons/commission_simple/reports/commission_result_xlsx.py:0
#: model:ir.model.fields,field_description:commission_simple.field_account_invoice_report__commission_amount
#: model:ir.model.fields,field_description:commission_simple.field_account_move_line__commission_amount
#, python-format
msgid "Commission Amount"
msgstr "Montant de la commission"
#. module: commission_simple
#: code:addons/commission_simple/reports/commission_result_xlsx.py:0
#: model:ir.model.fields,field_description:commission_simple.field_account_move_line__commission_base
#: model:ir.model.fields,field_description:commission_simple.field_commission_rule__base
#, python-format
msgid "Commission Base"
msgstr "Base de la commission"
#. module: commission_simple
#: model:ir.model.fields,field_description:commission_simple.field_commission_result__base_total
msgid "Commission Base Total"
msgstr "Total base des commissions"
#. module: commission_simple
#: model:ir.model.fields,field_description:commission_simple.field_commission_result__line_ids
#: model_terms:ir.ui.view,arch_db:commission_simple.commission_result_form
msgid "Commission Lines"
msgstr "Lignes de commission"
#. module: commission_simple
#: model:ir.model.fields,field_description:commission_simple.field_commission_profile__date_range_type_id
#: model_terms:ir.ui.view,arch_db:commission_simple.commission_profile_search
msgid "Commission Periodicity"
msgstr "Périodicité des commissions"
#. module: commission_simple
#: model:ir.model,name:commission_simple.model_commission_profile
#: model:ir.model.fields,field_description:commission_simple.field_commission_result__profile_id
msgid "Commission Profile"
msgstr "Profil de commission"
#. module: commission_simple
#: model:ir.model,name:commission_simple.model_commission_profile_assignment
msgid "Commission Profile Assignment"
msgstr "Affectation des profils de commission"
#. module: commission_simple
#: model:ir.actions.act_window,name:commission_simple.commission_profile_action
#: model:ir.ui.menu,name:commission_simple.commission_profile_menu
msgid "Commission Profiles"
msgstr "Profils de commission"
#. module: commission_simple
#: code:addons/commission_simple/reports/commission_result_xlsx.py:0
#: model:ir.model.fields,field_description:commission_simple.field_account_move_line__commission_rate
#: model:ir.model.fields,field_description:commission_simple.field_commission_rule__rate
#, python-format
msgid "Commission Rate"
msgstr "Taux de commission"
#. module: commission_simple
#: model:ir.model,name:commission_simple.model_commission_result
#: model:ir.model.fields,field_description:commission_simple.field_account_move_line__commission_result_id
msgid "Commission Result"
msgstr "État des commissions"
#. module: commission_simple
#: model:ir.model,name:commission_simple.model_report_commission_simple_report_xlsx
msgid "Commission Result XLSX"
msgstr "État des commission XLSX"
#. module: commission_simple
#: model:ir.model,name:commission_simple.model_commission_rule
msgid "Commission Rule"
msgstr "Règle de commission"
#. module: commission_simple
#: model:ir.actions.act_window,name:commission_simple.commission_rule_action
#: model:ir.model.fields,field_description:commission_simple.field_commission_profile__rule_ids
#: model:ir.ui.menu,name:commission_simple.commission_rule_menu
msgid "Commission Rules"
msgstr "Règles de commission"
#. module: commission_simple
#: model:ir.model.fields,field_description:commission_simple.field_commission_result__amount_total
msgid "Commission Total"
msgstr "Total des commissions"
#. module: commission_simple
#: model:ir.actions.act_window,name:commission_simple.commission_result_action
#: model:ir.ui.menu,name:commission_simple.commission_config_root
#: model:ir.ui.menu,name:commission_simple.commission_result_menu
#: model:ir.ui.menu,name:commission_simple.commission_root
msgid "Commissions"
msgstr "Commissions"
#. module: commission_simple
#: code:addons/commission_simple/reports/commission_result_xlsx.py:0
#, python-format
msgid "Commissions of %(partner)s for period %(period)s"
msgstr "Commissions de %(partner)s pour la période %(period)s"
#. module: commission_simple
#: model:ir.model.fields,field_description:commission_simple.field_commission_compute__company_id
#: model:ir.model.fields,field_description:commission_simple.field_commission_profile__company_id
#: model:ir.model.fields,field_description:commission_simple.field_commission_profile_assignment__company_id
#: model:ir.model.fields,field_description:commission_simple.field_commission_result__company_id
#: model:ir.model.fields,field_description:commission_simple.field_commission_rule__company_id
msgid "Company"
msgstr "Société"
#. module: commission_simple
#: model:ir.model.fields,field_description:commission_simple.field_commission_result__company_currency_id
msgid "Company Currency"
msgstr "Devise de la société"
#. module: commission_simple
#: model_terms:ir.ui.view,arch_db:commission_simple.commission_compute_form
#: model_terms:ir.ui.view,arch_db:commission_simple.commission_rule_form
msgid "Compute"
msgstr "Calculer"
#. module: commission_simple
#: model:ir.actions.act_window,name:commission_simple.commission_compute_action
#: model:ir.model,name:commission_simple.model_commission_compute
#: model:ir.ui.menu,name:commission_simple.commission_compute_menu
msgid "Compute Commissions"
msgstr "Calculer les commissions"
#. module: commission_simple
#: model_terms:ir.ui.view,arch_db:commission_simple.commission_result_form
msgid "Confirm"
msgstr "Confirmer"
#. module: commission_simple
#: model:ir.model.fields,field_description:commission_simple.field_commission_compute__create_uid
#: model:ir.model.fields,field_description:commission_simple.field_commission_profile__create_uid
#: model:ir.model.fields,field_description:commission_simple.field_commission_profile_assignment__create_uid
#: model:ir.model.fields,field_description:commission_simple.field_commission_result__create_uid
#: model:ir.model.fields,field_description:commission_simple.field_commission_rule__create_uid
msgid "Created by"
msgstr "Créé par"
#. module: commission_simple
#: model:ir.model.fields,field_description:commission_simple.field_commission_compute__create_date
#: model:ir.model.fields,field_description:commission_simple.field_commission_profile__create_date
#: model:ir.model.fields,field_description:commission_simple.field_commission_profile_assignment__create_date
#: model:ir.model.fields,field_description:commission_simple.field_commission_result__create_date
#: model:ir.model.fields,field_description:commission_simple.field_commission_rule__create_date
msgid "Created on"
msgstr "Créé le"
#. module: commission_simple
#: code:addons/commission_simple/reports/commission_result_xlsx.py:0
#, python-format
msgid "Currency"
msgstr "Devise"
#. module: commission_simple
#: code:addons/commission_simple/reports/commission_result_xlsx.py:0
#, python-format
msgid "Customer"
msgstr "Client"
#. module: commission_simple
#: model:ir.model.fields,field_description:commission_simple.field_commission_rule__partner_ids
msgid "Customers"
msgstr "Clients"
#. module: commission_simple
#: code:addons/commission_simple/models/commission_rule.py:0
#, python-format
msgid "Customers:"
msgstr "Clients :"
#. module: commission_simple
#: model_terms:ir.ui.view,arch_db:commission_simple.commission_result_form
msgid "Disc.%"
msgstr "Rem.%"
#. module: commission_simple
#: model:ir.model.fields,field_description:commission_simple.field_account_invoice_report__display_name
#: model:ir.model.fields,field_description:commission_simple.field_account_move_line__display_name
#: model:ir.model.fields,field_description:commission_simple.field_commission_compute__display_name
#: model:ir.model.fields,field_description:commission_simple.field_commission_profile__display_name
#: model:ir.model.fields,field_description:commission_simple.field_commission_profile_assignment__display_name
#: model:ir.model.fields,field_description:commission_simple.field_commission_result__display_name
#: model:ir.model.fields,field_description:commission_simple.field_commission_rule__display_name
#: model:ir.model.fields,field_description:commission_simple.field_report_commission_simple_report_xlsx__display_name
msgid "Display Name"
msgstr "Nom affiché"
#. module: commission_simple
#: model:ir.model.fields.selection,name:commission_simple.selection__commission_result__state__done
#: model_terms:ir.ui.view,arch_db:commission_simple.commission_result_search
msgid "Done"
msgstr "Terminé"
#. module: commission_simple
#: model:ir.model.fields.selection,name:commission_simple.selection__commission_result__state__draft
#: model_terms:ir.ui.view,arch_db:commission_simple.commission_result_search
msgid "Draft"
msgstr "Brouillon"
#. module: commission_simple
#: model:ir.actions.report,name:commission_simple.commission_result_xlsx_report
msgid "Détails Excel"
msgstr "Détails Excel"
#. module: commission_simple
#: code:addons/commission_simple/reports/commission_result_xlsx.py:0
#: model:ir.model.fields,field_description:commission_simple.field_commission_rule__date_end
#, python-format
msgid "End Date"
msgstr "Date de fin"
#. module: commission_simple
#: model:ir.model.fields,field_description:commission_simple.field_commission_result__date_end
msgid "End date"
msgstr "Date de fin"
#. module: commission_simple
#: model_terms:ir.ui.view,arch_db:commission_simple.commission_result_form
msgid "Excel Export"
msgstr "Export Excel"
#. module: commission_simple
#: model:ir.model.fields,field_description:commission_simple.field_commission_result__message_follower_ids
msgid "Followers"
msgstr "Abonnés"
#. module: commission_simple
#: model:ir.model.fields,field_description:commission_simple.field_commission_result__message_channel_ids
msgid "Followers (Channels)"
msgstr "Suiveurs (chaînes)"
#. module: commission_simple
#: model:ir.model.fields,field_description:commission_simple.field_commission_result__message_partner_ids
msgid "Followers (Partners)"
msgstr "Abonnés (partenaires)"
#. module: commission_simple
#: model:ir.model.fields,help:commission_simple.field_commission_result__activity_type_icon
msgid "Font awesome icon e.g. fa-tasks"
msgstr "Îcone font-awesome, par exemple fa-task"
#. module: commission_simple
#: code:addons/commission_simple/reports/commission_result_xlsx.py:0
#, python-format
msgid "Generated from Odoo on %s by %s"
msgstr "Généré à partir d'Odoo le %s par %s"
#. module: commission_simple
#: code:addons/commission_simple/models/commission_rule.py:0
#: model:ir.model.fields.selection,name:commission_simple.selection__commission_rule__applied_on__4_global
#, python-format
msgid "Global"
msgstr "Global"
#. module: commission_simple
#: model:ir.model.fields,field_description:commission_simple.field_account_invoice_report__id
#: model:ir.model.fields,field_description:commission_simple.field_account_move_line__id
#: model:ir.model.fields,field_description:commission_simple.field_commission_compute__id
#: model:ir.model.fields,field_description:commission_simple.field_commission_profile__id
#: model:ir.model.fields,field_description:commission_simple.field_commission_profile_assignment__id
#: model:ir.model.fields,field_description:commission_simple.field_commission_result__id
#: model:ir.model.fields,field_description:commission_simple.field_commission_rule__id
#: model:ir.model.fields,field_description:commission_simple.field_report_commission_simple_report_xlsx__id
msgid "ID"
msgstr "ID"
#. module: commission_simple
#: model:ir.model.fields,field_description:commission_simple.field_commission_result__activity_exception_icon
msgid "Icon"
msgstr "Îcone"
#. module: commission_simple
#: model:ir.model.fields,help:commission_simple.field_commission_result__activity_exception_icon
msgid "Icon to indicate an exception activity."
msgstr "Îcone pour indiquer une activité-alerte"
#. module: commission_simple
#: model:ir.model.fields,help:commission_simple.field_commission_result__message_needaction
#: model:ir.model.fields,help:commission_simple.field_commission_result__message_unread
msgid "If checked, new messages require your attention."
msgstr "Si activé, de nouveaux messages nécessitent votre attention."
#. module: commission_simple
#: model:ir.model.fields,help:commission_simple.field_commission_result__message_has_error
msgid "If checked, some messages have a delivery error."
msgstr "Si activé, des messages ont une erreur d'envoi."
#. module: commission_simple
#: model:ir.model.fields.selection,name:commission_simple.selection__commission_profile__trigger_type__in_payment
#: model_terms:ir.ui.view,arch_db:commission_simple.commission_profile_search
msgid "In Payment and Paid"
msgstr "En paiement et payé"
#. module: commission_simple
#: code:addons/commission_simple/reports/commission_result_xlsx.py:0
#, python-format
msgid "Invoice"
msgstr "Facture"
#. module: commission_simple
#: code:addons/commission_simple/reports/commission_result_xlsx.py:0
#, python-format
msgid "Invoice Date"
msgstr "Date de facture"
#. module: commission_simple
#: model:ir.model.fields.selection,name:commission_simple.selection__commission_profile__trigger_type__invoice
#: model_terms:ir.ui.view,arch_db:commission_simple.commission_profile_search
msgid "Invoiced"
msgstr "Facturé"
#. module: commission_simple
#: model:ir.model.fields.selection,name:commission_simple.selection__commission_rule__base__invoiced
#: model_terms:ir.ui.view,arch_db:commission_simple.commission_result_form
msgid "Invoiced Amount"
msgstr "Montant facturé"
#. module: commission_simple
#: model:ir.model,name:commission_simple.model_account_invoice_report
msgid "Invoices Statistics"
msgstr "Statistiques des factures"
#. module: commission_simple
#: model:ir.model.fields,field_description:commission_simple.field_commission_result__message_is_follower
msgid "Is Follower"
msgstr "Est abonné"
#. module: commission_simple
#: model:ir.model,name:commission_simple.model_account_move_line
msgid "Journal Item"
msgstr "Écriture comptable"
#. module: commission_simple
#: model:ir.model.fields,field_description:commission_simple.field_account_invoice_report____last_update
#: model:ir.model.fields,field_description:commission_simple.field_account_move_line____last_update
#: model:ir.model.fields,field_description:commission_simple.field_commission_compute____last_update
#: model:ir.model.fields,field_description:commission_simple.field_commission_profile____last_update
#: model:ir.model.fields,field_description:commission_simple.field_commission_profile_assignment____last_update
#: model:ir.model.fields,field_description:commission_simple.field_commission_result____last_update
#: model:ir.model.fields,field_description:commission_simple.field_commission_rule____last_update
#: model:ir.model.fields,field_description:commission_simple.field_report_commission_simple_report_xlsx____last_update
msgid "Last Modified on"
msgstr "Dernière modification le"
#. module: commission_simple
#: model:ir.model.fields,field_description:commission_simple.field_commission_compute__write_uid
#: model:ir.model.fields,field_description:commission_simple.field_commission_profile__write_uid
#: model:ir.model.fields,field_description:commission_simple.field_commission_profile_assignment__write_uid
#: model:ir.model.fields,field_description:commission_simple.field_commission_result__write_uid
#: model:ir.model.fields,field_description:commission_simple.field_commission_rule__write_uid
msgid "Last Updated by"
msgstr "Dernière mise à jour par"
#. module: commission_simple
#: model:ir.model.fields,field_description:commission_simple.field_commission_compute__write_date
#: model:ir.model.fields,field_description:commission_simple.field_commission_profile__write_date
#: model:ir.model.fields,field_description:commission_simple.field_commission_profile_assignment__write_date
#: model:ir.model.fields,field_description:commission_simple.field_commission_result__write_date
#: model:ir.model.fields,field_description:commission_simple.field_commission_rule__write_date
msgid "Last Updated on"
msgstr "Dernière mise à jour le"
#. module: commission_simple
#: model:ir.model.fields,field_description:commission_simple.field_commission_result__message_main_attachment_id
msgid "Main Attachment"
msgstr "Pièce jointe principale"
#. module: commission_simple
#: model:ir.model.fields.selection,name:commission_simple.selection__commission_rule__base__margin
msgid "Margin"
msgstr "Marge"
#. module: commission_simple
#: model_terms:ir.ui.view,arch_db:commission_simple.commission_rule_form
msgid "Match"
msgstr "Correspondance"
#. module: commission_simple
#: model:ir.model.fields,field_description:commission_simple.field_commission_rule__apply_description
msgid "Match Criteria"
msgstr "Critères de correspondance"
#. module: commission_simple
#: model:ir.model.fields,field_description:commission_simple.field_account_move_line__commission_rule_id
msgid "Matched Commission Rule"
msgstr "Règle de commission associée"
#. module: commission_simple
#: model:ir.model.fields,field_description:commission_simple.field_commission_result__message_has_error
msgid "Message Delivery error"
msgstr "Erreur d'envoi du message"
#. module: commission_simple
#: model:ir.model.fields,field_description:commission_simple.field_commission_result__message_ids
msgid "Messages"
msgstr "Messages"
#. module: commission_simple
#: code:addons/commission_simple/wizards/commission_compute.py:0
#, python-format
msgid "Missing Period Start Date."
msgstr "Date de début de la période manquante."
#. module: commission_simple
#: code:addons/commission_simple/wizards/commission_compute.py:0
#, python-format
msgid "Missing commission periodicity on commission profile '%s'."
msgstr ""
"Périodicité des commissions manquante sur le profil de commission '%s'."
#. module: commission_simple
#: model:ir.model.fields,field_description:commission_simple.field_commission_result__my_activity_date_deadline
msgid "My Activity Deadline"
msgstr "Date butoir de l'activité"
#. module: commission_simple
#: model:ir.model.fields,field_description:commission_simple.field_commission_profile__name
msgid "Name of the Profile"
msgstr "Nom du profil"
#. module: commission_simple
#: model:ir.model.fields,field_description:commission_simple.field_commission_result__activity_date_deadline
msgid "Next Activity Deadline"
msgstr "Date butoir de l'activité suivante"
#. module: commission_simple
#: model:ir.model.fields,field_description:commission_simple.field_commission_result__activity_summary
msgid "Next Activity Summary"
msgstr "Résumé de l'activité suivante"
#. module: commission_simple
#: model:ir.model.fields,field_description:commission_simple.field_commission_result__activity_type_id
msgid "Next Activity Type"
msgstr "Type de l'activité suivante"
#. module: commission_simple
#: code:addons/commission_simple/wizards/commission_compute.py:0
#, python-format
msgid "No commissions generated."
msgstr "Aucune commission n'a été générée."
#. module: commission_simple
#: model:ir.model.fields,field_description:commission_simple.field_commission_result__message_needaction_counter
msgid "Number of Actions"
msgstr "Nombre d'actions"
#. module: commission_simple
#: model:ir.model.fields,field_description:commission_simple.field_commission_result__message_has_error_counter
msgid "Number of errors"
msgstr "Nombre d'erreurs"
#. module: commission_simple
#: model:ir.model.fields,help:commission_simple.field_commission_result__message_needaction_counter
msgid "Number of messages which requires an action"
msgstr "Nombre de messages nécessitant une action"
#. module: commission_simple
#: model:ir.model.fields,help:commission_simple.field_commission_result__message_has_error_counter
msgid "Number of messages with delivery error"
msgstr "Nombre de messages en échec d'envoi"
#. module: commission_simple
#: model:ir.model.fields,help:commission_simple.field_commission_result__message_unread_counter
msgid "Number of unread messages"
msgstr "Nombre de messages non lus"
#. module: commission_simple
#: model:ir.model.fields.selection,name:commission_simple.selection__commission_profile__trigger_type__paid
#: model_terms:ir.ui.view,arch_db:commission_simple.commission_profile_search
msgid "Paid"
msgstr "Payé"
#. module: commission_simple
#: model:ir.model.fields,field_description:commission_simple.field_commission_result__date_range_id
#: model_terms:ir.ui.view,arch_db:commission_simple.commission_result_search
msgid "Period"
msgstr "Période"
#. module: commission_simple
#: model:ir.model.fields,field_description:commission_simple.field_commission_compute__date_start
msgid "Period Start Date"
msgstr "Date de début des périodes"
#. module: commission_simple
#: model_terms:ir.ui.view,arch_db:commission_simple.commission_result_form
msgid "Price"
msgstr "Prix"
#. module: commission_simple
#: code:addons/commission_simple/reports/commission_result_xlsx.py:0
#, python-format
msgid "Product"
msgstr "Produit"
#. module: commission_simple
#: model:ir.model.fields,field_description:commission_simple.field_commission_rule__product_categ_ids
#: model:ir.model.fields.selection,name:commission_simple.selection__commission_rule__applied_on__3_product_category
msgid "Product Categories"
msgstr "Catégories de produits"
#. module: commission_simple
#: model:ir.model.fields.selection,name:commission_simple.selection__commission_rule__applied_on__1_customer_product_category
msgid "Product Categories and Customers"
msgstr "Catégories de produits et clients"
#. module: commission_simple
#: code:addons/commission_simple/models/commission_rule.py:0
#, python-format
msgid "Product Categories:"
msgstr "Catégories de produits :"
#. module: commission_simple
#: model:ir.model.fields,field_description:commission_simple.field_account_move_line__product_categ_id
msgid "Product Category"
msgstr "Catégorie de produit"
#. module: commission_simple
#: model:ir.model.fields,field_description:commission_simple.field_commission_rule__product_ids
#: model:ir.model.fields.selection,name:commission_simple.selection__commission_rule__applied_on__2_product
msgid "Products"
msgstr "Produits"
#. module: commission_simple
#: model:ir.model.fields.selection,name:commission_simple.selection__commission_rule__applied_on__0_customer_product
msgid "Products and Customers"
msgstr "Produits et clients"
#. module: commission_simple
#: code:addons/commission_simple/models/commission_rule.py:0
#, python-format
msgid "Products:"
msgstr "Produits :"
#. module: commission_simple
#: model:ir.model.fields,field_description:commission_simple.field_commission_profile_assignment__profile_id
#: model:ir.model.fields,field_description:commission_simple.field_commission_rule__profile_id
#: model_terms:ir.ui.view,arch_db:commission_simple.commission_rule_search
msgid "Profile"
msgstr "Profil"
#. module: commission_simple
#: code:addons/commission_simple/reports/commission_result_xlsx.py:0
#, python-format
msgid "Quantity"
msgstr "Quantité"
#. module: commission_simple
#: model_terms:ir.ui.view,arch_db:commission_simple.commission_result_form
#: model_terms:ir.ui.view,arch_db:commission_simple.commission_rule_tree
msgid "Rate (%)"
msgstr "Taux (%)"
#. module: commission_simple
#: model:ir.model.constraint,message:commission_simple.constraint_commission_rule_rate_positive
msgid "Rate must be positive !"
msgstr "Le taux doit être positif !"
#. module: commission_simple
#: model:ir.model.fields,field_description:commission_simple.field_commission_result__activity_user_id
msgid "Responsible User"
msgstr "Utilisateur responsable"
#. module: commission_simple
#: model_terms:ir.ui.view,arch_db:commission_simple.commission_profile_form
msgid "Rules"
msgstr "Règles"
#. module: commission_simple
#: code:addons/commission_simple/models/commission_profile.py:0
#: model:ir.model.fields,field_description:commission_simple.field_commission_profile_assignment__user_id
#: model_terms:ir.ui.view,arch_db:commission_simple.commission_result_search
#, python-format
msgid "Salesman"
msgstr "Vendeur"
#. module: commission_simple
#: model:ir.model.fields,field_description:commission_simple.field_commission_result__partner_id
msgid "Salesman/Agent"
msgstr "Vendeur/Agent"
#. module: commission_simple
#: model:ir.model.fields,help:commission_simple.field_account_move_line__product_categ_id
msgid "Select category for the current product"
msgstr "Sélectionnez la catégorie du produit"
#. module: commission_simple
#: model:ir.model.fields,field_description:commission_simple.field_commission_profile__sequence
msgid "Sequence"
msgstr "Séquence"
#. module: commission_simple
#: code:addons/commission_simple/reports/commission_result_xlsx.py:0
#: model:ir.model.fields,field_description:commission_simple.field_commission_rule__date_start
#, python-format
msgid "Start Date"
msgstr "Date de début"
#. module: commission_simple
#: model:ir.model.fields,field_description:commission_simple.field_commission_result__date_start
msgid "Start date"
msgstr "Date de début"
#. module: commission_simple
#: model:ir.model.fields,field_description:commission_simple.field_commission_result__state
msgid "State"
msgstr "État"
#. module: commission_simple
#: model:ir.model.fields,help:commission_simple.field_commission_result__activity_state
msgid ""
"Status based on activities\n"
"Overdue: Due date is already passed\n"
"Today: Activity date is today\n"
"Planned: Future activities."
msgstr ""
"Statut basé sur les activités\n"
"En retard : La date d'échéance est déjà dépassée\n"
"Aujourd'hui : La date de l'activité est aujourd'hui\n"
"Planifié : Activités futures."
#. module: commission_simple
#: model:ir.model.constraint,message:commission_simple.constraint_commission_profile_assignment_company_user_uniq
msgid "This salesman already has an assignment in this company."
msgstr "Ce vendeur a déjà une assignation dans cette société."
#. module: commission_simple
#: model:ir.model.fields,field_description:commission_simple.field_commission_profile__trigger_type
msgid "Trigger"
msgstr "Déclencheur"
#. module: commission_simple
#: model:ir.model.fields,field_description:commission_simple.field_commission_profile_assignment__assign_type
msgid "Type"
msgstr "Type"
#. module: commission_simple
#: model:ir.model.fields,help:commission_simple.field_commission_result__activity_exception_decoration
msgid "Type of the exception activity on record."
msgstr "Type de l'activité-alerte sur l'enregistrement."
#. module: commission_simple
#: code:addons/commission_simple/reports/commission_result_xlsx.py:0
#, python-format
msgid "Unit"
msgstr "Unité"
#. module: commission_simple
#: model:ir.model.fields,field_description:commission_simple.field_commission_result__message_unread
msgid "Unread Messages"
msgstr "Messages non lus"
#. module: commission_simple
#: model:ir.model.fields,field_description:commission_simple.field_commission_result__message_unread_counter
msgid "Unread Messages Counter"
msgstr "Compteur de messages non lus"
#. module: commission_simple
#: model:ir.model.fields,field_description:commission_simple.field_commission_result__website_message_ids
msgid "Website Messages"
msgstr "Messages du site Web"
#. module: commission_simple
#: model:ir.model.fields,help:commission_simple.field_commission_result__website_message_ids
msgid "Website communication history"
msgstr "Historique des échanges sur le site Web"
#. module: commission_simple
#: code:addons/commission_simple/models/commission_result.py:0
#, python-format
msgid "You cannot delete commission result %s because it is in done state."
msgstr ""
"Vous ne pouvez pas supprimer l'état de commission %s parce qu'il est à "
"l'état \"terminé\"."

View File

@@ -0,0 +1,5 @@
from . import commission_profile
from . import commission_rule
from . import commission_result
from . import account_move_line
from . import account_invoice_report

View File

@@ -0,0 +1,17 @@
# Copyright 2018-2019 Akretion France (http://www.akretion.com)
# @author Alexis de Lattre <alexis.delattre@akretion.com>
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).
from odoo import api, fields, models
class AccountInvoiceReport(models.Model):
_inherit = 'account.invoice.report'
commission_amount = fields.Float(readonly=True)
@api.model
def _select(self):
select_str = super()._select()
select_str += ", line.commission_amount * currency_table.rate AS commission_amount"
return select_str

View File

@@ -0,0 +1,105 @@
# Copyright 2019-2024 Akretion France (http://www.akretion.com/)
# @author Alexis de Lattre <alexis.delattre@akretion.com>
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).
from odoo import api, fields, models
from odoo.tools import float_is_zero
class AccountMoveLine(models.Model):
_inherit = 'account.move.line'
commission_result_id = fields.Many2one(
'commission.result', string='Commission Result', check_company=True, index=True)
commission_rule_id = fields.Many2one(
'commission.rule', 'Matched Commission Rule', ondelete='restrict', check_company=True)
commission_base = fields.Monetary('Commission Base', currency_field='company_currency_id')
commission_rate = fields.Float('Commission Rate', digits='Commission Rate')
commission_amount = fields.Monetary(
string='Commission Amount', currency_field='company_currency_id',
readonly=True, compute='_compute_commission_amount', store=True)
# to display on commission line
product_categ_id = fields.Many2one(
related='product_id.product_tmpl_id.categ_id')
@api.depends('commission_rate', 'commission_base')
def _compute_commission_amount(self):
for line in self:
commission_amount = False
if not line.display_type:
commission_amount = line.company_currency_id.round(
line.commission_rate * line.commission_base / 100.0)
line.commission_amount = commission_amount
def _match_commission_rule(self, rules):
# commission rules are already in the right order
self.ensure_one()
for rule in rules:
if rule['date_start'] and rule['date_start'] > self.date:
continue
if rule['date_end'] and rule['date_end'] < self.date:
continue
if rule['applied_on'] == '0_customer_product':
if (
self.partner_id.id in
rule['partner_ids'] and
self.product_id.id in rule['product_ids']):
return rule
elif rule['applied_on'] == '1_customer_product_category':
if (
self.partner_id.id in
rule['partner_ids'] and
self.product_categ_id.id in rule['product_categ_ids']):
return rule
elif rule['applied_on'] == '2_product':
if self.product_id.id in rule['product_ids']:
return rule
elif rule['applied_on'] == '3_product_category':
if self.product_categ_id.id in rule['product_categ_ids']:
return rule
elif rule['applied_on'] == '4_global':
return rule
return False
def _prepare_commission_data(self, rule):
self.ensure_one()
rate_prec = self.env['decimal.precision'].precision_get('Commission Rate')
lvals = {
'commission_rule_id': rule['id'],
# company currency
# inherit this method to change the value below if you want to base on margin
# or something else
'commission_rate': rule['rate'],
}
if rule['base'] == 'margin':
# What do we do if it's negative ? For the moment, it adds a negative commission line
cost = 0
if self.product_id and self.product_uom_id:
# if the module account_invoice_margin from akretion/odoo-usability is installed
if hasattr(self, 'margin_company_currency'):
cost = self.margin_company_currency
else:
sign = self.move_id.move_type == 'out_refund' and -1 or 1
cost = self.product_id.standard_price * self.product_uom_id._compute_quantity(self.quantity, self.product_id.uom_id) * sign
lvals['commission_base'] = self.balance * -1 - cost
else:
lvals['commission_base'] = self.balance * -1
if float_is_zero(lvals['commission_rate'], precision_digits=rate_prec) or self.company_currency_id.is_zero(lvals['commission_base']):
return False
return lvals
def _prepare_commission_xlsx(self):
self.ensure_one()
vals = {
"inv.name": self.move_id.name,
"inv.date": self.move_id.invoice_date,
"inv.partner": self.move_id.commercial_partner_id.display_name,
"product": self.product_id and self.product_id.display_name or self.name,
"qty": self.quantity,
"uom": self.product_uom_id.name,
"commission_base": self.commission_base,
"commission_rate": self.commission_rate / 100,
"commission_amount": self.commission_amount,
}
return vals

View File

@@ -0,0 +1,130 @@
# Copyright Akretion France (http://www.akretion.com/)
# @author Alexis de Lattre <alexis.delattre@akretion.com>
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).
from odoo import fields, models, api, _
from odoo.exceptions import ValidationError
class CommissionProfile(models.Model):
_name = 'commission.profile'
_description = 'Commission Profile'
_order = 'sequence, id'
name = fields.Char(string='Name of the Profile', required=True)
active = fields.Boolean(string='Active', default=True)
sequence = fields.Integer()
company_id = fields.Many2one(
'res.company', string='Company', ondelete='cascade',
required=False, default=lambda self: self.env.company)
assign_ids = fields.One2many(
'commission.profile.assignment', 'profile_id', string="Assignments")
rule_ids = fields.One2many(
'commission.rule', 'profile_id', string='Commission Rules')
trigger_type = fields.Selection([
('invoice', 'Invoiced'),
('paid', 'Paid'),
('in_payment', 'In Payment and Paid'),
], default='paid', string='Trigger', required=True)
date_range_type_id = fields.Many2one(
'date.range.type', string='Commission Periodicity', ondelete='restrict',
domain="[('company_id', 'in', (False, company_id))]")
class CommissionProfileAssignment(models.Model):
_name = "commission.profile.assignment"
_description = "Commission Profile Assignment"
profile_id = fields.Many2one('commission.profile', ondelete='cascade')
company_id = fields.Many2one(
'res.company', string='Company', ondelete='cascade',
required=True, default=lambda self: self.env.company)
assign_type = fields.Selection(
'_assign_type_selection', default='user', required=True, string="Type")
user_id = fields.Many2one(
'res.users', compute="_compute_user_id", store=True, readonly=False,
ondelete="restrict", string="Salesman",
)
_sql_constraints = [
(
'company_user_uniq',
'unique(user_id, company_id)',
'This salesman already has an assignment in this company.')]
@api.model
def _assign_type_selection(self):
return [('user', _('Salesman'))]
@api.constrains('assign_type', 'user_id')
def _check_user(self):
for assignment in self:
if assignment.assign_type == 'user' and not assignment.user_id:
raise ValidationError(_("A salesman must be selected when the assignment type is 'Salesman'."))
@api.depends('assign_type')
def _compute_user_id(self):
for assign in self:
if assign.assign_type != 'user':
assign.user_id = False
def _get_partner(self):
self.ensure_one()
if self.assign_type == 'user':
return self.user_id.partner_id
return False
def _prepare_move_line_domain(self, date_range):
self.ensure_one()
domain = [
('display_type', '=', False),
('exclude_from_invoice_tab', '=', False),
('move_id.move_type', 'in', ('out_invoice', 'out_refund')),
('date', '<=', date_range.date_end),
('company_id', '=', self.company_id.id),
('commission_result_id', '=', False),
('parent_state', '=', 'posted'),
]
if self.assign_type == 'user':
domain.append(('move_id.invoice_user_id', '=', self.user_id.id))
# TODO : for trigger 'paid' and 'in_payment', we would need to filter
# out the invoices paid after the end date of the commission period
if self.profile_id.trigger_type == 'paid':
domain.append(('move_id.payment_state', 'in', ('paid', 'reversed')))
elif self.profile_id.trigger_type == 'in_payment':
domain.append(('move_id.payment_state', 'in', ('in_payment', 'paid', 'reversed')))
elif self.profile_id.trigger_type == 'invoice':
domain.append(('date', '>=', date_range.date_start))
return domain
def _prepare_commission_result(self, date_range):
vals = {
'partner_id': self._get_partner().id,
'profile_id': self.profile_id.id,
'date_range_id': date_range.id,
'assign_type': self.assign_type,
'assignment_id': self.id,
'company_id': self.company_id.id,
}
return vals
def _generate_commission_result(self, date_range, rules):
self.ensure_one()
ilines = self.env['account.move.line'].search(
self._prepare_move_line_domain(date_range), order='date, move_id, sequence, id')
profile = self.profile_id
ilines2write = {}
for iline in ilines:
rule = iline._match_commission_rule(rules[profile.id])
if rule:
lvals = iline._prepare_commission_data(rule)
if lvals:
ilines2write[iline] = lvals
if ilines2write:
com_result = self.env['commission.result'].create(self._prepare_commission_result(date_range))
for iline, vals in ilines2write.items():
iline.write(dict(vals, commission_result_id=com_result.id))
return com_result
else:
return False

View File

@@ -0,0 +1,87 @@
# Copyright Akretion France (http://www.akretion.com/)
# @author Alexis de Lattre <alexis.delattre@akretion.com>
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).
from odoo import fields, models, api, _
from odoo.exceptions import UserError
class CommissionResult(models.Model):
_name = 'commission.result'
_description = "Commission Result"
_order = 'date_start desc'
_inherit = ['mail.thread', 'mail.activity.mixin']
partner_id = fields.Many2one(
'res.partner', string='Salesman/Agent', required=True, ondelete='restrict',
readonly=True, tracking=True)
profile_id = fields.Many2one(
'commission.profile', string='Commission Profile', readonly=True, tracking=True)
assignment_id = fields.Many2one(
'commission.profile.assignment', string="Commission Profile Assignment", readonly=True)
assign_type = fields.Selection('_assign_type_selection', readonly=True, tracking=True)
company_id = fields.Many2one(
'res.company', string='Company', ondelete='cascade',
required=True, readonly=True, default=lambda self: self.env.company, tracking=True)
company_currency_id = fields.Many2one(
related='company_id.currency_id', string='Company Currency', store=True)
date_range_id = fields.Many2one(
'date.range', required=True, string='Period', readonly=True, tracking=True)
date_start = fields.Date(related='date_range_id.date_start', store=True)
date_end = fields.Date(related='date_range_id.date_end', store=True)
line_ids = fields.One2many(
'account.move.line', 'commission_result_id', string='Commission Lines',
states={'done': [('readonly', True)]})
amount_total = fields.Monetary(
string='Commission Total', currency_field='company_currency_id',
compute='_compute_totals', store=True, tracking=True)
base_total = fields.Monetary(
string="Commission Base Total", currency_field='company_currency_id',
compute='_compute_totals', store=True, tracking=True)
state = fields.Selection([
('draft', 'Draft'),
('done', 'Done'),
], default='draft', tracking=True)
# TODO copy amount to another field
# help='This is the total amount at the date of the computation of the commission')
@api.model
def _assign_type_selection(self):
return self.env['commission.profile.assignment']._assign_type_selection()
@api.depends('line_ids.commission_amount', 'line_ids.commission_base')
def _compute_totals(self):
rg_res = self.env['account.move.line'].read_group([('commission_result_id', 'in', self.ids)], ['commission_result_id', 'commission_amount:sum', 'commission_base:sum'], ['commission_result_id'])
mapped_data = dict([(x['commission_result_id'][0], {'amount': x['commission_amount'], 'base': x['commission_base']}) for x in rg_res])
for rec in self:
rec.amount_total = mapped_data.get(rec.id, {}).get('amount')
rec.base_total = mapped_data.get(rec.id, {}).get('base')
def unlink(self):
for result in self:
if result.state == 'done':
raise UserError(_(
"You cannot delete commission result %s because it is in done state.") % result.display_name)
return super().unlink()
def draft2done(self):
self.filtered(lambda x: x.state == 'draft').write({'state': 'done'})
def backtodraft(self):
self.write({'state': 'draft'})
def name_get(self):
res = []
for result in self:
name = '%s (%s)' % (result.partner_id.name, result.date_range_id.name)
res.append((result.id, name))
return res
_sql_constraints = [(
'salesman_period_company_unique',
'unique(company_id, partner_id, date_range_id)',
'A commission result already exists for this salesman/agent for the same period.')]
def _prepare_xlsx_lines(self):
self.ensure_one()
return self.line_ids.sorted(key=lambda x: x.move_id.invoice_date)

View File

@@ -0,0 +1,72 @@
# Copyright Akretion France (http://www.akretion.com/)
# @author Alexis de Lattre <alexis.delattre@akretion.com>
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).
from odoo import fields, models, api, _
class CommissionRule(models.Model):
_name = 'commission.rule'
_description = 'Commission Rule'
_order = 'profile_id, applied_on, rate desc'
partner_ids = fields.Many2many(
'res.partner', string='Customers', domain=[('parent_id', '=', False)])
product_categ_ids = fields.Many2many(
'product.category', string="Product Categories")
product_ids = fields.Many2many('product.product', string='Products')
date_start = fields.Date('Start Date')
date_end = fields.Date('End Date')
profile_id = fields.Many2one(
'commission.profile', string='Profile', ondelete='cascade')
company_id = fields.Many2one(related='profile_id.company_id', store=True)
rate = fields.Float('Commission Rate', digits="Commission Rate", copy=False)
base = fields.Selection([
('invoiced', 'Invoiced Amount'),
('margin', 'Margin'),
], default='invoiced', required=True, string="Commission Base")
applied_on = fields.Selection([
('0_customer_product', 'Products and Customers'),
('1_customer_product_category', "Product Categories and Customers"),
('2_product', "Products"),
('3_product_category', "Product Categories"),
('4_global', 'Global')],
string='Apply On', default='4_global', required=True)
active = fields.Boolean(string='Active', default=True)
apply_description = fields.Html(compute='_compute_apply_description', string="Match Criteria")
_sql_constraints = [(
'rate_positive',
'CHECK(rate >= 0)',
'Rate must be positive !')]
def _compute_apply_description(self):
customer_label = "<strong>" + _("Customers:") + "</strong>"
product_label = "<strong>" + _("Products:") + "</strong>"
product_categ_label = "<strong>" + _("Product Categories:") + "</strong>"
and_label = "<strong>" + _('AND') + "</strong>"
for rule in self:
desc = False
if rule.applied_on == '0_customer_product':
desc = f"{customer_label} {', '.join([part.ref or part.name for part in rule.partner_ids])} {and_label} {product_label} {', '.join([pp.default_code or pp.name for pp in rule.product_ids])}"
elif rule.applied_on == '1_customer_product_category':
desc = f"{customer_label} {', '.join([part.ref or part.name for part in rule.partner_ids])} {and_label} {product_categ_label} {', '.join([categ.display_name for categ in rule.product_categ_ids])}"
elif rule.applied_on == '2_product':
desc = f"{product_label} {', '.join([pp.default_code or pp.name for pp in rule.product_ids])}"
elif rule.applied_on == '3_product_category':
desc = f"{product_categ_label} {', '.join([categ.display_name for categ in rule.product_categ_ids])}"
elif rule.applied_on == '4_global':
desc = _('Global')
rule.apply_description = desc
@api.model
def load_all_rules(self):
rules = self.search_read([('profile_id', '!=', False)])
res = {} # key = profile, value = [rule1 recordset, rule2]
for rule in rules:
if rule['profile_id'][0] not in res:
res[rule['profile_id'][0]] = [rule]
else:
res[rule['profile_id'][0]].append(rule)
return res

View File

@@ -0,0 +1 @@
from . import commission_result_xlsx

View File

@@ -0,0 +1,112 @@
# Copyright 2025 Akretion France (https://www.akretion.com/)
# @author: Alexis de Lattre <alexis.delattre@akretion.com>
# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl).
from odoo import api, fields, models, tools, _
from odoo.exceptions import UserError
from datetime import datetime
from odoo.tools.misc import format_datetime
class CommissionResultXlsx(models.AbstractModel):
_name = "report.commission_simple.report_xlsx"
_inherit = "report.report_xlsx.abstract"
_description = "Commission Result XLSX"
def generate_xlsx_report(self, workbook, data, objects):
# for some strange reasons, lang is not kept in context
self = self.with_context(lang=self.env.user.lang)
result = objects[0]
sheet = workbook.add_worksheet(result.date_range_id.name)
styles = self._prepare_styles(workbook, result.company_id)
title = _("Commissions of %(partner)s for period %(period)s", partner=result.partner_id.name, period=result.date_range_id.name)
now_str = format_datetime(self.env, datetime.now())
i = 0
sheet.write(i, 0, title, styles['title'])
sheet.write(i, 5, _('Generated from Odoo on %s by %s') % (now_str, self.env.user.name), styles['regular_small'])
i += 1
sheet.write(i, 0, _('Start Date'), styles['subtitle'])
sheet.write(i, 1, result.date_start, styles['subtitle_date'])
i += 1
sheet.write(i, 0, _('End Date'), styles['subtitle'])
sheet.write(i, 1, result.date_end, styles['subtitle_date'])
i += 1
sheet.write(i, 0, _('Currency'), styles['subtitle'])
sheet.write(i, 1, result.company_id.currency_id.name, styles['subtitle'])
i += 1
sheet.write(i, 0, _('Base Total'), styles['subtitle'])
sheet.write(i, 1, result.base_total, styles['subtitle_amount'])
i += 1
sheet.write(i, 0, _('Amount Total'), styles['subtitle'])
sheet.write(i, 1, result.amount_total, styles['subtitle_amount'])
i += 3
cols = self._prepare_xlsx_cols()
coldict = {}
pos = 0
for key, label, width, style_suffix in cols:
coldict[key] = {
"label": label,
"width": width,
"pos": pos,
"style": style_suffix and f"regular_{style_suffix}" or "regular",
}
pos += 1
# header
for col_key, col_vals in coldict.items():
sheet.write(i, col_vals['pos'], col_vals['label'], styles['col_title'])
sheet.set_column(col_vals['pos'], col_vals['pos'], col_vals['width'])
# table content
for line in result._prepare_xlsx_lines():
i += 1
for col_key, value in line._prepare_commission_xlsx().items():
sheet.write(i, coldict[col_key]["pos"], value, styles[coldict[col_key]["style"]])
def _prepare_xlsx_cols(self):
cols = [ # key, label, width, style_suffix
("inv.name", _("Invoice"), 14, False),
("inv.date", _("Invoice Date"), 11, "date"),
("inv.partner", _("Customer"), 50, False),
("product", _("Product"), 35, False),
("qty", _("Quantity"), 8, "qty"),
("uom", _("Unit"), 8, False),
("commission_base", _("Commission Base"), 14, "amount"),
("commission_rate", _("Commission Rate"), 10, "rate"),
("commission_amount", _("Commission Amount"), 14, "amount"),
]
return cols
def _prepare_styles(self, workbook, company):
col_title_bg_color = '#eeeeee'
prec_qty = self.env['decimal.precision'].precision_get('Product Unit of Measure')
prec_rate = self.env['decimal.precision'].precision_get('Commission Rate')
prec_price = self.env['decimal.precision'].precision_get('Product Price')
regular_font_size = 10
date_format = "dd/mm/yyyy" # TODO depend on lang
num_format_amount = f"# ##0.{'0' * company.currency_id.decimal_places}"
num_format_qty = f"# ##0.{'0' * prec_qty}"
num_format_rate = f"""0.{'0' * prec_rate} " "%"""
num_format_price = f"# ##0.{'0' * prec_price}"
styles = {
'title': workbook.add_format({
'bold': True, 'font_size': regular_font_size + 10,
'font_color': '#003b6f'}),
'subtitle': workbook.add_format({
'bold': True, 'font_size': regular_font_size}),
'subtitle_date': workbook.add_format({
'bold': True, 'font_size': regular_font_size, 'num_format': date_format}),
'subtitle_amount': workbook.add_format({
'bold': True, 'font_size': regular_font_size, 'num_format': num_format_amount}),
'col_title': workbook.add_format({
'bold': True, 'bg_color': col_title_bg_color,
'text_wrap': True, 'font_size': regular_font_size,
'align': 'center',
}),
'regular_date': workbook.add_format({'num_format': date_format}),
'regular_amount': workbook.add_format({'num_format': num_format_amount}),
'regular_rate': workbook.add_format({'num_format': num_format_rate}),
'regular_qty': workbook.add_format({'num_format': num_format_qty}),
'regular_price': workbook.add_format({'num_format': num_format_price}),
'regular': workbook.add_format({}),
'regular_small': workbook.add_format({'font_size': regular_font_size - 2}),
}
return styles

View File

@@ -0,0 +1,20 @@
<?xml version="1.0" encoding="utf-8"?>
<!--
Copyright 2025 Akretion France (https://www.akretion.com/)
@author: Alexis de Lattre <alexis.delattre@akretion.com>
The licence is in the file __manifest__.py
-->
<odoo>
<record id="commission_result_xlsx_report" model="ir.actions.report">
<field name="name">Détails Excel</field>
<field name="model">commission.result</field>
<field name="report_type">xlsx</field>
<field name="report_name">commission_simple.report_xlsx</field>
<field name="report_file">commission_simple.report_xlsx</field>
<field name="print_report_name">'commission-%s-%s' % (object.date_range_id.name.replace(' ', '_'), object.partner_id.name.replace(' ', '_'))</field>
<field name="binding_model_id" ref="model_commission_result" />
</record>
</odoo>

View File

@@ -0,0 +1,11 @@
id,name,model_id:id,group_id:id,perm_read,perm_write,perm_create,perm_unlink
access_commission_profile_read,Read access on commission.profile for employees,model_commission_profile,base.group_user,1,0,0,0
access_commission_profile_full,Full access on commission.profile for financial manager,model_commission_profile,account.group_account_manager,1,1,1,1
access_commission_profile_assignment_full,Full access on commission.profile.assignment for financial manager,model_commission_profile_assignment,account.group_account_manager,1,1,1,1
access_commission_rule_full,Full access on commission.rule for financial manager,model_commission_rule,account.group_account_manager,1,1,1,1
access_commission_rule_read,Read access on commission.rule for invoicing group,model_commission_rule,account.group_account_invoice,1,0,0,0
access_commission_rule_audit,Read access on commission.rule for viewer group,model_commission_rule,account.group_account_readonly,1,0,0,0
access_commission_result_full,Full access on commission.result to accountant,model_commission_result,account.group_account_user,1,1,1,1
access_commission_result_read,Read access on commission.result to invoicing grp,model_commission_result,account.group_account_invoice,1,0,0,0
access_commission_result_audit,Read access on commission.result to viewer grp,model_commission_result,account.group_account_readonly,1,0,0,0
access_commission_compute_full,Full access to wizard commission.compute to Accountant,model_commission_compute,account.group_account_user,1,1,1,1
1 id name model_id:id group_id:id perm_read perm_write perm_create perm_unlink
2 access_commission_profile_read Read access on commission.profile for employees model_commission_profile base.group_user 1 0 0 0
3 access_commission_profile_full Full access on commission.profile for financial manager model_commission_profile account.group_account_manager 1 1 1 1
4 access_commission_profile_assignment_full Full access on commission.profile.assignment for financial manager model_commission_profile_assignment account.group_account_manager 1 1 1 1
5 access_commission_rule_full Full access on commission.rule for financial manager model_commission_rule account.group_account_manager 1 1 1 1
6 access_commission_rule_read Read access on commission.rule for invoicing group model_commission_rule account.group_account_invoice 1 0 0 0
7 access_commission_rule_audit Read access on commission.rule for viewer group model_commission_rule account.group_account_readonly 1 0 0 0
8 access_commission_result_full Full access on commission.result to accountant model_commission_result account.group_account_user 1 1 1 1
9 access_commission_result_read Read access on commission.result to invoicing grp model_commission_result account.group_account_invoice 1 0 0 0
10 access_commission_result_audit Read access on commission.result to viewer grp model_commission_result account.group_account_readonly 1 0 0 0
11 access_commission_compute_full Full access to wizard commission.compute to Accountant model_commission_compute account.group_account_user 1 1 1 1

View File

@@ -0,0 +1,29 @@
<?xml version="1.0" encoding="utf-8"?>
<!--
Copyright 2019-2024 Akretion France (https://www.akretion.com)
@author Alexis de Lattre <alexis.delattre@akretion.com>
License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl)
-->
<odoo noupdate="1">
<record id="commission_profile_rule" model="ir.rule">
<field name="name">Commission Profile multi-company</field>
<field name="model_id" ref="model_commission_profile"/>
<field name="domain_force">[('company_id', 'in', company_ids + [False])]</field>
</record>
<record id="commission_rule_rule" model="ir.rule">
<field name="name">Commission Rule multi-company</field>
<field name="model_id" ref="model_commission_rule"/>
<field name="domain_force">[('company_id', 'in', company_ids + [False])]</field>
</record>
<record id="commission_result_rule" model="ir.rule">
<field name="name">Commission Result multi-company</field>
<field name="model_id" ref="model_commission_result"/>
<field name="domain_force">[('company_id', 'in', company_ids)]</field>
</record>
</odoo>

Binary file not shown.

After

Width:  |  Height:  |  Size: 9.2 KiB

View File

@@ -0,0 +1,34 @@
<?xml version="1.0" encoding="utf-8"?>
<!--
Copyright 2024 Akretion France (https://www.akretion.com/)
@author: Alexis de Lattre <alexis.delattre@akretion.com>
License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).
-->
<odoo>
<record id="view_move_line_form" model="ir.ui.view">
<field name="model">account.move.line</field>
<field name="inherit_id" ref="account.view_move_line_form"/>
<field name="arch" type="xml">
<notebook position="inside">
<page name="commission" string="Commission" attrs="{'invisible': [('display_type', '!=', False)]}">
<group name="commission_grp">
<field name="commission_base"/>
<label for="commission_rate"/>
<div name="commission_rate">
<field name="commission_rate" class="oe_inline"/> %
</div>
<field name="commission_amount"/>
<field name="commission_rule_id"/>
<field name="display_type" invisible="1"/>
<field name="company_currency_id" invisible="1"/>
</group>
</page>
</notebook>
</field>
</record>
</odoo>

View File

@@ -0,0 +1,206 @@
<?xml version="1.0" encoding="utf-8"?>
<!--
Copyright 2019 Akretion France (http://www.akretion.com)
@author Alexis de Lattre <alexis.delattre@akretion.com>
License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl)
-->
<odoo>
<menuitem id="commission_root" name="Commissions" parent="account.menu_finance" sequence="11"/>
<menuitem id="commission_config_root" name="Commissions" parent="account.menu_finance_configuration" sequence="110"/>
<!-- PROFILE -->
<record id="commission_profile_form" model="ir.ui.view">
<field name="name">commission.profile.form</field>
<field name="model">commission.profile</field>
<field name="arch" type="xml">
<form>
<sheet>
<widget name="web_ribbon" title="Archived" bg_color="bg-danger" attrs="{'invisible': [('active', '=', True)]}"/>
<group name="main">
<field name="name"/>
<field name="active" invisible="1"/>
<field name="company_id" invisible="1"/>
<field name="company_id" groups="base.group_multi_company"/>
<field name="trigger_type"/>
</group>
<group name="lines" string="Rules">
<field name="line_ids" nolabel="1" colspan="2"/>
</group>
</sheet>
</form>
</field>
</record>
<record id="commission_profile_tree" model="ir.ui.view">
<field name="name">commission.profile.tree</field>
<field name="model">commission.profile</field>
<field name="arch" type="xml">
<tree>
<field name="sequence" widget="handle"/>
<field name="name" decoration-bf="1"/>
<field name="trigger_type" optional="show"/>
<field name="company_id" groups="base.group_multi_company"/>
</tree>
</field>
</record>
<record id="commission_profile_action" model="ir.actions.act_window">
<field name="name">Commission Profiles</field>
<field name="res_model">commission.profile</field>
<field name="view_mode">tree,form</field>
</record>
<menuitem id="commission_profile_menu" action="commission_profile_action" parent="commission_config_root" sequence="18"/>
<!-- RULE -->
<record id="commission_rule_form" model="ir.ui.view">
<field name="name">commission.rule.form</field>
<field name="model">commission.rule</field>
<field name="arch" type="xml">
<form>
<sheet>
<group name="main">
<field name="profile_id" invisible="not context.get('commission_rule_main_view')"/>
<field name="company_id" groups="base.group_multi_company"/>
<field name="company_id" invisible="1"/>
<field name="applied_on" widget="radio"/>
</group>
<group name="match" string="Match">
<field name="partner_ids" attrs="{'invisible': [('applied_on', 'not in', ('0_customer_product', '1_customer_product_category'))], 'required': [('applied_on', 'in', ('0_customer_product', '1_customer_product_category'))]}"/>
<field name="product_categ_ids" attrs="{'invisible': [('applied_on', 'not in', ('1_customer_product_category', '3_product_category'))], 'required': [('applied_on', 'in', ('1_customer_product_category', '3_product_category'))]}"/>
<field name="product_ids" attrs="{'invisible': [('applied_on', 'not in', ('0_customer_product', '2_product'))], 'required': [('applied_on', 'in', ('0_customer_product', '2_product'))]}"/>
<field name="date_start"/>
<field name="date_end"/>
</group>
<group name="compute" string="Compute">
<label for="rate"/>
<div name="rate">
<field name="rate" class="oe_inline"/> %
</div>
</group>
</sheet>
</form>
</field>
</record>
<record id="commission_rule_tree" model="ir.ui.view">
<field name="name">commission.rule.tree</field>
<field name="model">commission.rule</field>
<field name="arch" type="xml">
<tree>
<field name="profile_id" invisible="not context.get('commission_rule_main_view')"/>
<field name="applied_on"/>
<field name="date_start"/>
<field name="date_end"/>
<field name="rate" string="Rate (%)"/>
</tree>
</field>
</record>
<record id="commission_rule_search" model="ir.ui.view">
<field name="name">commission.rule.search</field>
<field name="model">commission.rule</field>
<field name="arch" type="xml">
<search>
<filter string="Archived" name="inactive" domain="[('active', '=', False)]"/>
<group name="groupby">
<filter name="profile_groupby" string="Profile" context="{'group_by': 'profile_id'}"/>
</group>
</search>
</field>
</record>
<record id="commission_rule_action" model="ir.actions.act_window">
<field name="name">Commission Rules</field>
<field name="res_model">commission.rule</field>
<field name="view_mode">tree,form</field>
<field name="context">{'commission_rule_main_view': True}</field>
</record>
<menuitem id="commission_rule_menu" action="commission_rule_action" parent="commission_config_root" sequence="20"/>
<!-- RESULT -->
<record id="commission_result_form" model="ir.ui.view">
<field name="name">commission.result.form</field>
<field name="model">commission.result</field>
<field name="arch" type="xml">
<form>
<group name="main">
<group name="main-left">
<field name="partner_id"/>
<field name="profile_id" groups="account.group_account_manager"/>
<field name="company_currency_id" invisible="1"/>
<field name="company_id" invisible="1"/>
<field name="company_id" groups="base.group_multi_company"/>
<field name="amount_total"/>
</group>
<group name="main-right">
<field name="date_range_id"/>
<field name="date_start"/>
<field name="date_end"/>
</group>
</group>
<group name="lines" string="Commission Lines">
<field nolabel="1" name="line_ids" colspan="2">
<tree>
<field name="move_id"/>
<field name="move_line_id"/>
<field name="base"/>
<field name="rate" string="Rate (%)"/>
<field name="amount" sum="1"/>
<field name="rule_id"/>
<field name="company_currency_id" invisible="1"/>
</tree>
</field>
</group>
</form>
</field>
</record>
<record id="commission_result_tree" model="ir.ui.view">
<field name="name">commission.result.tree</field>
<field name="model">commission.result</field>
<field name="arch" type="xml">
<tree>
<field name="date_range_id" optional="show"/>
<field name="date_start" optional="hide"/>
<field name="date_end" optional="hide"/>
<field name="partner_id"/>
<field name="profile_id" groups="account.group_account_manager"/>
<field name="company_currency_id" invisible="1"/>
<field name="company_id" groups="base.group_multi_company"/>
<field name="amount_total" sum="1" optional="show"/>
</tree>
</field>
</record>
<record id="commission_result_search" model="ir.ui.view">
<field name="name">commission.result.search</field>
<field name="model">commission.result</field>
<field name="arch" type="xml">
<search>
<field name="partner_id"/>
<field name="date_range_id"/>
<group name="groupby">
<filter name="partner_groupby" string="Salesman" context="{'group_by': 'partner_id'}"/>
<filter name="date_range_groupby" string="Period" context="{'group_by': 'date_range_id'}"/>
</group>
</search>
</field>
</record>
<record id="commission_result_action" model="ir.actions.act_window">
<field name="name">Commissions</field>
<field name="res_model">commission.result</field>
<field name="view_mode">tree,form</field>
</record>
<menuitem id="commission_result_menu" action="commission_result_action" parent="commission_root" sequence="10"/>
</odoo>

View File

@@ -0,0 +1,93 @@
<?xml version="1.0" encoding="utf-8"?>
<!--
Copyright 2019-2024 Akretion France (http://www.akretion.com)
@author Alexis de Lattre <alexis.delattre@akretion.com>
License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl)
-->
<odoo>
<menuitem id="commission_root" name="Commissions" parent="account.menu_finance" sequence="11"/>
<menuitem id="commission_config_root" name="Commissions" parent="account.menu_finance_configuration" sequence="110"/>
<record id="commission_profile_form" model="ir.ui.view">
<field name="name">commission.profile.form</field>
<field name="model">commission.profile</field>
<field name="arch" type="xml">
<form>
<sheet>
<widget name="web_ribbon" title="Archived" bg_color="bg-danger" attrs="{'invisible': [('active', '=', True)]}"/>
<group name="main">
<group name="main-left">
<field name="name"/>
<field name="active" invisible="1"/>
<field name="trigger_type" widget="radio"/>
<field name="date_range_type_id"/>
</group>
<group name="main-right">
<field name="company_id" invisible="1"/>
<field name="company_id" groups="base.group_multi_company"/>
</group>
</group>
<notebook>
<page name="assignments" string="Assignments">
<field name="assign_ids">
<tree editable="bottom">
<field name="assign_type"/>
<field name="user_id" attrs="{'required': [('assign_type', '=', 'user')], 'readonly': [('assign_type', '!=', 'user')]}"/>
<field name="company_id" groups="base.group_multi_company"/>
<field name="company_id" invisible="1"/>
</tree>
</field>
</page>
<page name="rules" string="Rules">
<field name="rule_ids"/>
</page>
</notebook>
</sheet>
</form>
</field>
</record>
<record id="commission_profile_tree" model="ir.ui.view">
<field name="name">commission.profile.tree</field>
<field name="model">commission.profile</field>
<field name="arch" type="xml">
<tree>
<field name="sequence" widget="handle"/>
<field name="name" decoration-bf="1"/>
<field name="trigger_type" optional="show" widget="badge" decoration-info="trigger_type == 'invoice'" decoration-success="trigger_type == 'paid'" decoration-warning="trigger_type == 'in_payment'"/>
<field name="date_range_type_id" optional="show"/>
<field name="company_id" groups="base.group_multi_company"/>
</tree>
</field>
</record>
<record id="commission_profile_search" model="ir.ui.view">
<field name="model">commission.profile</field>
<field name="arch" type="xml">
<search>
<field name="name"/>
<filter string="Invoiced" name="invoice" domain="[('trigger_type', '=', 'invoice')]"/>
<filter string="Paid" name="paid" domain="[('trigger_type', '=', 'paid')]"/>
<filter string="In Payment and Paid" name="in_payment" domain="[('trigger_type', '=', 'in_payment')]"/>
<separator/>
<filter string="Archived" name="inactive" domain="[('active', '=', False)]"/>
<separator/>
<group name="groupby">
<filter name="date_range_type_groupby" string="Commission Periodicity" context="{'group_by': 'date_range_type_id'}"/>
</group>
</search>
</field>
</record>
<record id="commission_profile_action" model="ir.actions.act_window">
<field name="name">Commission Profiles</field>
<field name="res_model">commission.profile</field>
<field name="view_mode">tree,form</field>
</record>
<menuitem id="commission_profile_menu" action="commission_profile_action" parent="commission_config_root" sequence="18"/>
</odoo>

View File

@@ -0,0 +1,127 @@
<?xml version="1.0" encoding="utf-8"?>
<!--
Copyright 2024 Akretion France (http://www.akretion.com)
@author Alexis de Lattre <alexis.delattre@akretion.com>
License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl)
-->
<odoo>
<record id="commission_result_form" model="ir.ui.view">
<field name="name">commission.result.form</field>
<field name="model">commission.result</field>
<field name="arch" type="xml">
<form>
<header>
<button name="draft2done" type="object" states="draft" string="Confirm" class="btn-primary"/>
<button name="backtodraft" type="object" states="done" string="Back to Draft" confirm="Are you sure you want to go back to draft?"/>
<button name="%(commission_simple.commission_result_xlsx_report)d" type="action" string="Excel Export"/>
<field name="state" widget="statusbar"/>
</header>
<group name="main">
<group name="main-left">
<field name="partner_id"/>
<field name="date_range_id"/>
<field name="date_start"/>
<field name="date_end"/>
<field name="base_total"/>
<field name="amount_total"/>
<field name="company_currency_id" invisible="1"/>
<field name="company_id" invisible="1"/>
</group>
<group name="main-right">
<field name="profile_id" groups="account.group_account_manager"/>
<field name="assign_type"/>
<field name="company_id" groups="base.group_multi_company"/>
</group>
</group>
<group name="lines" string="Commission Lines">
<field nolabel="1" name="line_ids" colspan="2" widget="many2many">
<tree>
<field name="move_id"/>
<field name="date" optional="hide"/>
<field name="partner_id"/>
<field name="product_id"/>
<field name="product_categ_id" optional="hide"/>
<field name="name" optional="hide"/>
<field name="quantity" optional="hide"/>
<field name="product_uom_id" optional="hide" groups="uom.group_uom"/>
<field name="price_unit" string="Price" optional="hide"/>
<field name="discount" string="Disc.%" optional="hide"/>
<field name="price_subtotal" optional="hide" string="Invoiced Amount"/>
<field name="commission_base" sum="1"/>
<field name="commission_rate" string="Rate (%)"/>
<field name="commission_amount" sum="1"/>
<field name="commission_rule_id" optional="hide"/>
<field name="company_currency_id" invisible="1"/>
<field name="currency_id" invisible="1"/>
</tree>
</field>
</group>
<div class="oe_chatter">
<field name="message_follower_ids" widget="mail_followers"/>
<field name="activity_ids" widget="mail_activity"/>
<field name="message_ids" widget="mail_thread"/>
</div>
</form>
</field>
</record>
<record id="commission_result_tree" model="ir.ui.view">
<field name="name">commission.result.tree</field>
<field name="model">commission.result</field>
<field name="arch" type="xml">
<tree decoration-info="state == 'draft'">
<header>
<button
name="draft2done"
type="object"
string="Validate"
/>
</header>
<field name="date_range_id" optional="show"/>
<field name="date_start" optional="hide"/>
<field name="date_end" optional="hide"/>
<field name="partner_id"/>
<field name="profile_id" groups="account.group_account_manager"/>
<field name="assign_type" optional="hide" widget="badge" decoration-warning="assign_type == 'user'"/>
<field name="company_currency_id" invisible="1"/>
<field name="company_id" groups="base.group_multi_company"/>
<field name="base_total" sum="1" optional="hide"/>
<field name="amount_total" sum="1" optional="show"/>
<field name="state" decoration-info="state == 'draft'" decoration-success="state == 'done'" widget="badge"/>
</tree>
</field>
</record>
<record id="commission_result_search" model="ir.ui.view">
<field name="name">commission.result.search</field>
<field name="model">commission.result</field>
<field name="arch" type="xml">
<search>
<field name="partner_id"/>
<field name="date_range_id"/>
<separator/>
<filter name="draft" domain="[('state', '=', 'draft')]" string="Draft"/>
<filter name="done" domain="[('state', '=', 'done')]" string="Done"/>
<separator/>
<filter name="user" domain="[('assign_type', '=', 'user')]" string="Salesman"/>
<group name="groupby">
<filter name="partner_groupby" string="Salesman" context="{'group_by': 'partner_id'}"/>
<filter name="date_range_groupby" string="Period" context="{'group_by': 'date_range_id'}"/>
<filter name="assign_type_groupby" string="Assign Type" context="{'group_by': 'assign_type'}"/>
</group>
</search>
</field>
</record>
<record id="commission_result_action" model="ir.actions.act_window">
<field name="name">Commissions</field>
<field name="res_model">commission.result</field>
<field name="view_mode">tree,form</field>
</record>
<menuitem id="commission_result_menu" action="commission_result_action" parent="commission_root" sequence="10"/>
</odoo>

View File

@@ -0,0 +1,82 @@
<?xml version="1.0" encoding="utf-8"?>
<!--
Copyright 2019 Akretion France (http://www.akretion.com)
@author Alexis de Lattre <alexis.delattre@akretion.com>
License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl)
-->
<odoo>
<record id="commission_rule_form" model="ir.ui.view">
<field name="name">commission.rule.form</field>
<field name="model">commission.rule</field>
<field name="arch" type="xml">
<form>
<sheet>
<group name="main">
<field name="profile_id" invisible="not context.get('commission_rule_main_view')"/>
<field name="applied_on" widget="radio"/>
<field name="company_id" invisible="1"/>
</group>
<group name="match" string="Match">
<field name="partner_ids" attrs="{'invisible': [('applied_on', 'not in', ('0_customer_product', '1_customer_product_category'))], 'required': [('applied_on', 'in', ('0_customer_product', '1_customer_product_category'))]}"/>
<field name="product_categ_ids" attrs="{'invisible': [('applied_on', 'not in', ('1_customer_product_category', '3_product_category'))], 'required': [('applied_on', 'in', ('1_customer_product_category', '3_product_category'))]}"/>
<field name="product_ids" attrs="{'invisible': [('applied_on', 'not in', ('0_customer_product', '2_product'))], 'required': [('applied_on', 'in', ('0_customer_product', '2_product'))]}"/>
<field name="date_start"/>
<field name="date_end"/>
</group>
<group name="compute" string="Compute">
<label for="rate"/>
<div name="rate">
<field name="rate" class="oe_inline"/> %
</div>
<field name="base" widget="radio"/>
</group>
</sheet>
</form>
</field>
</record>
<record id="commission_rule_tree" model="ir.ui.view">
<field name="name">commission.rule.tree</field>
<field name="model">commission.rule</field>
<field name="arch" type="xml">
<tree>
<field name="profile_id" invisible="not context.get('commission_rule_main_view')"/>
<field name="applied_on" widget="badge" decoration-danger="applied_on == '0_customer_product'" decoration-warning="applied_on == '1_customer_product_category'" decoration-info="applied_on == '2_product'" decoration-success="applied_on == '3_product_category'"/>
<field name="apply_description"/>
<field name="date_start" optional="show"/>
<field name="date_end" optional="show"/>
<field name="rate" string="Rate (%)"/>
<field name="base" widget="badge" decoration-success="base == 'invoiced'" decoration-warning="base == 'margin'"/>
</tree>
</field>
</record>
<record id="commission_rule_search" model="ir.ui.view">
<field name="name">commission.rule.search</field>
<field name="model">commission.rule</field>
<field name="arch" type="xml">
<search>
<field name="profile_id"/>
<filter string="Archived" name="inactive" domain="[('active', '=', False)]"/>
<group name="groupby">
<filter name="profile_groupby" string="Profile" context="{'group_by': 'profile_id'}"/>
</group>
</search>
</field>
</record>
<record id="commission_rule_action" model="ir.actions.act_window">
<field name="name">Commission Rules</field>
<field name="res_model">commission.rule</field>
<field name="view_mode">tree,form</field>
<field name="context">{'commission_rule_main_view': True}</field>
</record>
<menuitem id="commission_rule_menu" action="commission_rule_action" parent="commission_config_root" sequence="20"/>
</odoo>

View File

@@ -0,0 +1 @@
from . import commission_compute

View File

@@ -0,0 +1,96 @@
# Copyright 2019-2024 Akretion France (http://www.akretion.com)
# @author Alexis de Lattre <alexis.delattre@akretion.com>
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).
from odoo import api, fields, models, _
from datetime import datetime, timedelta
from odoo.exceptions import UserError
from odoo.tools.misc import format_date
import logging
logger = logging.getLogger(__name__)
class CommissionCompute(models.TransientModel):
_name = 'commission.compute'
_description = 'Compute Commissions'
company_id = fields.Many2one('res.company', required=True)
date_start = fields.Date(string="Period Start Date", required=True)
@api.model
def default_get(self, fields_list):
res = super().default_get(fields_list)
company = self.env.company
last_commission_result = self.env['commission.result'].search([
('company_id', '=', company.id),
], order='date_start desc', limit=1)
if last_commission_result:
last_start_date = last_commission_result.date_start
commissions_last_start_date = self.env['commission.result'].search([
('date_start', '=', last_start_date),
('company_id', '=', company.id),
], order="date_end asc", limit=1)
min_end_date = commissions_last_start_date.date_end
date_start = min_end_date + timedelta(1)
else:
today = fields.Date.context_today(self)
date_start = datetime(today.year, today.month, 1)
res.update({
'company_id': company.id,
'date_start': date_start,
})
return res
def run(self):
self.ensure_one()
if not self.date_start:
raise UserError(_("Missing Period Start Date."))
creso = self.env['commission.result']
existing_commissions = creso.search_read([
('date_start', '=', self.date_start),
('company_id', '=', self.company_id.id),
], ['assignment_id'])
exclude_assignment_ids = [x['assignment_id'][0] for x in existing_commissions if x['assignment_id']]
com_result_ids = self._core_compute(exclude_assignment_ids)
if not com_result_ids:
raise UserError(_('No commissions generated.'))
action = self.env['ir.actions.actions']._for_xml_id(
'commission_simple.commission_result_action')
action.update({
'views': False,
'domain': f"[('id', 'in', {com_result_ids})]",
})
return action
def _core_compute(self, exclude_assignment_ids):
rules = self.env['commission.rule'].load_all_rules()
com_result_ids = []
assignments = self.env['commission.profile.assignment'].search(
[('company_id', '=', self.company_id.id), ('id', 'not in', exclude_assignment_ids)])
date_range_type2date_range = {}
for assignment in assignments:
profile = assignment.profile_id
date_range_type = profile.date_range_type_id
if not date_range_type:
raise UserError(_("Missing commission periodicity on commission profile '%s'.") % profile.display_name)
if date_range_type not in date_range_type2date_range:
domain = [
('date_start', '=', self.date_start),
('type_id', '=', date_range_type.id),
]
date_range = self.env['date.range'].search(
domain + [('company_id', '=', self.company_id.id)], limit=1)
if not date_range:
date_range = self.env['date.range'].search(
domain + [('company_id', '=', False)], limit=1)
if not date_range:
logger.info('There is no date range with type %s starting on %s. Skipping commission generation for assignment ID %s', date_range_type.name, self.date_start, assignment.id)
continue
date_range_type2date_range[date_range_type] = date_range
com_result = assignment._generate_commission_result(date_range_type2date_range[date_range_type], rules)
if com_result:
com_result_ids.append(com_result.id)
else:
logger.info("No commission for %s", assignment._get_partner().display_name)
return com_result_ids

View File

@@ -0,0 +1,38 @@
<?xml version="1.0" encoding="utf-8"?>
<!--
Copyright 2019-2024 Akretion France (https://www.akretion.com)
@author Alexis de Lattre <alexis.delattre@akretion.com>
License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).
-->
<odoo>
<record id="commission_compute_form" model="ir.ui.view">
<field name="name">commission.compute.form</field>
<field name="model">commission.compute</field>
<field name="arch" type="xml">
<form>
<group name="main">
<field name="company_id" groups="base.group_multi_company"/>
<field name="company_id" invisible="1"/>
<field name="date_start"/>
</group>
<footer>
<button name="run" type="object" string="Compute"
class="btn-primary"/>
<button special="cancel" string="Cancel"/>
</footer>
</form>
</field>
</record>
<record id="commission_compute_action" model="ir.actions.act_window">
<field name="name">Compute Commissions</field>
<field name="res_model">commission.compute</field>
<field name="view_mode">form</field>
<field name="target">new</field>
</record>
<menuitem id="commission_compute_menu" action="commission_compute_action" parent="commission_root" sequence="15"/>
</odoo>

View File

@@ -0,0 +1 @@
from . import models

View File

@@ -0,0 +1,22 @@
# Copyright 2019-2025 Akretion France (http://www.akretion.com)
# @author Alexis de Lattre <alexis.delattre@akretion.com>
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).
{
'name': 'Commission Simple Agent',
'version': '14.0.1.0.0',
'category': 'Sales',
'license': 'AGPL-3',
'summary': 'Glue module between commission_simple and sale_agent',
'author': 'Akretion',
'website': 'https://github.com/akretion/odoo-usability',
'depends': [
'commission_simple',
'sale_agent',
],
'data': [
'views/commission_profile.xml',
'views/commission_result.xml',
],
'installable': True,
}

View File

@@ -0,0 +1,56 @@
# Translation of Odoo Server.
# This file contains the translation of the following modules:
# * commission_simple_agent
#
msgid ""
msgstr ""
"Project-Id-Version: Odoo Server 14.0\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2025-10-17 20:49+0000\n"
"PO-Revision-Date: 2025-10-17 20:49+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: commission_simple_agent
#: code:addons/commission_simple_agent/models/commission_profile_assignment.py:0
#: model:ir.model.fields,field_description:commission_simple_agent.field_commission_profile_assignment__agent_id
#: model_terms:ir.ui.view,arch_db:commission_simple_agent.commission_result_search
#, python-format
msgid "Agent"
msgstr "Agent"
#. module: commission_simple_agent
#: code:addons/commission_simple_agent/models/commission_profile_assignment.py:0
#, python-format
msgid "An agent must be selected when the assignment type is 'Agent'."
msgstr ""
"Un agent doit être sélectionné lorsque le type d'affectation est \"Agent\"."
#. module: commission_simple_agent
#: model:ir.model,name:commission_simple_agent.model_commission_profile_assignment
msgid "Commission Profile Assignment"
msgstr "Affectation du profil de commission"
#. module: commission_simple_agent
#: model:ir.model.fields,field_description:commission_simple_agent.field_commission_profile_assignment__display_name
msgid "Display Name"
msgstr "Nom affiché"
#. module: commission_simple_agent
#: model:ir.model.fields,field_description:commission_simple_agent.field_commission_profile_assignment__id
msgid "ID"
msgstr ""
#. module: commission_simple_agent
#: model:ir.model.fields,field_description:commission_simple_agent.field_commission_profile_assignment____last_update
msgid "Last Modified on"
msgstr "Dernière modification le"
#. module: commission_simple_agent
#: model:ir.model.constraint,message:commission_simple_agent.constraint_commission_profile_assignment_company_agent_uniq
msgid "This agent already has an assignment in this company."
msgstr "Cet agent a déjà une affectation dans cette société."

View File

@@ -0,0 +1 @@
from . import commission_profile_assignment

View File

@@ -0,0 +1,51 @@
# Copyright Akretion France (http://www.akretion.com/)
# @author Alexis de Lattre <alexis.delattre@akretion.com>
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).
from odoo import api, fields, models, _
from odoo.exceptions import ValidationError
class CommissionProfileAssignment(models.Model):
_inherit = "commission.profile.assignment"
agent_id = fields.Many2one(
'res.partner', ondelete='restrict',
compute="_compute_agent_id", store=True, readonly=False,
domain=[('agent', '=', True)])
_sql_constraints = [
(
'company_agent_uniq',
'unique(agent_id, company_id)',
'This agent already has an assignment in this company.')]
@api.model
def _assign_type_selection(self):
sel = super()._assign_type_selection()
sel.append(('agent', _('Agent')))
return sel
@api.constrains('assign_type', 'agent_id')
def _check_agent(self):
for assignment in self:
if assignment.assign_type == 'agent' and not assignment.agent_id:
raise ValidationError(_("An agent must be selected when the assignment type is 'Agent'."))
@api.depends('assign_type')
def _compute_agent_id(self):
for assign in self:
if assign.assign_type != 'agent':
assign.agent_id = False
def _prepare_move_line_domain(self, date_range):
domain = super()._prepare_move_line_domain(date_range)
if self.assign_type == 'agent':
domain.append(('move_id.invoice_agent_id', '=', self.agent_id.id))
return domain
def _get_partner(self):
self.ensure_one()
if self.assign_type == 'agent':
return self.agent_id
return super()._get_partner()

Binary file not shown.

After

Width:  |  Height:  |  Size: 9.2 KiB

View File

@@ -0,0 +1,21 @@
<?xml version="1.0" encoding="utf-8"?>
<!--
Copyright 2024 Akretion France (https://www.akretion.com)
@author Alexis de Lattre <alexis.delattre@akretion.com>
License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl)
-->
<odoo>
<record id="commission_profile_form" model="ir.ui.view">
<field name="model">commission.profile</field>
<field name="inherit_id" ref="commission_simple.commission_profile_form"/>
<field name="arch" type="xml">
<xpath expr="//field[@name='assign_ids']/tree/field[@name='user_id']" position="after">
<field name="agent_id" attrs="{'required': [('assign_type', '=', 'agent')], 'readonly': [('assign_type', '!=', 'agent')]}"/>
</xpath>
</field>
</record>
</odoo>

View File

@@ -0,0 +1,32 @@
<?xml version="1.0" encoding="utf-8"?>
<!--
Copyright 2024 Akretion France (https://www.akretion.com)
@author Alexis de Lattre <alexis.delattre@akretion.com>
License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl)
-->
<odoo>
<record id="commission_result_tree" model="ir.ui.view">
<field name="model">commission.result</field>
<field name="inherit_id" ref="commission_simple.commission_result_tree"/>
<field name="arch" type="xml">
<field name="assign_type" position="attributes">
<attribute name="decoration-danger">assign_type == 'agent'</attribute>
</field>
</field>
</record>
<record id="commission_result_search" model="ir.ui.view">
<field name="model">commission.result</field>
<field name="inherit_id" ref="commission_simple.commission_result_search"/>
<field name="arch" type="xml">
<filter name="user" position="after">
<filter name="agent" domain="[('assign_type', '=', 'agent')]" string="Agent"/>
</filter>
</field>
</record>
</odoo>

View File

@@ -0,0 +1,2 @@
from . import models
from . import wizards

View File

@@ -0,0 +1,23 @@
# Copyright 2019-2024 Akretion France (http://www.akretion.com)
# @author Alexis de Lattre <alexis.delattre@akretion.com>
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).
{
'name': 'Commission Simple Agent Purchase',
'version': '14.0.1.0.0',
'category': 'Sales',
'license': 'AGPL-3',
'summary': 'Glue module between commission_simple_agent and purchase',
'author': 'Akretion',
'website': 'https://github.com/akretion/odoo-usability',
'depends': [
'commission_simple_agent',
'purchase',
],
'data': [
'views/commission_result.xml',
'views/commission_profile.xml',
'wizards/res_config_settings.xml',
],
'installable': True,
}

View File

@@ -0,0 +1,79 @@
# Translation of Odoo Server.
# This file contains the translation of the following modules:
# * commission_simple_agent_purchase
#
msgid ""
msgstr ""
"Project-Id-Version: Odoo Server 16.0\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2024-11-29 23:33+0000\n"
"PO-Revision-Date: 2024-11-29 23:34+0000\n"
"Last-Translator: Alexis de Lattre <alexis.delattre@akretion.com>\n"
"Language-Team: \n"
"Language: fr\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: \n"
"Plural-Forms: \n"
#. module: commission_simple_agent_purchase
#. odoo-python
#: code:addons/commission_simple_agent_purchase/models/commission_result.py:0
#, python-format
msgid ""
"Cannot delete commission %(commission)s because it is linked to purchase "
"order %(po)s. You must delete the purchase order first."
msgstr ""
"Impossible de supprimer la commission %(commission)s car elle est liée à la "
"commande fournisseur %(po)s. Vous devez d'abord supprimer la commande "
"fournisseur."
#. module: commission_simple_agent_purchase
#. odoo-python
#: code:addons/commission_simple_agent_purchase/models/commission_result.py:0
#, python-format
msgid "Commission %s"
msgstr "Commission %s"
#. module: commission_simple_agent_purchase
#: model:ir.model.fields,field_description:commission_simple_agent_purchase.field_res_company__commission_product_id
#: model:ir.model.fields,field_description:commission_simple_agent_purchase.field_res_config_settings__commission_product_id
msgid "Commission Product"
msgstr "Produit de commission"
#. module: commission_simple_agent_purchase
#: model:ir.model,name:commission_simple_agent_purchase.model_commission_result
msgid "Commission Result"
msgstr "État des commissions"
#. module: commission_simple_agent_purchase
#. odoo-python
#: code:addons/commission_simple_agent_purchase/models/commission_result.py:0
#, python-format
msgid "Commission product is not set on company %s."
msgstr "Le produit de commission n'est pas défini sur la société %s."
#. module: commission_simple_agent_purchase
#: model:ir.model,name:commission_simple_agent_purchase.model_res_company
msgid "Companies"
msgstr "Sociétés"
#. module: commission_simple_agent_purchase
#: model:ir.model,name:commission_simple_agent_purchase.model_res_config_settings
msgid "Config Settings"
msgstr "Configuration"
#. module: commission_simple_agent_purchase
#: model:ir.model.fields,field_description:commission_simple_agent_purchase.field_commission_result__purchase_id
msgid "Purchase Order"
msgstr "Commande fournisseur"
#. module: commission_simple_agent_purchase
#. odoo-python
#: code:addons/commission_simple_agent_purchase/models/commission_result.py:0
#, python-format
msgid ""
"Purchase Order %s has already been confirmed. You should cancel it first."
msgstr ""
"La commande fournisseur %s a déjà été confirmée. Vous devez d'abord "
"l'annuler."

View File

@@ -0,0 +1,3 @@
from . import commission_result
from . import commission_profile
from . import res_company

View File

@@ -0,0 +1,20 @@
# Copyright Akretion France (http://www.akretion.com/)
# @author Alexis de Lattre <alexis.delattre@akretion.com>
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).
from odoo import fields, models, api, _
from odoo.exceptions import ValidationError
class CommissionProfile(models.Model):
_inherit = 'commission.profile'
commission_product_id = fields.Many2one(
'product.product', string='Specific Commission Product', ondelete='restrict',
check_company=True,
domain=[('type', '=', 'service')],
help="If not set, Odoo will use the commission product configured on the accounting "
"configuration page."
)

View File

@@ -0,0 +1,111 @@
# Copyright Akretion France (https://www.akretion.com/)
# @author Alexis de Lattre <alexis.delattre@akretion.com>
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).
from odoo import fields, models, _
from odoo.exceptions import UserError
from odoo.tools.misc import format_amount, formatLang
from markupsafe import Markup
class CommissionResult(models.Model):
_inherit = 'commission.result'
purchase_id = fields.Many2one('purchase.order', string="Purchase Order", tracking=True, readonly=True)
def draft2done(self):
for result in self:
if result.assign_type == 'agent':
if not result.purchase_id:
vals = result._prepare_purchase_order()
po = self.env['purchase.order'].create(vals)
po.message_post(body=Markup(_("Generated from commission <a href=# data-oe-model=commission.result data-oe-id=%d>%s</a>.") % (result.id, result.display_name)))
result.write({'purchase_id': po.id})
else:
po = self.purchase_id
if po.state in ('draft', 'sent', 'cancel'):
po.order_line.unlink()
po.message_post(body=Markup(_("Purchase order lines re-generated from commission <a href=# data-oe-model=commission.result data-oe-id=%d>%s</a>.") % (result.id, result.display_name)))
else:
raise UserError(_("Purchase Order %s has already been confirmed. You should cancel it first.") % po.display_name)
if po.state == 'cancel':
po.button_draft()
assert not po.order_line
# create lines
line_vals = []
if not result.company_id.commission_po_config:
raise UserError(_(
"Purchase order configuration for commission is not set on "
"the accounting configuration page of company '%s'.")
% result.company_id.display_name)
if result.company_id.commission_po_config == 'single_line':
line_vals.append(result._prepare_purchase_order_line_single_line(po))
else:
for move_line in result.line_ids:
line_vals.append(result._prepare_purchase_order_line(move_line, po))
po_lines = self.env['purchase.order.line'].create(line_vals)
po_lines._compute_tax_id()
return super().draft2done()
def _prepare_purchase_order(self):
self.ensure_one()
fp = self.env['account.fiscal.position'].get_fiscal_position(self.partner_id.id)
vals = {
'partner_id': self.partner_id.id,
'origin': _('Commission %s') % self.date_range_id.display_name,
'company_id': self.company_id.id,
'currency_id': self.company_id.currency_id.id,
'fiscal_position_id': fp and fp.id or False,
'payment_term_id': self.partner_id.property_supplier_payment_term_id.id,
}
return vals
def _prepare_purchase_order_line(self, move_line, order):
self.ensure_one()
move = move_line.move_id
company_currency = move_line.company_id.currency_id
lang = self.partner_id.lang or self.env.lang
env = self.with_context(lang=lang).env
product = self.profile_id.commission_product_id or self.company_id.commission_product_id
if not product:
raise UserError(_(
"Commission product is not set on profile '%(profile)s' "
"nor on company '%(company)s'.",
profile=self.profile_id.display_name,
company=self.company_id.display_name))
vals = {
'order_id': order.id,
'product_id': product.id,
'name': f"""{move.name} {move.commercial_partner_id.name}: {move_line.product_id.display_name} x {formatLang(env, move_line.quantity, dp='Product Unit of Measure')} {move_line.product_uom_id.display_name}\n{_('Base:')} {format_amount(env, move_line.commission_base, company_currency)} - {_('Rate:')} {formatLang(env, move_line.commission_rate, dp='Commission Rate')} %""",
'product_qty': 1,
'product_uom': product.uom_id.id,
'price_unit': move_line.commission_amount,
}
return vals
def _prepare_purchase_order_line_single_line(self, order):
product = self.profile_id.commission_product_id or self.company_id.commission_product_id
if not product:
raise UserError(_(
"Commission product is not set on profile '%(profile)s' "
"nor on company '%(company)s'.",
profile=self.profile_id.display_name,
company=self.company_id.display_name))
vals = {
'order_id': order.id,
'product_id': product.id,
'name': _("Commissions for period %(period)s", period=self.date_range_id.name),
'product_qty': 1,
'product_uom': product.uom_id.id,
'price_unit': self.amount_total,
}
return vals
def unlink(self):
for result in self:
if result.purchase_id:
raise UserError(_(
"Cannot delete commission %(commission)s because it is linked to "
"purchase order %(po)s. You must delete the purchase order first.",
commission=result.display_name, po=result.purchase_id.display_name))
return super().unlink()

View File

@@ -0,0 +1,18 @@
# Copyright 2024 Akretion France (https://www.akretion.com/)
# @author Alexis de Lattre <alexis.delattre@akretion.com>
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).
from odoo import fields, models
class ResCompany(models.Model):
_inherit = 'res.company'
commission_product_id = fields.Many2one(
'product.product', string='Commission Product', ondelete='restrict', check_company=True,
domain=[('type', '=', 'service')])
commission_po_config = fields.Selection([
('single_line', 'Single Line'),
('details', 'One line per commission line'),
], default='details', string="Purchase Order Configuration")

Binary file not shown.

After

Width:  |  Height:  |  Size: 9.2 KiB

View File

@@ -0,0 +1,22 @@
<?xml version="1.0" encoding="utf-8"?>
<!--
Copyright 2025 Akretion France (https://www.akretion.com)
@author Alexis de Lattre <alexis.delattre@akretion.com>
License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl)
-->
<odoo>
<record id="commission_profile_form" model="ir.ui.view">
<field name="model">commission.profile</field>
<field name="inherit_id" ref="commission_simple_agent.commission_profile_form"/>
<field name="arch" type="xml">
<group name="main-right" position="inside">
<field name="commission_product_id"/>
</group>
</field>
</record>
</odoo>

View File

@@ -0,0 +1,21 @@
<?xml version="1.0" encoding="utf-8"?>
<!--
Copyright 2019 Akretion France (http://www.akretion.com)
@author Alexis de Lattre <alexis.delattre@akretion.com>
License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl)
-->
<odoo>
<record id="commission_result_form" model="ir.ui.view">
<field name="model">commission.result</field>
<field name="inherit_id" ref="commission_simple.commission_result_form"/>
<field name="arch" type="xml">
<group name="main-right" position="inside">
<field name="purchase_id" attrs="{'invisible': [('assign_type', '!=', 'agent')]}"/>
</group>
</field>
</record>
</odoo>

View File

@@ -0,0 +1 @@
from . import res_config_settings

View File

@@ -0,0 +1,13 @@
# Copyright 2019-2024 Akretion France (https://www.akretion.com/)
# @author: Alexis de Lattre <alexis.delattre@akretion.com>
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).
from odoo import fields, models
class ResConfigSettings(models.TransientModel):
_inherit = 'res.config.settings'
commission_product_id = fields.Many2one(
related='company_id.commission_product_id', readonly=False)
commission_po_config = fields.Selection(related="company_id.commission_po_config", readonly=False)

View File

@@ -0,0 +1,38 @@
<?xml version="1.0" encoding="utf-8"?>
<!--
Copyright 2019-2024 Akretion France (https://www.akretion.com)
@author: Alexis de Lattre <alexis.delattre@akretion.com>
License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).
-->
<odoo>
<record id="res_config_settings_view_form" model="ir.ui.view">
<field name="name">commission.res.config.settings.form</field>
<field name="model">res.config.settings</field>
<field name="inherit_id" ref="account.res_config_settings_view_form" />
<field name="arch" type="xml">
<xpath expr="//div[@id='analytic']" position="after">
<h2>Commissions</h2>
<div class="row mt16 o_settings_container" id="commission_simple">
<div class="col-12 col-lg-12 o_setting_box" id="commission_simple-settings">
<div class="o_setting_left_pane" />
<div class="o_setting_right_pane">
<div class="row" id="commission_product_id">
<label for="commission_product_id" class="col-md-5" />
<field name="commission_product_id" context="{'default_type': 'service', 'default_purchase_ok': True, 'default_sale_ok': False, 'default_available_in_pos': False, 'default_purchase_method': 'purchase'}"/>
</div>
<div class="row" id="commission_po_config">
<label for="commission_po_config" class="col-md-5" string="Purchase Order"/>
<field name="commission_po_config" />
</div>
</div>
</div>
</div>
</xpath>
</field>
</record>
</odoo>

Binary file not shown.

After

Width:  |  Height:  |  Size: 9.2 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 9.2 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 9.2 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 9.2 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 9.2 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 9.2 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 9.2 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 9.2 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 9.2 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 9.2 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 9.2 KiB

View File

@@ -2,10 +2,13 @@
MRP Usability
=============
.. !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
..
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
!! This file is generated by oca-gen-addon-readme !!
!! changes will be overwritten. !!
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
!! source digest: sha256:020a9d9474cfd9d4445a4ea664e6acbfdb6c863d85029a3bad67962b934be139
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
.. |badge1| image:: https://img.shields.io/badge/maturity-Beta-yellow.png
:target: https://odoo-community.org/page/development-status
@@ -14,7 +17,7 @@ MRP Usability
:target: http://www.gnu.org/licenses/agpl-3.0-standalone.html
:alt: License: AGPL-3
.. |badge3| image:: https://img.shields.io/badge/github-akretion%2Fodoo--usability-lightgray.png?logo=github
:target: https://github.com/akretion/odoo-usability/tree/12.0/mrp_usability
:target: https://github.com/akretion/odoo-usability/tree/14.0/mrp_usability
:alt: akretion/odoo-usability
|badge1| |badge2| |badge3|
@@ -43,8 +46,8 @@ Bug Tracker
Bugs are tracked on `GitHub Issues <https://github.com/akretion/odoo-usability/issues>`_.
In case of trouble, please check there if your issue has already been reported.
If you spotted it first, help us smashing it by providing a detailed and welcomed
`feedback <https://github.com/akretion/odoo-usability/issues/new?body=module:%20mrp_usability%0Aversion:%2012.0%0A%0A**Steps%20to%20reproduce**%0A-%20...%0A%0A**Current%20behavior**%0A%0A**Expected%20behavior**>`_.
If you spotted it first, help us to smash it by providing a detailed and welcomed
`feedback <https://github.com/akretion/odoo-usability/issues/new?body=module:%20mrp_usability%0Aversion:%2014.0%0A%0A**Steps%20to%20reproduce**%0A-%20...%0A%0A**Current%20behavior**%0A%0A**Expected%20behavior**>`_.
Do not contact contributors directly about support or help with technical issues.
@@ -60,10 +63,11 @@ Contributors
~~~~~~~~~~~~
Alexis de Lattre <alexis.delattre@akretion.com>
David Béal <david.beal@akretion.com>
Maintainers
~~~~~~~~~~~
This module is part of the `akretion/odoo-usability <https://github.com/akretion/odoo-usability/tree/12.0/mrp_usability>`_ project on GitHub.
This module is part of the `akretion/odoo-usability <https://github.com/akretion/odoo-usability/tree/14.0/mrp_usability>`_ project on GitHub.
You are welcome to contribute.

View File

@@ -12,10 +12,11 @@
'website': 'http://www.akretion.com',
'depends': ['mrp'],
'data': [
'security/ir.model.access.csv',
'views/mrp_production.xml',
'views/product_template.xml',
'views/stock_move_line.xml',
# 'report/mrp_report.xml' # TODO
'report/mrp_report.xml'
],
'installable': True,
}

View File

@@ -3,14 +3,14 @@
<template id="report_mrporder" inherit_id="mrp.report_mrporder">
<xpath expr="//table[1]//thead//th[1]" position="before">
<th t-if="has_serial_number">Lot</th>
</xpath>
<xpath expr="//table[1]//tbody//td[1]" position="before">
<td t-if="has_serial_number"><span t-field="ml.lot_id"/></td>
<xpath expr="//span[@t-field='o.product_qty']/.." position="after">
<div class="col-3" t-if="o.lot_producing_id">
<strong>Lot:</strong><br/>
<span t-field="o.lot_producing_id"/>
</div>
</xpath>
<!--
<xpath expr="//div[hasclass('oe_structure')][2]" position="after">
<t t-set="has_product_unavailable"
t-value="any(o.move_raw_ids.filtered(lambda x: x.product_uom_qty &gt; x.reserved_availability))"/>
@@ -42,7 +42,7 @@
</tbody>
</table>
</xpath>
-->
</template>
</odoo>

View File

@@ -0,0 +1,3 @@
id,name,model_id:id,group_id:id,perm_read,perm_write,perm_create,perm_unlink
mrp.access_uom_category_mrp_manager,Read access on uom.category (inherited in usability module to remove full access),uom.model_uom_category,mrp.group_mrp_manager,1,0,0,0
mrp.access_uom_uom_mrp_manager,Read access on uom.uom (inherited in usability module to remove full access),uom.model_uom_uom,mrp.group_mrp_manager,1,0,0,0
1 id name model_id:id group_id:id perm_read perm_write perm_create perm_unlink
2 mrp.access_uom_category_mrp_manager Read access on uom.category (inherited in usability module to remove full access) uom.model_uom_category mrp.group_mrp_manager 1 0 0 0
3 mrp.access_uom_uom_mrp_manager Read access on uom.uom (inherited in usability module to remove full access) uom.model_uom_uom mrp.group_mrp_manager 1 0 0 0

View File

@@ -1,20 +1,20 @@
<?xml version="1.0" encoding="utf-8" ?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<meta name="generator" content="Docutils 0.14: http://docutils.sourceforge.net/" />
<meta name="generator" content="Docutils: https://docutils.sourceforge.io/" />
<title>MRP Usability</title>
<style type="text/css">
/*
:Author: David Goodger (goodger@python.org)
:Id: $Id: html4css1.css 7952 2016-07-26 18:15:59Z milde $
:Id: $Id: html4css1.css 9511 2024-01-13 09:50:07Z milde $
:Copyright: This stylesheet has been placed in the public domain.
Default cascading style sheet for the HTML output of Docutils.
Despite the name, some widely supported CSS2 features are used.
See http://docutils.sf.net/docs/howto/html-stylesheets.html for how to
See https://docutils.sourceforge.io/docs/howto/html-stylesheets.html for how to
customize this style sheet.
*/
@@ -275,7 +275,7 @@ pre.literal-block, pre.doctest-block, pre.math, pre.code {
margin-left: 2em ;
margin-right: 2em }
pre.code .ln { color: grey; } /* line numbers */
pre.code .ln { color: gray; } /* line numbers */
pre.code, code { background-color: #eeeeee }
pre.code .comment, code .comment { color: #5C6576 }
pre.code .keyword, code .keyword { color: #3B0D06; font-weight: bold }
@@ -301,7 +301,7 @@ span.option {
span.pre {
white-space: pre }
span.problematic {
span.problematic, pre.problematic {
color: red }
span.section-subtitle {
@@ -366,8 +366,10 @@ ul.auto-toc {
<!-- !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
!! This file is generated by oca-gen-addon-readme !!
!! changes will be overwritten. !!
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
!! source digest: sha256:020a9d9474cfd9d4445a4ea664e6acbfdb6c863d85029a3bad67962b934be139
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! -->
<p><a class="reference external" 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" 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" href="https://github.com/akretion/odoo-usability/tree/12.0/mrp_usability"><img alt="akretion/odoo-usability" src="https://img.shields.io/badge/github-akretion%2Fodoo--usability-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/akretion/odoo-usability/tree/14.0/mrp_usability"><img alt="akretion/odoo-usability" src="https://img.shields.io/badge/github-akretion%2Fodoo--usability-lightgray.png?logo=github" /></a></p>
<p>Small usability improvements on MRP:</p>
<ul class="simple">
<li>order by id desc</li>
@@ -375,42 +377,44 @@ ul.auto-toc {
<li>show more fields on stock move form</li>
<li>show bom type in tree view + add group by</li>
<li>complete Manufacturing Order report with unvailable products</li>
<li>improve smart button from products to BoMs (display BoM form if only one instead of displaying a list of one)</li>
</ul>
<p><strong>Table of contents</strong></p>
<div class="contents local topic" id="contents">
<ul class="simple">
<li><a class="reference internal" href="#bug-tracker" id="id1">Bug Tracker</a></li>
<li><a class="reference internal" href="#credits" id="id2">Credits</a><ul>
<li><a class="reference internal" href="#authors" id="id3">Authors</a></li>
<li><a class="reference internal" href="#contributors" id="id4">Contributors</a></li>
<li><a class="reference internal" href="#maintainers" id="id5">Maintainers</a></li>
<li><a class="reference internal" href="#bug-tracker" id="toc-entry-1">Bug Tracker</a></li>
<li><a class="reference internal" href="#credits" id="toc-entry-2">Credits</a><ul>
<li><a class="reference internal" href="#authors" id="toc-entry-3">Authors</a></li>
<li><a class="reference internal" href="#contributors" id="toc-entry-4">Contributors</a></li>
<li><a class="reference internal" href="#maintainers" id="toc-entry-5">Maintainers</a></li>
</ul>
</li>
</ul>
</div>
<div class="section" id="bug-tracker">
<h1><a class="toc-backref" href="#id1">Bug Tracker</a></h1>
<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/akretion/odoo-usability/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 smashing it by providing a detailed and welcomed
<a class="reference external" href="https://github.com/akretion/odoo-usability/issues/new?body=module:%20mrp_usability%0Aversion:%2012.0%0A%0A**Steps%20to%20reproduce**%0A-%20...%0A%0A**Current%20behavior**%0A%0A**Expected%20behavior**">feedback</a>.</p>
If you spotted it first, help us to smash it by providing a detailed and welcomed
<a class="reference external" href="https://github.com/akretion/odoo-usability/issues/new?body=module:%20mrp_usability%0Aversion:%2014.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">
<h1><a class="toc-backref" href="#id2">Credits</a></h1>
<h1><a class="toc-backref" href="#toc-entry-2">Credits</a></h1>
<div class="section" id="authors">
<h2><a class="toc-backref" href="#id3">Authors</a></h2>
<h2><a class="toc-backref" href="#toc-entry-3">Authors</a></h2>
<ul class="simple">
<li>Akretion</li>
</ul>
</div>
<div class="section" id="contributors">
<h2><a class="toc-backref" href="#id4">Contributors</a></h2>
<p>Alexis de Lattre &lt;<a class="reference external" href="mailto:alexis.delattre&#64;akretion.com">alexis.delattre&#64;akretion.com</a>&gt;</p>
<h2><a class="toc-backref" href="#toc-entry-4">Contributors</a></h2>
<p>Alexis de Lattre &lt;<a class="reference external" href="mailto:alexis.delattre&#64;akretion.com">alexis.delattre&#64;akretion.com</a>&gt;
David Béal &lt;<a class="reference external" href="mailto:david.beal&#64;akretion.com">david.beal&#64;akretion.com</a>&gt;</p>
</div>
<div class="section" id="maintainers">
<h2><a class="toc-backref" href="#id5">Maintainers</a></h2>
<p>This module is part of the <a class="reference external" href="https://github.com/akretion/odoo-usability/tree/12.0/mrp_usability">akretion/odoo-usability</a> project on GitHub.</p>
<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/akretion/odoo-usability/tree/14.0/mrp_usability">akretion/odoo-usability</a> project on GitHub.</p>
<p>You are welcome to contribute.</p>
</div>
</div>

Binary file not shown.

After

Width:  |  Height:  |  Size: 9.2 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 9.2 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 9.2 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 9.2 KiB

View File

@@ -27,6 +27,7 @@ Akretion:
"website": "http://www.akretion.com",
"depends": ["point_of_sale"],
"data": [
"security/ir.model.access.csv",
"report/pos.xml",
"views/report_pos_order.xml",
"views/pos_category.xml",

View File

@@ -0,0 +1,3 @@
id,name,model_id:id,group_id:id,perm_read,perm_write,perm_create,perm_unlink
point_of_sale.access_uom_uom_manager,Read access on uom.uom (inherited in usability module to remove full access),uom.model_uom_uom,point_of_sale.group_pos_manager,1,0,0,0
1 id name model_id:id group_id:id perm_read perm_write perm_create perm_unlink
2 point_of_sale.access_uom_uom_manager Read access on uom.uom (inherited in usability module to remove full access) uom.model_uom_uom point_of_sale.group_pos_manager 1 0 0 0

View File

@@ -8,19 +8,33 @@
<odoo>
<record id="view_report_pos_order_search" model="ir.ui.view">
<field name="model">report.pos.order</field>
<field name="inherit_id" ref="point_of_sale.view_report_pos_order_search"/>
<field name="arch" type="xml">
<field name="product_categ_id" position="after">
<field name="session_id"/>
</field>
<field name="model">report.pos.order</field>
<field name="inherit_id" ref="point_of_sale.view_report_pos_order_search"/>
<field name="arch" type="xml">
<field name="product_categ_id" position="after">
<field name="session_id"/>
</field>
<filter name="filter_date" position="before">
<filter name="date_today" string="Today" domain="[('date', '&gt;=', (datetime.datetime.combine(context_today(), datetime.time(0, 0, 0))).strftime('%Y-%m-%d %H:%M:%S'))]"/>
<filter name="date_yesterday" string="Yesterday" domain="[('date', '&gt;=', (datetime.datetime.combine(context_today() + relativedelta(days=-1), datetime.time(0, 0, 0))).strftime('%Y-%m-%d %H:%M:%S')), ('date', '&lt;', (datetime.datetime.combine(context_today(), datetime.time(0, 0, 0))).strftime('%Y-%m-%d %H:%M:%S'))]"/>
</filter>
</field>
</record>
<record id="point_of_sale.action_report_pos_order_all" model="ir.actions.act_window">
<field name="view_mode">pivot,graph</field> <!-- invert native order -->
</record>
<record id="view_report_pos_order_pivot" model="ir.ui.view">
<field name="name">usability.report.pos.order.pivot</field>
<field name="model">report.pos.order</field>
<field name="inherit_id" ref="point_of_sale.view_report_pos_order_pivot"/>
<field name="arch" type="xml">
<!-- Remove order_id from default measures -->
<field name="order_id" type="measure" position="replace"/>
</field>
</record>
</odoo>

Binary file not shown.

After

Width:  |  Height:  |  Size: 9.2 KiB

Some files were not shown because too many files have changed in this diff Show More