Compare commits

..

1 Commits

Author SHA1 Message Date
Clément Mombereau
c88e7b0bb4 [ADD] new module project_task_report 2024-12-09 12:32:12 -03:00
405 changed files with 2705 additions and 1937 deletions

View File

@@ -0,0 +1,18 @@
# Copyright 2022 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': 'Account Menu Usability',
'version': '14.0.1.0.0',
'category': 'Accounting & Finance',
'license': 'AGPL-3',
'summary': 'Small usability enhancements in account_menu module',
'author': 'Akretion',
'website': 'https://github.com/akretion/odoo-usability',
'depends': ['account_menu'],
'data': [
'views/account_menu.xml',
],
'installable': False,
}

View File

@@ -0,0 +1,20 @@
<?xml version="1.0" encoding="utf-8"?>
<!--
Copyright 2022 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>
<!-- Accounting Templates are useful only when creating a new company/loading
a chart of accounts, so we put it under 'Settings > Technical' and not
under 'Invoicing > Configuration' which already has a lot of menu entries -->
<record id="account_menu.menu_account_coa_settings" model="ir.ui.menu">
<field name="name">Accounting Templates</field>
<field name="parent_id" ref="base.menu_custom"/>
</record>
</odoo>

View File

@@ -29,5 +29,4 @@ This module has been written by Alexis de Lattre from Akretion
'depends': ['pos_sale', 'account_product_fiscal_classification'], 'depends': ['pos_sale', 'account_product_fiscal_classification'],
"data": ['report/sale_report_view.xml'], "data": ['report/sale_report_view.xml'],
'auto_install': True, 'auto_install': True,
'installable': False,
} }

View File

@@ -2,13 +2,10 @@
Account Usability Account Usability
================= =================
.. .. !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
!! This file is generated by oca-gen-addon-readme !! !! This file is generated by oca-gen-addon-readme !!
!! changes will be overwritten. !! !! changes will be overwritten. !!
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
!! source digest: sha256:dbf367e7cf8330c803622d0c171cd10e128344d318466d6e37ad7b0fc812e152
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
.. |badge1| image:: https://img.shields.io/badge/maturity-Beta-yellow.png .. |badge1| image:: https://img.shields.io/badge/maturity-Beta-yellow.png
:target: https://odoo-community.org/page/development-status :target: https://odoo-community.org/page/development-status
@@ -17,7 +14,7 @@ Account Usability
:target: http://www.gnu.org/licenses/agpl-3.0-standalone.html :target: http://www.gnu.org/licenses/agpl-3.0-standalone.html
:alt: License: AGPL-3 :alt: License: AGPL-3
.. |badge3| image:: https://img.shields.io/badge/github-akretion%2Fodoo--usability-lightgray.png?logo=github .. |badge3| image:: https://img.shields.io/badge/github-akretion%2Fodoo--usability-lightgray.png?logo=github
:target: https://github.com/akretion/odoo-usability/tree/18.0/account_usability_akretion :target: https://github.com/akretion/odoo-usability/tree/12.0/account_usability
:alt: akretion/odoo-usability :alt: akretion/odoo-usability
|badge1| |badge2| |badge3| |badge1| |badge2| |badge3|
@@ -26,14 +23,14 @@ This modules adds the following functions:
* Add an *Overdue* filter on invoice search view (this feature was previously * Add an *Overdue* filter on invoice search view (this feature was previously
located in te module *account_invoice_overdue_filter*) located in te module *account_invoice_overdue_filter*)
* Increase the default limit of 80 lines in account move and account move line view. * Increase the default limit of 80 lines in journal entries and journal items views.
* disable reconciliation "guessing" * disable reconciliation "guessing"
* fast search on *Reconcile Ref* for account move line. * fast search on *Reconcile Ref* for journal items.
* add sale dates to invoice report to be compliant with * add sale dates to invoice report to be compliant with
https://www.service-public.fr/professionnels-entreprises/vosdroits/F31808 https://www.service-public.fr/professionnels-entreprises/vosdroits/F31808
* Sale date on qweb invoices * Sale date on qweb invoices
* A wizard to mark several invoices as sent at once (forward from v8) * A wizard to mark several invoices as sent at once (forward from v8)
* Default date for Account Move Reversal is now D+1 instead of today * Default date for reversal journal entry is now D+1 instead of today
* Track more fields on invoice (see details in account.py) * Track more fields on invoice (see details in account.py)
* Add boolean fields `has_discount` and `has_attachment` on invoice * Add boolean fields `has_discount` and `has_attachment` on invoice
* Add button "Delete line qty = 0" on supplier invoice * Add button "Delete line qty = 0" on supplier invoice
@@ -44,8 +41,8 @@ This modules adds the following functions:
* add direct search of journal using code * add direct search of journal using code
* add copy=False on some fields * add copy=False on some fields
* Add unicity constraint on analytic codes per company * Add unicity constraint on analytic codes per company
* Better default values on account move * Better default values on journal entry
* Add link from account move line to invoice * Add link from journal items to to invoice
* Add start_date and end_date on bank statements * Add start_date and end_date on bank statements
* Add transfer_account_id to invoicing config page * Add transfer_account_id to invoicing config page
* Improve domain reconciliation widget * Improve domain reconciliation widget
@@ -55,6 +52,7 @@ This modules adds the following functions:
* don't attach PDF upon invoice report generation on supplier invoices/refunds * don't attach PDF upon invoice report generation on supplier invoices/refunds
* Add filter on debit and credit amount for Move Lines * Add filter on debit and credit amount for Move Lines
* Add supplier invoice number in invoice tree view * 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: Together with this module, I recommend the use of the following modules:
@@ -72,8 +70,8 @@ Bug Tracker
Bugs are tracked on `GitHub Issues <https://github.com/akretion/odoo-usability/issues>`_. 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. 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 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_akretion%0Aversion:%2018.0%0A%0A**Steps%20to%20reproduce**%0A-%20...%0A%0A**Current%20behavior**%0A%0A**Expected%20behavior**>`_. `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**>`_.
Do not contact contributors directly about support or help with technical issues. Do not contact contributors directly about support or help with technical issues.
@@ -94,6 +92,6 @@ Contributors
Maintainers Maintainers
~~~~~~~~~~~ ~~~~~~~~~~~
This module is part of the `akretion/odoo-usability <https://github.com/akretion/odoo-usability/tree/18.0/account_usability_akretion>`_ project on GitHub. This module is part of the `akretion/odoo-usability <https://github.com/akretion/odoo-usability/tree/12.0/account_usability>`_ project on GitHub.
You are welcome to contribute. You are welcome to contribute.

View File

@@ -1,3 +1,3 @@
from . import models from . import models
from . import wizards from . import wizard
# from .hooks import post_init_hook from .hooks import post_init_hook

View File

@@ -1,10 +1,10 @@
# Copyright 2015-2024 Akretion France (https://www.akretion.com) # Copyright 2015-2022 Akretion (http://www.akretion.com)
# @author Alexis de Lattre <alexis.delattre@akretion.com> # @author Alexis de Lattre <alexis.delattre@akretion.com>
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl). # License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).
{ {
'name': 'Account Usability', 'name': 'Account Usability',
'version': '18.0.1.0.0', 'version': '16.0.1.0.0',
'category': 'Accounting & Finance', 'category': 'Accounting & Finance',
'license': 'AGPL-3', 'license': 'AGPL-3',
'summary': 'Small usability enhancements in account module', 'summary': 'Small usability enhancements in account module',
@@ -12,7 +12,7 @@
'website': 'https://github.com/akretion/odoo-usability', 'website': 'https://github.com/akretion/odoo-usability',
'depends': [ 'depends': [
'account', 'account',
'base_usability_akretion', # needed only to access base_usability.group_nobody 'base_usability', # needed only to access base_usability.group_nobody
], ],
'data': [ 'data': [
'views/account_account.xml', 'views/account_account.xml',
@@ -21,17 +21,16 @@
'views/account_invoice_report.xml', 'views/account_invoice_report.xml',
'views/account_journal.xml', 'views/account_journal.xml',
'views/account_move.xml', 'views/account_move.xml',
'views/account_move_line.xml',
'views/account_payment.xml',
'views/account_analytic_line.xml', 'views/account_analytic_line.xml',
'views/account_menu.xml', 'views/account_menu.xml',
'views/account_tax.xml', 'views/account_tax.xml',
# 'views/product.xml', # TODO # 'views/product.xml', # TODO
'views/res_company.xml', 'views/res_company.xml',
# 'views/account_report.xml', 'views/account_report.xml',
'wizards/account_invoice_mark_sent_view.xml', 'wizard/account_invoice_mark_sent_view.xml',
# 'wizards/account_group_generate_view.xml', 'wizard/account_group_generate_view.xml',
'wizards/account_move_reversal.xml', 'wizard/account_payment_register_views.xml',
'wizard/account_move_reversal.xml',
'security/ir.model.access.csv', 'security/ir.model.access.csv',
# 'report/invoice_report.xml', # TODO # 'report/invoice_report.xml', # TODO
"views/res_partner.xml", "views/res_partner.xml",

View File

@@ -2,8 +2,8 @@
# @author Sébastien BEAU <sebastien.beau@akretion.com> # @author Sébastien BEAU <sebastien.beau@akretion.com>
# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl). # License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl).
# from odoo import SUPERUSER_ID, api from odoo import SUPERUSER_ID, api
# def post_init_hook(cr, registry): def post_init_hook(cr, registry):
# env = api.Environment(cr, SUPERUSER_ID, {}) env = api.Environment(cr, SUPERUSER_ID, {})
# env["account.move.line"].update_matching_number() env["account.move.line"].update_matching_number()

View File

@@ -0,0 +1,9 @@
# Copyright 2020 ACSONE SA/NV
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).
from odoo import SUPERUSER_ID, api
def migrate(cr, version):
env = api.Environment(cr, SUPERUSER_ID, {})
env["account.move.line"].update_matching_number()

View File

@@ -1,10 +1,12 @@
from . import account_account
from . import account_analytic_account from . import account_analytic_account
#from . import account_bank_statement
from . import account_incoterms from . import account_incoterms
from . import account_journal from . import account_journal
from . import account_move from . import account_move
from . import account_move_line
from . import account_partial_reconcile from . import account_partial_reconcile
from . import res_partner from . import res_partner
from . import res_company from . import res_company
#from . import product #from . import product
from . import account_invoice_report from . import account_invoice_report
from . import res_partner_bank

View File

@@ -0,0 +1,19 @@
# Copyright 2015-2022 Akretion (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, models
class AccountAccount(models.Model):
_inherit = 'account.account'
@api.depends('name', 'code')
def name_get(self):
if self._context.get('account_account_show_code_only'):
res = []
for record in self:
res.append((record.id, record.code))
return res
else:
return super().name_get()

View File

@@ -1,20 +1,21 @@
# Copyright 2015-2024 Akretion France (https://www.akretion.com) # Copyright 2015-2022 Akretion (http://www.akretion.com)
# @author Alexis de Lattre <alexis.delattre@akretion.com> # @author Alexis de Lattre <alexis.delattre@akretion.com>
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl). # License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).
from odoo import api, models from odoo import models
class AccountAnalyticAccount(models.Model): class AccountAnalyticAccount(models.Model):
_inherit = 'account.analytic.account' _inherit = 'account.analytic.account'
@api.depends_context('analytic_account_show_code_only') def name_get(self):
def _compute_display_name(self):
if self._context.get('analytic_account_show_code_only'): if self._context.get('analytic_account_show_code_only'):
for rec in self: res = []
rec.display_name = rec.code or rec.name for record in self:
res.append((record.id, record.code or record.name))
return res
else: else:
return super()._compute_display_name() return super().name_get()
_sql_constraints = [( _sql_constraints = [(
'code_company_unique', 'code_company_unique',

View File

@@ -0,0 +1,104 @@
# Copyright 2015-2020 Akretion (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.misc import format_date
class AccountBankStatement(models.Model):
_inherit = 'account.bank.statement'
start_date = fields.Date(
compute='_compute_dates', string='Start Date', store=True)
end_date = fields.Date(
compute='_compute_dates', string='End Date', store=True)
line_count = fields.Integer(
compute='_compute_dates', string='# of Lines', store=True)
hide_bank_statement_balance = fields.Boolean(
related='journal_id.hide_bank_statement_balance', readonly=True)
@api.depends('line_ids.date')
def _compute_dates(self):
for st in self:
dates = [line.date for line in st.line_ids]
st.start_date = dates and min(dates) or False
st.end_date = dates and max(dates) or False
st.line_count = len(dates)
def _check_balance_end_real_same_as_computed(self):
for stmt in self:
if not stmt.hide_bank_statement_balance:
super(AccountBankStatement, stmt)._check_balance_end_real_same_as_computed()
return True
@api.depends('name', 'start_date', 'end_date')
def name_get(self):
res = []
for statement in self:
name = "%s (%s => %s)" % (
statement.name,
statement.start_date and format_date(self.env, statement.start_date) or '',
statement.end_date and format_date(self.env, statement.end_date) or '')
res.append((statement.id, name))
return res
def button_reopen(self):
self = self.with_context(skip_undo_reconciliation=True)
return super().button_reopen()
def button_undo_reconciliation(self):
self.line_ids.button_undo_reconciliation()
class AccountBankStatementLine(models.Model):
_inherit = 'account.bank.statement.line'
# Native order is:
# _order = 'statement_id desc, sequence, id desc'
_order = 'statement_id desc, date desc, sequence, id desc'
# Disable guessing for reconciliation
# because my experience with several customers shows that it is a problem
# in the following scenario : move line 'x' has been "guessed" by OpenERP
# to be reconciled with a statement line 'Y' at the end of the bank
# statement, but it is a mistake because it should be reconciled with
# statement line 'B' at the beginning of the bank statement
# When the user is on statement line 'B', he tries to select
# move line 'x', but it can't find it... because it is already "reserved"
# by the guess of OpenERP for statement line 'Y' ! To solve this problem,
# the user must go to statement line 'Y' and unselect move line 'x'
# and then come back on statement line 'B' and select move line 'A'...
# but non super-expert users can't do that because it is impossible to
# figure out that the fact that the user can't find move line 'x'
# is caused by this.
# Set search_reconciliation_proposition to False by default
# TODO: re-write in v10
# def get_data_for_reconciliations(
# self, cr, uid, ids, excluded_ids=None,
# search_reconciliation_proposition=False, context=None):
# # Make variable name shorted for PEP8 !
# search_rec_prop = search_reconciliation_proposition
# return super().\
# get_data_for_reconciliations(
# cr, uid, ids, excluded_ids=excluded_ids,
# search_reconciliation_proposition=search_rec_prop,
# context=context)
def show_account_move(self):
self.ensure_one()
action = self.env["ir.actions.actions"]._for_xml_id(
'account.action_move_line_form')
# Note: this action is on account.move, not account.move.line !
action.update({
'views': False,
'view_id': False,
'view_mode': 'form,tree',
'res_id': self.move_id.id,
})
return action
def button_undo_reconciliation(self):
if self._context.get("skip_undo_reconciliation"):
return
else:
return super().button_undo_reconciliation()

View File

@@ -1,15 +1,31 @@
# Copyright 2015-2024 Akretion France (https://www.akretion.com) # Copyright 2015-2022 Akretion (http://www.akretion.com)
# @author Alexis de Lattre <alexis.delattre@akretion.com> # @author Alexis de Lattre <alexis.delattre@akretion.com>
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl). # License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).
from odoo import models from odoo import api, models
class AccountIncoterms(models.Model): class AccountIncoterms(models.Model):
_inherit = 'account.incoterms' _inherit = 'account.incoterms'
_rec_names_search = ["name", "code"]
_sql_constraints = [( _sql_constraints = [(
'code_unique', 'code_unique',
'unique(code)', 'unique(code)',
'This incoterm code already exists.')] 'This incoterm code already exists.')]
@api.depends('code', 'name')
def name_get(self):
res = []
for rec in self:
res.append((rec.id, '[%s] %s' % (rec.code, rec.name)))
return res
@api.model
def name_search(self, name='', args=None, operator='ilike', limit=100):
if args is None:
args = []
if name and operator == 'ilike':
recs = self.search([('code', '=ilike', name + '%')] + args, limit=limit)
if recs:
return recs.name_get()
return super().name_search(name=name, args=args, operator=operator, limit=limit)

View File

@@ -1,9 +1,8 @@
# Copyright 2022-2024 Akretion France (https://www.akretion.com) # Copyright 2022 Akretion (http://www.akretion.com)
# @author Alexis de Lattre <alexis.delattre@akretion.com> # @author Alexis de Lattre <alexis.delattre@akretion.com>
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl). # License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).
from odoo import api, fields, models from odoo import api, fields, models
from odoo.tools import SQL
class AccountInvoiceReport(models.Model): class AccountInvoiceReport(models.Model):
@@ -13,6 +12,6 @@ class AccountInvoiceReport(models.Model):
@api.model @api.model
def _select(self): def _select(self):
return SQL( res = super()._select()
"%s, COALESCE(partner.industry_id, commercial_partner.industry_id) AS industry_id", res += ", COALESCE(partner.industry_id, commercial_partner.industry_id) AS industry_id"
super()._select()) return res

View File

@@ -1,4 +1,4 @@
# Copyright 2015-2024 Akretion France (https://www.akretion.com) # Copyright 2015-2022 Akretion (http://www.akretion.com)
# @author Alexis de Lattre <alexis.delattre@akretion.com> # @author Alexis de Lattre <alexis.delattre@akretion.com>
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl). # License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).
@@ -17,34 +17,41 @@ class AccountJournal(models.Model):
"the start/end balance and you regularly check the accounting balance " "the start/end balance and you regularly check the accounting balance "
"of the bank account vs the amount of your bank account." "of the bank account vs the amount of your bank account."
) )
# Used to set default user_type_id on account fields via context
# account_type_current_assets_id = fields.Many2one(
# 'account.account.type',
# default=lambda self: self.env.ref('account.data_account_type_current_assets').id)
@api.depends('name', 'currency_id', 'company_id', 'code') @api.depends(
@api.depends_context('journal_show_code_only') 'name', 'currency_id', 'company_id', 'company_id.currency_id', 'code')
def _compute_display_name(self): def name_get(self):
res = []
if self._context.get('journal_show_code_only'): if self._context.get('journal_show_code_only'):
for journal in self: for journal in self:
journal.display_name = journal.code res.append((journal.id, journal.code))
return res
else: else:
for journal in self: for journal in self:
name = f"[{journal.code}] {journal.name}" name = "[%s] %s" % (journal.code, journal.name)
if ( if (
journal.currency_id and journal.currency_id and
journal.currency_id != journal.company_id.currency_id): journal.currency_id != journal.company_id.currency_id):
name = f"{name} ({journal.currency_id.name})" name = "%s (%s)" % (name, journal.currency_id.name)
journal.display_name = name res.append((journal.id, name))
return res
# def open_outstanding_payments(self): def open_outstanding_payments(self):
# self.ensure_one() self.ensure_one()
# action = self.env["ir.actions.actions"]._for_xml_id( action = self.env["ir.actions.actions"]._for_xml_id(
# "account.action_account_moves_all") "account.action_account_moves_all")
# action['domain'] = [ action['domain'] = [
# ('account_id', 'in', (self.payment_debit_account_id.id, self.payment_credit_account_id.id)), ('account_id', 'in', (self.payment_debit_account_id.id, self.payment_credit_account_id.id)),
# ('journal_id', '=', self.id), ('journal_id', '=', self.id),
# ('display_type', 'not in', ('line_section', 'line_note')), ('display_type', 'not in', ('line_section', 'line_note')),
# ('parent_state', '!=', 'cancel'), ('parent_state', '!=', 'cancel'),
# ] ]
# action['context'] = { action['context'] = {
# 'search_default_unreconciled': True, 'search_default_unreconciled': True,
# 'search_default_posted': True, 'search_default_posted': True,
# } }
# return action return action

View File

@@ -1,14 +1,17 @@
# Copyright 2015-2024 Akretion France (https://www.akretion.com) # Copyright 2015-2022 Akretion (http://www.akretion.com)
# @author Alexis de Lattre <alexis.delattre@akretion.com> # @author Alexis de Lattre <alexis.delattre@akretion.com>
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl). # License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).
from datetime import timedelta from datetime import timedelta
from collections import defaultdict
import logging import logging
from odoo import api, fields, models, _ from odoo import api, fields, models, _
from odoo.exceptions import UserError
from odoo.osv import expression from odoo.osv import expression
from odoo.tools import float_is_zero from odoo.tools import float_is_zero
from odoo.tools.misc import format_date from odoo.tools.misc import format_date
from odoo.tools.safe_eval import safe_eval, time
_logger = logging.getLogger(__name__) _logger = logging.getLogger(__name__)
@@ -16,6 +19,9 @@ _logger = logging.getLogger(__name__)
class AccountMove(models.Model): class AccountMove(models.Model):
_inherit = 'account.move' _inherit = 'account.move'
# By default, we can still modify "ref" when account move is posted
# which seems a bit lazy for me...
ref = fields.Char(states={'posted': [('readonly', True)]})
invoice_date_due = fields.Date(tracking=True) invoice_date_due = fields.Date(tracking=True)
invoice_payment_term_id = fields.Many2one(tracking=True) invoice_payment_term_id = fields.Many2one(tracking=True)
journal_id = fields.Many2one(tracking=True) journal_id = fields.Many2one(tracking=True)
@@ -32,34 +38,36 @@ class AccountMove(models.Model):
compute="_compute_sales_dates", compute="_compute_sales_dates",
help="This information appear on invoice qweb report " help="This information appear on invoice qweb report "
"(you may use it for your own report)") "(you may use it for your own report)")
# The native "blocked" field (bool) on account.move.line has been removed in v18 # There is a native "blocked" field (bool) on account.move.line
# blocked = fields.Boolean( # We want to have that field on invoices to improve usability
# compute="_compute_blocked", # while keeping compatibility with the standard Odoo datamodel
# inverse="_inverse_blocked", blocked = fields.Boolean(
# store=True, compute="_compute_blocked",
# string="Dispute", inverse="_inverse_blocked",
# tracking=True, store=True,
# ) string="Dispute",
tracking=True,
)
# Field search_account_id is just for search view # Field search_account_id is just for search view
search_account_id = fields.Many2one(related='line_ids.account_id') search_account_id = fields.Many2one(related='line_ids.account_id')
# @api.depends("line_ids", "line_ids.blocked") @api.depends("line_ids", "line_ids.blocked")
# def _compute_blocked(self): def _compute_blocked(self):
# for move in self: for move in self:
# move.blocked = any( move.blocked = any(
# [ [
# l.blocked l.blocked
# for l in move.line_ids for l in move.line_ids
# if l.account_id.account_type in ("liability_payable", "asset_receivable") if l.account_id.account_type in ("liability_payable", "asset_receivable")
# ] ]
# ) )
# def _inverse_blocked(self): def _inverse_blocked(self):
# for move in self: for move in self:
# for line in move.line_ids.filtered( for line in move.line_ids.filtered(
# lambda l: l.account_id.account_type in ("liability_payable", "asset_receivable") lambda l: l.account_id.account_type in ("liability_payable", "asset_receivable")
# ): ):
# line.blocked = move.blocked line.blocked = move.blocked
def _compute_has_discount(self): def _compute_has_discount(self):
prec = self.env['decimal.precision'].precision_get('Discount') prec = self.env['decimal.precision'].precision_get('Discount')
@@ -95,6 +103,35 @@ class AccountMove(models.Model):
res = [('id', value and 'in' or 'not in', list(att_inv_ids))] res = [('id', value and 'in' or 'not in', list(att_inv_ids))]
return res return res
# when you have an invoice created from a lot of sale orders, the 'name'
# field is very large, which makes the name_get() of that invoice very big
# which screws-up the form view of that invoice because of the link at the
# top of the screen
# That's why we have to cut the name_get() when it's too long
def name_get(self):
old_res = super().name_get()
res = []
for old_re in old_res:
name = old_re[1]
if name and len(name) > 100:
# nice cut
name = '%s ...' % ', '.join(name.split(', ')[:3])
# if not enough, hard cut
if len(name) > 120:
name = '%s ...' % old_re[1][:120]
res.append((old_re[0], name))
return res
def _reverse_moves(self, default_values_list=None, cancel=False):
reverse_moves = super()._reverse_moves(
default_values_list=default_values_list, cancel=cancel)
# In the simple scenario 1 invoice -> 1 refund, we add a message in the chatter
# of the invoice and in the chatter of the refund
if len(self) == 1 and len(reverse_moves) == 1:
self.message_post(body=_("A reverse journal entry <a href=# data-oe-model=account.move data-oe-id=%d>%s</a> has been generated.") % (reverse_moves.id, reverse_moves.display_name))
reverse_moves.message_post(body=_("This journal entry has been generated as the reverse of <a href=# data-oe-model=account.move data-oe-id=%d>%s</a>.") % (self.id, self.display_name))
return reverse_moves
def delete_lines_qty_zero(self): def delete_lines_qty_zero(self):
lines = self.env['account.move.line'].search([ lines = self.env['account.move.line'].search([
('display_type', '=', 'product'), ('display_type', '=', 'product'),
@@ -167,27 +204,94 @@ class AccountMove(models.Model):
]) ])
move.suitable_journal_ids = self.env['account.journal'].search(domain) move.suitable_journal_ids = self.env['account.journal'].search(domain)
# There is no more attachment by default on invoice reports... def button_draft(self):
# TODO check what's the editor strategy on this
# def button_draft(self):
# Delete attached pdf invoice # Delete attached pdf invoice
# for move in self.filtered(lambda x: x.move_type in ('out_invoice', 'out_refund')): for move in self.filtered(lambda x: x.move_type in ('out_invoice', 'out_refund')):
# for report_xmlid in ('account.account_invoices', 'account.account_invoices_without_payment'): for report_xmlid in ('account.account_invoices', 'account.account_invoices_without_payment'):
# report = self.env.ref(report_xmlid) report = self.env.ref(report_xmlid)
# attach = report.retrieve_attachment(move) attach = report.retrieve_attachment(move)
# if attach: if attach:
# attach.unlink() attach.unlink()
# super().button_draft() super().button_draft()
def _get_accounting_date(self, invoice_date, has_tax, lock_dates=None): def _get_accounting_date(self, invoice_date, has_tax):
# On vendor bills/refunds, we want date = invoice_date unless # On vendor bills/refunds, we want date = invoice_date unless
# we have a company tax_lock_date and the invoice has taxes # we have a company tax_lock_date and the invoice has taxes
# and invoice_date <= tax_lock_date # and invoice_date <= tax_lock_date
date = super()._get_accounting_date(invoice_date, has_tax, lock_dates=lock_dates) date = super()._get_accounting_date(invoice_date, has_tax)
lock_dates = lock_dates or self._get_violated_lock_dates(invoice_date, has_tax) if self.is_purchase_document(include_receipts=True):
if self.is_purchase_document(include_receipts=True) and invoice_date: tax_lock_date = self.company_id.tax_lock_date
if lock_dates: if invoice_date and tax_lock_date and has_tax and invoice_date <= tax_lock_date:
date = max([entry[0] for entry in lock_dates]) + timedelta(1) invoice_date = tax_lock_date + timedelta(days=1)
else:
date = invoice_date date = invoice_date
return date return date
class AccountMoveLine(models.Model):
_inherit = 'account.move.line'
# Native order:
# _order = "date desc, move_name desc, id"
# Problem: when you manually create a journal entry, the
# order of the lines is inverted when you save ! It is quite annoying for
# the user...
_order = "date desc, id asc"
# In the 'account' module, we have related stored field for:
# name (move_name), date, ref, state (parent_state),
# journal_id, company_id, payment_id, statement_line_id,
account_reconcile = fields.Boolean(related='account_id.reconcile')
full_reconcile_id = fields.Many2one(string='Full Reconcile')
matched_debit_ids = fields.One2many(string='Partial Reconcile Debit')
matched_credit_ids = fields.One2many(string='Partial Reconcile Credit')
# for optional display in tree view
product_barcode = fields.Char(related='product_id.barcode', string="Product Barcode")
def show_account_move_form(self):
self.ensure_one()
action = self.env["ir.actions.actions"]._for_xml_id(
'account.action_move_line_form')
action.update({
'res_id': self.move_id.id,
'view_id': False,
'views': False,
'view_mode': 'form,tree',
})
return action
def update_matching_number(self):
records = self.search([("matching_number", "=", "P")])
_logger.info(f"Update partial reconcile number for {len(records)} lines")
records._compute_matching_number()
# def _compute_matching_number(self):
# TODO maybe it will be better to have the same maching_number for
# all partial so it will be easier to group by
# super()._compute_matching_number()
# for record in self:
# if record.matching_number == "P":
# record.matching_number = ", ".join([
# "a%d" % pr.id
# for pr in record.matched_debit_ids + record.matched_credit_ids
# ])
def _compute_name(self):
# This is useful when you want to have the product code in a dedicated
# column in your customer invoice report
# The same ir.config_parameter is used in sale_usability,
# purchase_usability and account_usability
no_product_code_param = self.env['ir.config_parameter'].sudo().get_param(
'usability.line_name_no_product_code')
if no_product_code_param and no_product_code_param == 'True':
self = self.with_context(display_default_code=False)
return super()._compute_name()
def reconcile(self):
"""Explicit error message if unposted lines"""
unposted_ids = self.filtered(lambda l: l.move_id.state != "posted")
if unposted_ids:
m = _("Please post the following entries before reconciliation :")
sep = "\n - "
unpost = sep.join([am.display_name for am in unposted_ids.move_id])
raise UserError(m + sep + unpost)
return super().reconcile()

View File

@@ -1,70 +0,0 @@
# Copyright 2015-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
import logging
_logger = logging.getLogger(__name__)
class AccountMoveLine(models.Model):
_inherit = 'account.move.line'
# Native order:
# _order = "date desc, move_name desc, id"
# Problem: when you manually create a journal entry, the
# order of the lines is inverted when you save ! It is quite annoying for
# the user...
_order = "date desc, id asc"
# for optional display in list view
product_barcode = fields.Char(related='product_id.barcode', string="Product Barcode")
def show_account_move_form(self):
self.ensure_one()
action = self.env["ir.actions.actions"]._for_xml_id(
'account.action_move_line_form')
action.update({
'res_id': self.move_id.id,
'view_id': False,
'views': False,
'view_mode': 'form,list',
})
return action
# def update_matching_number(self):
# records = self.search([("matching_number", "=", "P")])
# _logger.info(f"Update partial reconcile number for {len(records)} lines")
# records._compute_matching_number()
# def _compute_matching_number(self):
# TODO maybe it will be better to have the same maching_number for
# all partial so it will be easier to group by
# super()._compute_matching_number()
# for record in self:
# if record.matching_number == "P":
# record.matching_number = ", ".join([
# "a%d" % pr.id
# for pr in record.matched_debit_ids + record.matched_credit_ids
# ])
def _compute_name(self):
# This is useful when you want to have the product code in a dedicated
# column in your customer invoice report
# The same ir.config_parameter is used in sale_usability,
# purchase_usability and account_usability
no_product_code_param = self.env['ir.config_parameter'].sudo().get_param(
'usability.line_name_no_product_code')
if no_product_code_param and no_product_code_param == 'True':
self = self.with_context(display_default_code=False)
return super()._compute_name()
# def reconcile(self):
# """Explicit error message if unposted lines"""
# unposted_ids = self.filtered(lambda l: l.move_id.state != "posted")
# if unposted_ids:
# m = _("Please post the following entries before reconciliation :")
# sep = "\n - "
# unpost = sep.join([am.display_name for am in unposted_ids.move_id])
# raise UserError(m + sep + unpost)
# return super().reconcile()

View File

@@ -3,21 +3,21 @@
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl). # License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).
from odoo import models from odoo import models
# from odoo.tools.misc import formatLang from odoo.tools.misc import formatLang
class AccountPartialReconcile(models.Model): class AccountPartialReconcile(models.Model):
_inherit = "account.partial.reconcile" _inherit = "account.partial.reconcile"
# _rec_name = "id" _rec_name = "id"
# def name_get(self): def name_get(self):
# res = [] res = []
# for rec in self: for rec in self:
# There is no seq for partial rec, so I simulate one with the ID # There is no seq for partial rec, so I simulate one with the ID
# Prefix for full rec: 'A' (upper case) # Prefix for full rec: 'A' (upper case)
# Prefix for partial rec: 'a' (lower case) # Prefix for partial rec: 'a' (lower case)
# amount_fmt = formatLang( amount_fmt = formatLang(
# self.env, rec.amount, currency_obj=rec.company_currency_id) self.env, rec.amount, currency_obj=rec.company_currency_id)
# name = 'a%d (%s)' % (rec.id, amount_fmt) name = 'a%d (%s)' % (rec.id, amount_fmt)
# res.append((rec.id, name)) res.append((rec.id, name))
# return res return res

View File

@@ -4,9 +4,6 @@
from odoo import api, fields, models, _ from odoo import api, fields, models, _
# CODE DISABLED FOR THE MOMENT. I need to decide if I want to drop it
# because native code is enough and if I want to re-enable it
class ProductTemplate(models.Model): class ProductTemplate(models.Model):
_inherit = 'product.template' _inherit = 'product.template'

View File

@@ -13,7 +13,7 @@ class ResCompany(models.Model):
# But there are several problems with this native field: # But there are several problems with this native field:
# - it is copied on the 'narration' field of account.move => we don't want that # - it is copied on the 'narration' field of account.move => we don't want that
# - the text block is very small on the form view of res.config.settings # - the text block is very small on the form view of res.config.settings
# So I decided to have our own field "static_invoice_terms" # So I decided to have our own field "fixed_invoice_terms"
# The native field can still be used when you need to customise some # The native field can still be used when you need to customise some
# terms and conditions on each invoice (not very common, but...) # terms and conditions on each invoice (not very common, but...)
# To underline this different with the native field, I prefix it with 'static_' # To underline this different with the native field, I prefix it with 'static_'

View File

@@ -1,4 +1,4 @@
# Copyright 2017-2024 Akretion France (https://akretion.com/) # Copyright 2017-2022 Akretion France (https://akretion.com/)
# @author: Alexis de Lattre <alexis.delattre@akretion.com> # @author: Alexis de Lattre <alexis.delattre@akretion.com>
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl). # License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).

View File

@@ -0,0 +1,21 @@
# Copyright 2015-2022 Akretion France (http://www.akretion.com/)
# @author: Mourad EL HADJ MIMOUNE <mourad.elhadj.mimoune@akretion.com>
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).
from odoo import models
class ResPartnerBank(models.Model):
_inherit = 'res.partner.bank'
def name_get(self):
res = []
for acc in self:
name = acc.acc_number
if acc.currency_id:
name = "%s (%s)" % (name, acc.currency_id.name)
if acc.bank_id.name:
name = "%s - %s" % (name, acc.bank_id.name)
res += [(acc.id, name)]
return res

View File

@@ -1,3 +0,0 @@
[build-system]
requires = ["whool"]
build-backend = "whool.buildapi"

View File

@@ -1,2 +1,3 @@
id,name,model_id:id,group_id:id,perm_read,perm_write,perm_create,perm_unlink id,name,model_id:id,group_id:id,perm_read,perm_write,perm_create,perm_unlink
access_account_group_generate_full,Full access on account.group.generate,model_account_group_generate,account.group_account_manager,1,1,1,1
access_account_invoice_mark_sent_full,Full access on account.invoice.mark.sent,model_account_invoice_mark_sent,account.group_account_invoice,1,1,1,1 access_account_invoice_mark_sent_full,Full access on account.invoice.mark.sent,model_account_invoice_mark_sent,account.group_account_invoice,1,1,1,1
1 id name model_id:id group_id:id perm_read perm_write perm_create perm_unlink
2 access_account_group_generate_full Full access on account.group.generate model_account_group_generate account.group_account_manager 1 1 1 1
3 access_account_invoice_mark_sent_full Full access on account.invoice.mark.sent model_account_invoice_mark_sent account.group_account_invoice 1 1 1 1

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"> <!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"> <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head> <head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<meta name="generator" content="Docutils: https://docutils.sourceforge.io/" /> <meta name="generator" content="Docutils 0.15.1: http://docutils.sourceforge.net/" />
<title>Account Usability</title> <title>Account Usability</title>
<style type="text/css"> <style type="text/css">
/* /*
:Author: David Goodger (goodger@python.org) :Author: David Goodger (goodger@python.org)
:Id: $Id: html4css1.css 9511 2024-01-13 09:50:07Z milde $ :Id: $Id: html4css1.css 7952 2016-07-26 18:15:59Z milde $
:Copyright: This stylesheet has been placed in the public domain. :Copyright: This stylesheet has been placed in the public domain.
Default cascading style sheet for the HTML output of Docutils. 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 See http://docutils.sf.net/docs/howto/html-stylesheets.html for how to
customize this style sheet. customize this style sheet.
*/ */
@@ -275,7 +275,7 @@ pre.literal-block, pre.doctest-block, pre.math, pre.code {
margin-left: 2em ; margin-left: 2em ;
margin-right: 2em } margin-right: 2em }
pre.code .ln { color: gray; } /* line numbers */ pre.code .ln { color: grey; } /* line numbers */
pre.code, code { background-color: #eeeeee } pre.code, code { background-color: #eeeeee }
pre.code .comment, code .comment { color: #5C6576 } pre.code .comment, code .comment { color: #5C6576 }
pre.code .keyword, code .keyword { color: #3B0D06; font-weight: bold } pre.code .keyword, code .keyword { color: #3B0D06; font-weight: bold }
@@ -301,7 +301,7 @@ span.option {
span.pre { span.pre {
white-space: pre } white-space: pre }
span.problematic, pre.problematic { span.problematic {
color: red } color: red }
span.section-subtitle { span.section-subtitle {
@@ -366,10 +366,8 @@ ul.auto-toc {
<!-- !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! <!-- !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
!! This file is generated by oca-gen-addon-readme !! !! This file is generated by oca-gen-addon-readme !!
!! changes will be overwritten. !! !! changes will be overwritten. !!
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
!! source digest: sha256:dbf367e7cf8330c803622d0c171cd10e128344d318466d6e37ad7b0fc812e152
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! --> !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! -->
<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/18.0/account_usability_akretion"><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" 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>This modules adds the following functions:</p> <p>This modules adds the following functions:</p>
<ul class="simple"> <ul class="simple">
<li>Add an <em>Overdue</em> filter on invoice search view (this feature was previously <li>Add an <em>Overdue</em> filter on invoice search view (this feature was previously
@@ -413,41 +411,41 @@ located in te module <em>account_invoice_overdue_filter</em>)</li>
<p><strong>Table of contents</strong></p> <p><strong>Table of contents</strong></p>
<div class="contents local topic" id="contents"> <div class="contents local topic" id="contents">
<ul class="simple"> <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="#bug-tracker" id="id1">Bug Tracker</a></li>
<li><a class="reference internal" href="#credits" id="toc-entry-2">Credits</a><ul> <li><a class="reference internal" href="#credits" id="id2">Credits</a><ul>
<li><a class="reference internal" href="#authors" id="toc-entry-3">Authors</a></li> <li><a class="reference internal" href="#authors" id="id3">Authors</a></li>
<li><a class="reference internal" href="#contributors" id="toc-entry-4">Contributors</a></li> <li><a class="reference internal" href="#contributors" id="id4">Contributors</a></li>
<li><a class="reference internal" href="#maintainers" id="toc-entry-5">Maintainers</a></li> <li><a class="reference internal" href="#maintainers" id="id5">Maintainers</a></li>
</ul> </ul>
</li> </li>
</ul> </ul>
</div> </div>
<div class="section" id="bug-tracker"> <div class="section" id="bug-tracker">
<h1><a class="toc-backref" href="#toc-entry-1">Bug Tracker</a></h1> <h1><a class="toc-backref" href="#id1">Bug Tracker</a></h1>
<p>Bugs are tracked on <a class="reference external" href="https://github.com/akretion/odoo-usability/issues">GitHub Issues</a>. <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. 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 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_akretion%0Aversion:%2018.0%0A%0A**Steps%20to%20reproduce**%0A-%20...%0A%0A**Current%20behavior**%0A%0A**Expected%20behavior**">feedback</a>.</p> <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>
<p>Do not contact contributors directly about support or help with technical issues.</p> <p>Do not contact contributors directly about support or help with technical issues.</p>
</div> </div>
<div class="section" id="credits"> <div class="section" id="credits">
<h1><a class="toc-backref" href="#toc-entry-2">Credits</a></h1> <h1><a class="toc-backref" href="#id2">Credits</a></h1>
<div class="section" id="authors"> <div class="section" id="authors">
<h2><a class="toc-backref" href="#toc-entry-3">Authors</a></h2> <h2><a class="toc-backref" href="#id3">Authors</a></h2>
<ul class="simple"> <ul class="simple">
<li>Akretion</li> <li>Akretion</li>
</ul> </ul>
</div> </div>
<div class="section" id="contributors"> <div class="section" id="contributors">
<h2><a class="toc-backref" href="#toc-entry-4">Contributors</a></h2> <h2><a class="toc-backref" href="#id4">Contributors</a></h2>
<ul class="simple"> <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>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> <li>David Beal &lt;<a class="reference external" href="mailto:david.beal&#64;akretion.com">david.beal&#64;akretion.com</a>&gt;</li>
</ul> </ul>
</div> </div>
<div class="section" id="maintainers"> <div class="section" id="maintainers">
<h2><a class="toc-backref" href="#toc-entry-5">Maintainers</a></h2> <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/18.0/account_usability_akretion">akretion/odoo-usability</a> project on GitHub.</p> <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>
<p>You are welcome to contribute.</p> <p>You are welcome to contribute.</p>
</div> </div>
</div> </div>

View File

@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="utf-8"?> <?xml version="1.0" encoding="utf-8"?>
<!-- <!--
Copyright 2015-2024 Akretion France (https://www.akretion.com/) Copyright 2015-2022 Akretion France (http://www.akretion.com/)
@author: Alexis de Lattre <alexis.delattre@akretion.com> @author: Alexis de Lattre <alexis.delattre@akretion.com>
License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl). License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).
--> -->
@@ -14,7 +14,7 @@
<field name="inherit_id" ref="account.view_account_form"/> <field name="inherit_id" ref="account.view_account_form"/>
<field name="arch" type="xml"> <field name="arch" type="xml">
<field name="deprecated" position="before"> <field name="deprecated" position="before">
<field name="reconcile" invisible="account_type in ('asset_cash', 'liability_credit_card', 'off_balance')" widget="boolean_toggle"/> <field name="reconcile" attrs="{'invisible': ['|', ('account_type', 'in', ('asset_cash', 'liability_credit_card')), ('internal_group', '=', 'off_balance')]}" widget="boolean_toggle"/>
</field> </field>
</field> </field>
</record> </record>
@@ -28,6 +28,9 @@
<field name="name" position="after"> <field name="name" position="after">
<field name="code" filter_domain="[('code', '=like', self + '%')]" string="Code"/> <field name="code" filter_domain="[('code', '=like', self + '%')]" string="Code"/>
</field> </field>
<filter name="accounttype" position="after">
<filter name="group_groupby" string="Group" context="{'group_by': 'group_id'}"/>
</filter>
</field> </field>
</record> </record>

View File

@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="utf-8"?> <?xml version="1.0" encoding="utf-8"?>
<!-- <!--
Copyright 2024 Akretion France (https://www.akretion.com/) Copyright 2024 Akretion France (http://www.akretion.com/)
@author: Alexis de Lattre <alexis.delattre@akretion.com> @author: Alexis de Lattre <alexis.delattre@akretion.com>
License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl). License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).
--> -->

View File

@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="utf-8"?> <?xml version="1.0" encoding="utf-8"?>
<!-- <!--
Copyright 2021-2024 Akretion France (https://www.akretion.com/) Copyright 2021-2022 Akretion France (http://www.akretion.com/)
@author: Alexis de Lattre <alexis.delattre@akretion.com> @author: Alexis de Lattre <alexis.delattre@akretion.com>
License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl). License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).
--> -->

View File

@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="utf-8"?> <?xml version="1.0" encoding="utf-8"?>
<!-- <!--
Copyright 2018-2024 Akretion (https://www.akretion.com/) Copyright 2018-2024 Akretion (http://www.akretion.com/)
@author: Alexis de Lattre <alexis.delattre@akretion.com> @author: Alexis de Lattre <alexis.delattre@akretion.com>
License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl). License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).
--> -->
@@ -15,6 +15,7 @@
<field name="arch" type="xml"> <field name="arch" type="xml">
<field name="partner_id" position="after"> <field name="partner_id" position="after">
<field name="commercial_partner_id" optional="hide"/> <field name="commercial_partner_id" optional="hide"/>
<field name="country_id" optional="hide"/>
<field name="industry_id" optional="hide"/> <field name="industry_id" optional="hide"/>
<field name="fiscal_position_id" optional="hide"/> <field name="fiscal_position_id" optional="hide"/>
</field> </field>
@@ -28,19 +29,12 @@
<field name="model">account.invoice.report</field> <field name="model">account.invoice.report</field>
<field name="inherit_id" ref="account.view_account_invoice_report_search"/> <field name="inherit_id" ref="account.view_account_invoice_report_search"/>
<field name="arch" type="xml"> <field name="arch" type="xml">
<field name="partner_id" position="after">
<field name="industry_id"/>
</field>
<filter name="category_product" position="after"> <filter name="category_product" position="after">
<filter string="Product" name="product_groupby" context="{'group_by': 'product_id', 'residual_invisible':True}"/> <filter string="Product" name="product_groupby" context="{'group_by': 'product_id', 'residual_invisible':True}"/>
</filter> </filter>
<filter name="partner_id" position="after">
<filter name="industry_groupby" string="Partner Industry" context="{'group_by': 'industry_id'}"/>
</filter>
</field> </field>
</record> </record>
<!-- pivot in first position instead of graph -->
<record id="account.action_account_invoice_report_all_supp" model="ir.actions.act_window"> <record id="account.action_account_invoice_report_all_supp" model="ir.actions.act_window">
<field name="view_mode">pivot,graph</field> <field name="view_mode">pivot,graph</field>
</record> </record>

View File

@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="utf-8"?> <?xml version="1.0" encoding="utf-8"?>
<!-- <!--
Copyright 2015-2024 Akretion France (https://www.akretion.com/) Copyright 2015-2022 Akretion France (http://www.akretion.com/)
@author: Alexis de Lattre <alexis.delattre@akretion.com> @author: Alexis de Lattre <alexis.delattre@akretion.com>
License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl). License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).
--> -->
@@ -13,13 +13,30 @@
<field name="inherit_id" ref="account.view_account_journal_form"/> <field name="inherit_id" ref="account.view_account_journal_form"/>
<field name="arch" type="xml"> <field name="arch" type="xml">
<xpath expr="//field[@name='account_control_ids']/.." position="after"> <xpath expr="//field[@name='account_control_ids']/.." position="after">
<group name="usability" string="Misc" invisible="type != 'bank'"> <group name="usability" string="Misc" attrs="{'invisible': [('type', '!=', 'bank')]}">
<field name="hide_bank_statement_balance" groups="account.group_account_readonly"/> <field name="hide_bank_statement_balance" groups="account.group_account_readonly"/>
</group> </group>
</xpath> </xpath>
<xpath expr="//field[@name='inbound_payment_method_line_ids']/tree/field[@name='payment_account_id']" position="attributes">
<attribute name="optional">show</attribute>
</xpath>
<xpath expr="//field[@name='outbound_payment_method_line_ids']/tree/field[@name='payment_account_id']" position="attributes">
<attribute name="optional">show</attribute>
</xpath>
<!--
<field name="suspense_account_id" position="attributes">
<attribute name="context">{'default_user_type_id': account_type_current_assets_id, 'default_reconcile': False}</attribute>
</field>
<field name="payment_debit_account_id" position="attributes">
<attribute name="context">{'default_user_type_id': account_type_current_assets_id, 'default_reconcile': True}</attribute>
</field>
<field name="payment_credit_account_id" position="attributes">
<attribute name="context">{'default_user_type_id': account_type_current_assets_id, 'default_reconcile': True}</attribute>
</field> -->
</field> </field>
</record> </record>
<!-- TODO
<record id="account_journal_dashboard_kanban_view" model="ir.ui.view"> <record id="account_journal_dashboard_kanban_view" model="ir.ui.view">
<field name="name">usability.account.journal.dashboard</field> <field name="name">usability.account.journal.dashboard</field>
<field name="model">account.journal</field> <field name="model">account.journal</field>
@@ -31,10 +48,9 @@
<xpath expr="//div[@name='latest_statement']/.." position="attributes"> <xpath expr="//div[@name='latest_statement']/.." position="attributes">
<attribute name="t-if">dashboard.has_at_least_one_statement and dashboard.account_balance != dashboard.last_balance and !record.hide_bank_statement_balance.raw_value</attribute> <attribute name="t-if">dashboard.has_at_least_one_statement and dashboard.account_balance != dashboard.last_balance and !record.hide_bank_statement_balance.raw_value</attribute>
</xpath> </xpath>
<!--
<t t-esc="dashboard.outstanding_pay_account_balance" position="replace"> <t t-esc="dashboard.outstanding_pay_account_balance" position="replace">
<a name="open_outstanding_payments" type="object" title="Outstanding Payments/Receipts"><t t-esc="dashboard.outstanding_pay_account_balance"/></a> <a name="open_outstanding_payments" type="object" title="Outstanding Payments/Receipts"><t t-esc="dashboard.outstanding_pay_account_balance"/></a>
</t> --> </t>
</field> </field>
</record> </record>
--> -->

View File

@@ -1,13 +1,13 @@
<?xml version="1.0" encoding="utf-8"?> <?xml version="1.0" encoding="utf-8"?>
<!-- <!--
Copyright 2015-2024 Akretion France (https://www.akretion.com/) Copyright 2015-2022 Akretion France (http://www.akretion.com/)
@author: Alexis de Lattre <alexis.delattre@akretion.com> @author: Alexis de Lattre <alexis.delattre@akretion.com>
License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl). License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).
--> -->
<odoo> <odoo>
<!-- Duplicate the menu "Bank Accounts" <!-- Duplicate the menu "Sales > Configuration > Contacts > Bank Accounts"
under "Accounting > Configuration", because most users will try to find it there --> under "Accounting > Configuration", because most users will try to find it there -->
<menuitem id="res_bank_account_config_menu" action="base.action_res_bank_form" parent="account.account_banks_menu" sequence="10"/> <menuitem id="res_bank_account_config_menu" action="base.action_res_bank_form" parent="account.account_banks_menu" sequence="10"/>

View File

@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="utf-8"?> <?xml version="1.0" encoding="utf-8"?>
<!-- <!--
Copyright 2015-2024 Akretion France (https://www.akretion.com/) Copyright 2015-2022 Akretion France (http://www.akretion.com/)
@author: Alexis de Lattre <alexis.delattre@akretion.com> @author: Alexis de Lattre <alexis.delattre@akretion.com>
License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl). License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).
--> -->
@@ -12,30 +12,37 @@
<field name="model">account.move</field> <field name="model">account.move</field>
<field name="inherit_id" ref="account.view_move_form"/> <field name="inherit_id" ref="account.view_move_form"/>
<field name="arch" type="xml"> <field name="arch" type="xml">
<!--
<field name="fiscal_position_id" position="attributes">
<attribute name="widget">selection</attribute>
</field>
<field name="invoice_incoterm_id" position="attributes">
<attribute name="widget">selection</attribute>
</field> -->
<button id="account_invoice_payment_btn" position="attributes"> <button id="account_invoice_payment_btn" position="attributes">
<attribute name="class">btn-default</attribute> <attribute name="class">btn-default</attribute>
</button> </button>
<button name="action_register_payment" position="before"> <button name="action_register_payment" position="before">
<button name="%(account.account_invoices)d" type="action" string="Print" invisible="move_type not in ('out_invoice', 'out_refund')"/> <button name="%(account.account_invoices)d" type="action" string="Print" attrs="{'invisible': [('move_type', 'not in', ('out_invoice', 'out_refund'))]}"/>
</button> </button>
<button name="preview_invoice" position="attributes"> <button name="preview_invoice" position="attributes">
<attribute name="attrs">{}</attribute>
<attribute name="invisible">1</attribute> <attribute name="invisible">1</attribute>
</button> </button>
<!-- move field is_move_sent and make it visible --> <!-- move sent field and make it visible -->
<field name="is_move_sent" position="replace"/> <field name="is_move_sent" position="replace"/>
<field name="invoice_origin" position="attributes"> <field name="invoice_origin" position="attributes">
<attribute name="invisible">0</attribute> <attribute name="invisible">0</attribute>
</field> </field>
<field name="invoice_origin" position="after"> <field name="invoice_origin" position="after">
<field name="is_move_sent" invisible="move_type not in ('out_invoice', 'out_refund')"/> <field name="is_move_sent" attrs="{'invisible': [('move_type', 'not in', ('out_invoice', 'out_refund'))]}"/>
</field> </field>
<xpath expr="//field[@name='line_ids']/list/field[@name='tax_tag_ids']" position="after"> <xpath expr="//field[@name='line_ids']/tree/field[@name='tax_tag_ids']" position="after">
<field name="matching_number" optional="show"/> <field name="matching_number" optional="show"/>
</xpath> </xpath>
<xpath expr="//field[@name='invoice_line_ids']/list/field[@name='product_id']" position="after"> <xpath expr="//field[@name='invoice_line_ids']/tree/field[@name='product_id']" position="after">
<field name="product_barcode" optional="hide"/> <field name="product_barcode" optional="hide"/>
</xpath> </xpath>
<!--
<field name="invoice_source_email" position="after"> <field name="invoice_source_email" position="after">
<field name="blocked"/> <field name="blocked"/>
</field> </field>
@@ -45,15 +52,15 @@
attrs="{'invisible': ['|', ('move_type', 'not in', ('in_invoice', 'in_refund', 'out_invoice', 'out_refund')), ('blocked', '=', False)]}"> attrs="{'invisible': ['|', ('move_type', 'not in', ('in_invoice', 'in_refund', 'out_invoice', 'out_refund')), ('blocked', '=', False)]}">
This <field name="move_type"/> is marked as <b>disputed</b>. This <field name="move_type"/> is marked as <b>disputed</b>.
</div> </div>
</div> --> </div>
<xpath expr="//field[@name='duplicated_ref_ids']/.." position="attributes"> <xpath expr="//button[@name='open_duplicated_ref_bill_view']/.." position="attributes">
<!-- show duplicate warning not only in draft state, but also in posted state --> <!-- show duplicate warning not only in draft state, but also in posted state -->
<attribute name="invisible">not duplicated_ref_ids</attribute> <attribute name="attrs">{'invisible': ['|', ('state', '=', 'cancel'), ('duplicated_ref_ids', '=', [])]}</attribute>
</xpath> </xpath>
<button name="button_cancel" invisible="not id or state != 'draft' or move_type != 'entry'" position="attributes"> <button name="button_cancel" attrs="{'invisible' : ['|', '|', ('id', '=', False), ('state', '!=', 'draft'),('move_type', '!=', 'entry')]}" position="attributes">
<attribute name="confirm">Are you sure you want to cancel this journal entry?</attribute> <attribute name="confirm">Are you sure you want to cancel this journal entry?</attribute>
</button> </button>
<button name="button_cancel" invisible="not id or state != 'draft' or move_type == 'entry'" position="attributes"> <button name="button_cancel" attrs="{'invisible' : ['|', '|', ('id', '=', False), ('state', '!=', 'draft'),('move_type', '==', 'entry')]}" position="attributes">
<attribute name="confirm">Are you sure you want to cancel this invoice?</attribute> <attribute name="confirm">Are you sure you want to cancel this invoice?</attribute>
</button> </button>
</field> </field>
@@ -64,7 +71,6 @@
<field name="inherit_id" ref="account.view_invoice_tree"/> <field name="inherit_id" ref="account.view_invoice_tree"/>
<field name="arch" type="xml"> <field name="arch" type="xml">
<field name="amount_residual_signed" position="attributes"> <field name="amount_residual_signed" position="attributes">
<!-- switch from hide to show -->
<attribute name="optional">show</attribute> <attribute name="optional">show</attribute>
</field> </field>
</field> </field>
@@ -76,11 +82,15 @@
<field name="inherit_id" ref="account.view_account_invoice_filter"/> <field name="inherit_id" ref="account.view_account_invoice_filter"/>
<field name="arch" type="xml"> <field name="arch" type="xml">
<filter name="due_date" position="after"> <filter name="due_date" position="after">
<separator/>
<filter name="to_send" string="To Send" domain="[('is_move_sent', '=', False), ('state', '=', 'posted'), ('move_type', 'in', ('out_invoice', 'out_refund'))]"/>
<filter name="sent" string="Sent" domain="[('is_move_sent', '=', True), ('move_type', 'in', ('out_invoice', 'out_refund'))]"/>
<separator/> <separator/>
<filter name="no_attachment" string="Missing Attachment" domain="[('has_attachment', '=', False)]"/> <filter name="no_attachment" string="Missing Attachment" domain="[('has_attachment', '=', False)]"/>
<!-- <filter name="dispute" string="Dispute" domain="[('blocked', '=', True)]"/> --> <separator/>
<filter name="dispute" string="Dispute" domain="[('blocked', '=', True)]"/>
</filter> </filter>
<filter name="partner" position="before"> <filter name="salesperson" position="before">
<filter name="commercial_partner_groupby" string="Commercial Partner" context="{'group_by': 'commercial_partner_id'}"/> <filter name="commercial_partner_groupby" string="Commercial Partner" context="{'group_by': 'commercial_partner_id'}"/>
</filter> </filter>
<filter name="status" position="after"> <filter name="status" position="after">
@@ -99,5 +109,70 @@
</field> </field>
</record> </record>
<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">
<!-- The field 'blocked' is alone in it's block
We don't want to display an empty block, so we put the attrs on the group
The drawback of this is that, if someone added a field in that group,
he won't see the field when internal_type is not payable/receivable -->
<xpath expr="//field[@name='blocked']/.." position="attributes">
<attribute name="attrs">{'invisible': [('account_type', 'not in', ('liability_payable', 'asset_receivable'))]}</attribute>
</xpath>
<field name="account_id" position="after">
<field name="account_type" invisible="1"/>
</field>
</field>
</record>
<record id="view_move_line_tree" model="ir.ui.view">
<field name="model">account.move.line</field>
<field name="inherit_id" ref="account.view_move_line_tree"/>
<field name="arch" type="xml">
<field name="analytic_distribution" position="after">
<button title="View Journal Entry Form" type="object" name="show_account_move_form" icon="fa-arrow-right"/>
</field>
<!-- balance is already present
<field name="credit" position="after">
<field name="balance" sum="Balance" optional="show"/>
</field> -->
</field>
</record>
<record id="view_account_move_line_filter" model="ir.ui.view">
<field name="name">account_usability.account_move_line_search</field>
<field name="model">account.move.line</field>
<field name="inherit_id" ref="account.view_account_move_line_filter"/>
<field name="arch" type="xml">
<field name="partner_id" position="after">
<field name="matching_number" />
<field name="debit" filter_domain="['|', ('debit', '=', self), ('credit', '=', self)]" string="Debit or Credit"/>
</field>
<filter name="unreconciled" position="before">
<filter name="reconciled" string="Fully Reconciled" domain="[('account_id.reconcile', '=', True), ('full_reconcile_id', '!=', False)]"/>
</filter>
<filter name="unreconciled" position="attributes">
<attribute name="string">Unreconciled or Partially Reconciled</attribute>
</filter>
<field name="name" position="attributes">
<attribute name="string">Label, Reference, Account or Partner</attribute>
</field>
<field name="name" position="before">
<field name="move_id" position="move"/>
</field>
<field name="partner_id" position="attributes">
<attribute name="domain">['|', ('parent_id', '=', False), ('is_company', '=', True)]</attribute>
</field>
</field>
</record>
<!-- Inherit action called from button of account.account form view
Make it similar to standard "Journal Items" menu account.action_account_moves_all_a -->
<record id="account.action_move_line_select" model="ir.actions.act_window">
<field name="domain">[('display_type', 'not in', ('line_section', 'line_note'))]</field>
<field name="view_id" ref="account.view_move_line_tree"/>
<field name="view_mode">tree,pivot,graph,kanban</field>
</record>
</odoo> </odoo>

View File

@@ -1,52 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<!--
Copyright 2015-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_tree" model="ir.ui.view">
<field name="model">account.move.line</field>
<field name="inherit_id" ref="account.view_move_line_tree"/>
<field name="arch" type="xml">
<list position="inside">
<button title="View Journal Entry Form" type="object" name="show_account_move_form" icon="fa-arrow-right"/>
</list>
</field>
</record>
<record id="view_account_move_line_filter" model="ir.ui.view">
<field name="name">account_usability.account_move_line_search</field>
<field name="model">account.move.line</field>
<field name="inherit_id" ref="account.view_account_move_line_filter"/>
<field name="arch" type="xml">
<field name="partner_id" position="after">
<field name="matching_number" />
<field name="debit" filter_domain="['|', ('debit', '=', self), ('credit', '=', self)]" string="Debit or Credit"/>
</field>
<filter name="reconcilable_account" position="before">
<filter name="reconciled" string="Fully Reconciled" domain="[('account_id.reconcile', '=', True), ('full_reconcile_id', '!=', False)]"/>
</filter>
<filter name="reconcilable_account" position="attributes">
<attribute name="string">Unreconciled or Partially Reconciled</attribute>
</filter>
<field name="name" position="attributes">
<attribute name="string">Label, Reference, Account or Partner</attribute>
</field>
<field name="partner_id" position="attributes">
<attribute name="domain">['|', ('parent_id', '=', False), ('is_company', '=', True)]</attribute>
</field>
</field>
</record>
<!-- Inherit action called from button of account.account form view
Make it similar to standard "Journal Items" menu account.action_account_moves_all_a -->
<record id="account.action_move_line_select" model="ir.actions.act_window">
<field name="domain">[('display_type', 'not in', ('line_section', 'line_note'))]</field>
<field name="view_id" ref="account.view_move_line_tree"/>
<field name="view_mode">list,pivot,graph,kanban</field>
</record>
</odoo>

View File

@@ -1,20 +0,0 @@
<?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="view_account_payment_form" model="ir.ui.view">
<field name="model">account.payment</field>
<field name="inherit_id" ref="account.view_account_payment_form"/>
<field name="arch" type="xml">
<group name="group2" position="inside">
<field name="move_id" readonly="1"/>
</group>
</field>
</record>
</odoo>

View File

@@ -7,10 +7,6 @@
<odoo> <odoo>
<!-- in v18, attachments are disabled by default
TODO see what's the editor idea about it
in the meantime, this field is disabled in manifest -->
<record id="account.account_invoices" model="ir.actions.report"> <record id="account.account_invoices" model="ir.actions.report">
<!-- Attach only on customer invoices/refunds --> <!-- Attach only on customer invoices/refunds -->
<field name="attachment">(object.move_type in ('out_invoice', 'out_refund')) and (object.state == 'posted') and ((object.name or 'INV').replace('/','_')+'.pdf')</field> <field name="attachment">(object.move_type in ('out_invoice', 'out_refund')) and (object.state == 'posted') and ((object.name or 'INV').replace('/','_')+'.pdf')</field>

View File

@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="utf-8"?> <?xml version="1.0" encoding="utf-8"?>
<!-- <!--
Copyright 2015-2024 Akretion France (https://www.akretion.com/) Copyright 2015-2022 Akretion France (http://www.akretion.com/)
@author: Alexis de Lattre <alexis.delattre@akretion.com> @author: Alexis de Lattre <alexis.delattre@akretion.com>
License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl). License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).
--> -->

View File

@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="utf-8"?> <?xml version="1.0" encoding="utf-8"?>
<!-- <!--
Copyright 2021-2024 Akretion (https://www.akretion.com/) Copyright 2021-2022 Akretion (http://www.akretion.com/)
@author: Alexis de Lattre <alexis.delattre@akretion.com> @author: Alexis de Lattre <alexis.delattre@akretion.com>
License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl). License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).
--> -->

View File

@@ -1,17 +1,18 @@
<?xml version="1.0" encoding="utf-8"?> <?xml version="1.0" encoding="utf-8"?>
<!-- <!--
Copyright 2014-2024 Akretion (https://www.akretion.com/) Copyright 2014-2024 Akretion (http://www.akretion.com/)
@author: Mourad EL HADJ MIMOUNE <mourad.elhadj.mimoune@akretion.com> @author: Mourad EL HADJ MIMOUNE <mourad.elhadj.mimoune@akretion.com>
License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl). License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).
--> -->
<odoo> <odoo>
<record id="view_partner_property_form" model="ir.ui.view"> <record id="view_partner_simple_form" model="ir.ui.view">
<field name="name">base_usability.title.on.partner.simplified.form</field>
<field name="model">res.partner</field> <field name="model">res.partner</field>
<field name="inherit_id" ref="account.view_partner_property_form"/> <field name="inherit_id" ref="account.view_partner_property_form"/>
<field name="arch" type="xml"> <field name="arch" type="xml">
<xpath expr="//field[@name='bank_ids']/list/field[@name='acc_number']" position="after"> <xpath expr="//field[@name='bank_ids']//field[@name='acc_number']" position="after">
<field name="currency_id" optional="hide"/> <field name="currency_id" optional="hide"/>
</xpath> </xpath>
</field> </field>

View File

@@ -1,3 +1,3 @@
from . import account_invoice_mark_sent from . import account_invoice_mark_sent
from . import account_move_reversal from . import account_move_reversal
#from . import account_group_generate from . import account_group_generate

View File

@@ -1,4 +1,4 @@
# Copyright 2015-2024 Akretion (https://www.akretion.com) # Copyright 2015-2022 Akretion (http://www.akretion.com)
# @author Alexis de Lattre <alexis.delattre@akretion.com> # @author Alexis de Lattre <alexis.delattre@akretion.com>
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl). # License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).
@@ -56,7 +56,7 @@ class AccountGroupGenerate(models.TransientModel):
action = { action = {
'type': 'ir.actions.act_window', 'type': 'ir.actions.act_window',
'name': _('Account Groups'), 'name': _('Account Groups'),
'view_mode': 'list,form', 'view_mode': 'tree,form',
'res_model': 'account.group', 'res_model': 'account.group',
} }
return action return action

View File

@@ -1,4 +1,4 @@
# Copyright 2017-2024 Akretion France (https://akretion.com/en) # Copyright 2017-2022 Akretion France (https://akretion.com/en)
# @author: Alexis de Lattre <alexis.delattre@akretion.com> # @author: Alexis de Lattre <alexis.delattre@akretion.com>
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl). # License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).

View File

@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="utf-8"?> <?xml version="1.0" encoding="utf-8"?>
<!-- <!--
Copyright 2017-2024 Akretion France (https://www.akretion.com/) Copyright 2017-2022 Akretion France
@author: Alexis de Lattre <alexis.delattre@akretion.com> @author: Alexis de Lattre <alexis.delattre@akretion.com>
License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl). License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).
--> -->
@@ -11,7 +11,7 @@
<field name="name">account.invoice.mark.sent.form</field> <field name="name">account.invoice.mark.sent.form</field>
<field name="model">account.invoice.mark.sent</field> <field name="model">account.invoice.mark.sent</field>
<field name="arch" type="xml"> <field name="arch" type="xml">
<form> <form string="Mark invoices as sent">
<p> <p>
This wizard will mark as <i>sent</i> all the selected posted invoices. This wizard will mark as <i>sent</i> all the selected posted invoices.
</p> </p>

View File

@@ -1,9 +1,10 @@
# Copyright 2018-2024 Akretion France (https://akretion.com/) # Copyright 2018-2022 Akretion France (https://akretion.com/)
# @author: Alexis de Lattre <alexis.delattre@akretion.com> # @author: Alexis de Lattre <alexis.delattre@akretion.com>
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl). # License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).
from odoo import api, fields, models, _ from odoo import api, fields, models, _
from datetime import timedelta from dateutil.relativedelta import relativedelta
from odoo.exceptions import UserError
class AccountMoveReversal(models.TransientModel): class AccountMoveReversal(models.TransientModel):
@@ -16,9 +17,15 @@ class AccountMoveReversal(models.TransientModel):
for wizard in self: for wizard in self:
moves = wizard.move_ids or self.env["account.move"].browse(self._context['active_ids']) moves = wizard.move_ids or self.env["account.move"].browse(self._context['active_ids'])
reversed_moves = self.env["account.move"].search([('reversed_entry_id', 'in', moves.ids)]) reversed_moves = self.env["account.move"].search([('reversed_entry_id', 'in', moves.ids)])
# in v18, display_name contains "MISC/2024/0008 (Reversal of: MISC/2024/0007)" warning = ""
warning = "\n".join([m.display_name for m in reversed_moves]) for already_reversed_move in reversed_moves.reversed_entry_id:
wizard.already_reversed_warning = warning if warning:
warning += "\n"
reversed_by = " ; ".join(already_reversed_move.reversal_move_id.mapped("display_name"))
move_detail = _("%s reversed by %s") % (already_reversed_move.display_name, reversed_by)
warning += move_detail
wizard.already_reversed_warning = warning or False
# Set default reversal date to original move + 1 day # Set default reversal date to original move + 1 day
# and raise error if original move has already been reversed # and raise error if original move has already been reversed
@@ -29,5 +36,5 @@ class AccountMoveReversal(models.TransientModel):
amo = self.env['account.move'] amo = self.env['account.move']
moves = amo.browse(self._context['active_ids']) moves = amo.browse(self._context['active_ids'])
if len(moves) == 1: if len(moves) == 1:
res['date'] = moves.date + timedelta(1) res['date'] = moves.date + relativedelta(days=1)
return res return res

View File

@@ -9,9 +9,10 @@
<div <div
class="alert alert-warning" class="alert alert-warning"
role="alert" role="alert"
invisible="not already_reversed_warning" attrs="{'invisible': [('already_reversed_warning', '=', False)]}"
> >
You are about to reverse entries that have already been reversed: You are about to reverse entries that have already been reversed or partially reversed (refund). Make sure it is intented.
Already reversed entries are the following :
<field <field
name="already_reversed_warning" name="already_reversed_warning"
/> />

View File

@@ -0,0 +1,22 @@
<?xml version="1.0" encoding="utf-8"?>
<!--
Copyright 2021-2022 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>
<!-- When you change the date, it resets the amount via the onchange
So, in the view, the date should be BEFORE the amount -->
<record id="view_account_payment_register_form" model="ir.ui.view">
<field name="model">account.payment.register</field>
<field name="inherit_id" ref="account.view_account_payment_register_form"/>
<field name="arch" type="xml">
<label for="amount" position="before">
<field name="payment_date" position="move"/>
</label>
</field>
</record>
</odoo>

View File

@@ -2,13 +2,10 @@
Base Company Extension Base Company Extension
====================== ======================
.. .. !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
!! This file is generated by oca-gen-addon-readme !! !! This file is generated by oca-gen-addon-readme !!
!! changes will be overwritten. !! !! changes will be overwritten. !!
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
!! source digest: sha256:075f72950033a5c6f57ecfa5c2d101bd874dd2ae29adcecdc4905b378e89a3a2
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
.. |badge1| image:: https://img.shields.io/badge/maturity-Beta-yellow.png .. |badge1| image:: https://img.shields.io/badge/maturity-Beta-yellow.png
:target: https://odoo-community.org/page/development-status :target: https://odoo-community.org/page/development-status
@@ -17,29 +14,25 @@ Base Company Extension
:target: http://www.gnu.org/licenses/agpl-3.0-standalone.html :target: http://www.gnu.org/licenses/agpl-3.0-standalone.html
:alt: License: AGPL-3 :alt: License: AGPL-3
.. |badge3| image:: https://img.shields.io/badge/github-akretion%2Fodoo--usability-lightgray.png?logo=github .. |badge3| image:: https://img.shields.io/badge/github-akretion%2Fodoo--usability-lightgray.png?logo=github
:target: https://github.com/akretion/odoo-usability/tree/18.0/base_company_extension :target: https://github.com/akretion/odoo-usability/tree/12.0/base_company_extension
:alt: akretion/odoo-usability :alt: akretion/odoo-usability
|badge1| |badge2| |badge3| |badge1| |badge2| |badge3|
This module adds the following fields to the ResCompany model: This module adds the following fields on the company:
* Capital Amount * Capital Amount
* Legal Type * 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 Bug Tracker
=========== ===========
Bugs are tracked on `GitHub Issues <https://github.com/akretion/odoo-usability/issues>`_. 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. 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 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_company_extension%0Aversion:%2018.0%0A%0A**Steps%20to%20reproduce**%0A-%20...%0A%0A**Current%20behavior**%0A%0A**Expected%20behavior**>`_. `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. Do not contact contributors directly about support or help with technical issues.
@@ -59,6 +52,6 @@ Contributors
Maintainers Maintainers
~~~~~~~~~~~ ~~~~~~~~~~~
This module is part of the `akretion/odoo-usability <https://github.com/akretion/odoo-usability/tree/18.0/base_company_extension>`_ project on GitHub. This module is part of the `akretion/odoo-usability <https://github.com/akretion/odoo-usability/tree/12.0/base_company_extension>`_ project on GitHub.
You are welcome to contribute. You are welcome to contribute.

View File

@@ -4,14 +4,14 @@
{ {
'name': 'Base Company Extension', 'name': 'Base Company Extension',
'version': '18.0.1.0.0', 'version': '16.0.1.0.0',
'category': 'Partner', 'category': 'Partner',
'license': 'AGPL-3', 'license': 'AGPL-3',
'summary': 'Adds capital and title on company', 'summary': 'Adds capital and title on company',
'author': 'Akretion', 'author': 'Akretion',
'website': 'https://github.com/akretion/odoo-usability', 'website': 'https://github.com/akretion/odoo-usability',
# I depend on base_usability only for _report_company_legal_name() # I depend on base_usability only for _report_company_legal_name()
'depends': ['base_usability_akretion'], 'depends': ['base_usability'],
'data': ['views/res_company.xml'], 'data': ['views/res_company.xml'],
'installable': True, 'installable': True,
} }

View File

@@ -1,3 +0,0 @@
[build-system]
requires = ["whool"]
build-backend = "whool.buildapi"

Binary file not shown.

Before

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"> <!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"> <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head> <head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<meta name="generator" content="Docutils: https://docutils.sourceforge.io/" /> <meta name="generator" content="Docutils 0.15.1: http://docutils.sourceforge.net/" />
<title>Base Company Extension</title> <title>Base Company Extension</title>
<style type="text/css"> <style type="text/css">
/* /*
:Author: David Goodger (goodger@python.org) :Author: David Goodger (goodger@python.org)
:Id: $Id: html4css1.css 9511 2024-01-13 09:50:07Z milde $ :Id: $Id: html4css1.css 7952 2016-07-26 18:15:59Z milde $
:Copyright: This stylesheet has been placed in the public domain. :Copyright: This stylesheet has been placed in the public domain.
Default cascading style sheet for the HTML output of Docutils. 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 See http://docutils.sf.net/docs/howto/html-stylesheets.html for how to
customize this style sheet. customize this style sheet.
*/ */
@@ -275,7 +275,7 @@ pre.literal-block, pre.doctest-block, pre.math, pre.code {
margin-left: 2em ; margin-left: 2em ;
margin-right: 2em } margin-right: 2em }
pre.code .ln { color: gray; } /* line numbers */ pre.code .ln { color: grey; } /* line numbers */
pre.code, code { background-color: #eeeeee } pre.code, code { background-color: #eeeeee }
pre.code .comment, code .comment { color: #5C6576 } pre.code .comment, code .comment { color: #5C6576 }
pre.code .keyword, code .keyword { color: #3B0D06; font-weight: bold } pre.code .keyword, code .keyword { color: #3B0D06; font-weight: bold }
@@ -301,7 +301,7 @@ span.option {
span.pre { span.pre {
white-space: pre } white-space: pre }
span.problematic, pre.problematic { span.problematic {
color: red } color: red }
span.section-subtitle { span.section-subtitle {
@@ -366,10 +366,8 @@ ul.auto-toc {
<!-- !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! <!-- !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
!! This file is generated by oca-gen-addon-readme !! !! This file is generated by oca-gen-addon-readme !!
!! changes will be overwritten. !! !! changes will be overwritten. !!
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
!! source digest: sha256:075f72950033a5c6f57ecfa5c2d101bd874dd2ae29adcecdc4905b378e89a3a2
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! --> !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! -->
<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/18.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" 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>This module adds the following fields to the ResCompany model: <p>This module adds the following fields to the ResCompany model:
* Capital Amount * Capital Amount
* Legal Type</p> * Legal Type</p>
@@ -377,40 +375,40 @@ ul.auto-toc {
<p><strong>Table of contents</strong></p> <p><strong>Table of contents</strong></p>
<div class="contents local topic" id="contents"> <div class="contents local topic" id="contents">
<ul class="simple"> <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="#bug-tracker" id="id1">Bug Tracker</a></li>
<li><a class="reference internal" href="#credits" id="toc-entry-2">Credits</a><ul> <li><a class="reference internal" href="#credits" id="id2">Credits</a><ul>
<li><a class="reference internal" href="#authors" id="toc-entry-3">Authors</a></li> <li><a class="reference internal" href="#authors" id="id3">Authors</a></li>
<li><a class="reference internal" href="#contributors" id="toc-entry-4">Contributors</a></li> <li><a class="reference internal" href="#contributors" id="id4">Contributors</a></li>
<li><a class="reference internal" href="#maintainers" id="toc-entry-5">Maintainers</a></li> <li><a class="reference internal" href="#maintainers" id="id5">Maintainers</a></li>
</ul> </ul>
</li> </li>
</ul> </ul>
</div> </div>
<div class="section" id="bug-tracker"> <div class="section" id="bug-tracker">
<h1><a class="toc-backref" href="#toc-entry-1">Bug Tracker</a></h1> <h1><a class="toc-backref" href="#id1">Bug Tracker</a></h1>
<p>Bugs are tracked on <a class="reference external" href="https://github.com/akretion/odoo-usability/issues">GitHub Issues</a>. <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. 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 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:%2018.0%0A%0A**Steps%20to%20reproduce**%0A-%20...%0A%0A**Current%20behavior**%0A%0A**Expected%20behavior**">feedback</a>.</p> <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>
<p>Do not contact contributors directly about support or help with technical issues.</p> <p>Do not contact contributors directly about support or help with technical issues.</p>
</div> </div>
<div class="section" id="credits"> <div class="section" id="credits">
<h1><a class="toc-backref" href="#toc-entry-2">Credits</a></h1> <h1><a class="toc-backref" href="#id2">Credits</a></h1>
<div class="section" id="authors"> <div class="section" id="authors">
<h2><a class="toc-backref" href="#toc-entry-3">Authors</a></h2> <h2><a class="toc-backref" href="#id3">Authors</a></h2>
<ul class="simple"> <ul class="simple">
<li>Akretion</li> <li>Akretion</li>
</ul> </ul>
</div> </div>
<div class="section" id="contributors"> <div class="section" id="contributors">
<h2><a class="toc-backref" href="#toc-entry-4">Contributors</a></h2> <h2><a class="toc-backref" href="#id4">Contributors</a></h2>
<ul class="simple"> <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>Alexis de Lattre &lt;<a class="reference external" href="mailto:alexis.delattre&#64;akretion.com">alexis.delattre&#64;akretion.com</a>&gt;</li>
</ul> </ul>
</div> </div>
<div class="section" id="maintainers"> <div class="section" id="maintainers">
<h2><a class="toc-backref" href="#toc-entry-5">Maintainers</a></h2> <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/18.0/base_company_extension">akretion/odoo-usability</a> project on GitHub.</p> <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>
<p>You are welcome to contribute.</p> <p>You are welcome to contribute.</p>
</div> </div>
</div> </div>

View File

@@ -27,13 +27,13 @@ To use it, you need to do 2 or 3 things :
1) Add an entry in the domain field and the object you selected: 1) Add an entry in the domain field and the object you selected:
domain = fields.Selection(selection_add=[('risk_type', "Risk Type")], ondelete={"risk_type": "cascade"}) domain = fields.Selection(selection_add=[('risk.type', "Risk Type")], ondelete={"risk.type": "cascade"})
2) Add the many2one field on your object: 2) Add the many2one field on your object:
risk_type_id = fields.Many2one( risk_type_id = fields.Many2one(
'dynamic.list', string="Risk Type", 'dynamic.list', string="Risk Type",
ondelete='restrict', domain=[('domain', '=', 'risk_type')]) ondelete='restrict', domain=[('domain', '=', 'risk.type')])
3) Optionally, you can add a dedicated action and a menu entry (otherwize, you can use the generic menu entry under *Settings > Technical > Dynamic Lists*: 3) Optionally, you can add a dedicated action and a menu entry (otherwize, you can use the generic menu entry under *Settings > Technical > Dynamic Lists*:
@@ -42,8 +42,8 @@ risk_type_id = fields.Many2one(
<field name="name">Risk Type</field> <field name="name">Risk Type</field>
<field name="res_model">dynamic.list</field> <field name="res_model">dynamic.list</field>
<field name="view_mode">tree,form</field> <field name="view_mode">tree,form</field>
<field name="domain">[('domain', '=', 'risk_type')]</field> <field name="domain">[('domain', '=', 'risk.type')]</field>
<field name="context">{'default_domain': 'risk_type'}</field> <field name="context">{'default_domain': 'risk.type'}</field>
</record> </record>
<menuitem id="dynamic_list_risk_type_menu" action="dynamic_list_risk_type_action" <menuitem id="dynamic_list_risk_type_menu" action="dynamic_list_risk_type_action"
@@ -58,5 +58,5 @@ Limitation: when you want to have different access rights on these lists dependi
'security/ir.model.access.csv', 'security/ir.model.access.csv',
'views/dynamic_list.xml', 'views/dynamic_list.xml',
], ],
'installable': False, 'installable': True,
} }

View File

@@ -17,5 +17,5 @@ With this module, when Odoo sends an outgoing email, it adds the sender as Bcc (
'author': 'Akretion', 'author': 'Akretion',
'website': 'https://github.com/akretion/odoo-usability', 'website': 'https://github.com/akretion/odoo-usability',
'depends': ['base'], 'depends': ['base'],
'installable': False, 'installable': True,
} }

View File

@@ -27,6 +27,6 @@ It has been developped by brother Bernard from Barroux Abbey and Alexis de Lattr
'views/res_partner.xml', 'views/res_partner.xml',
'security/ir.model.access.csv', 'security/ir.model.access.csv',
], ],
'installable': False, 'installable': True,
'post_init_hook': 'migrate_to_partner_phone', 'post_init_hook': 'migrate_to_partner_phone',
} }

View File

@@ -1,10 +1,10 @@
# Copyright 2017-2024 Akretion France (https://www.akretion.com) # Copyright 2017-2023 Akretion France (https://www.akretion.com)
# @author Alexis de Lattre <alexis.delattre@akretion.com> # @author Alexis de Lattre <alexis.delattre@akretion.com>
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl). # License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).
{ {
'name': 'Base Partner Reference', 'name': 'Base Partner Reference',
'version': '18.0.1.0.0', 'version': '16.0.1.0.0',
'category': 'Partner', 'category': 'Partner',
'license': 'AGPL-3', 'license': 'AGPL-3',
'summary': "Improve usage of partner's Internal Reference", 'summary': "Improve usage of partner's Internal Reference",

View File

@@ -23,24 +23,51 @@ class ResPartner(models.Model):
def _compute_display_name(self): def _compute_display_name(self):
super()._compute_display_name() super()._compute_display_name()
def _get_complete_name(self): def _get_name(self):
self.ensure_one() partner = self
displayed_types = self._complete_name_displayed_types name = partner.name or ''
type_description = dict(self._fields['type']._description_selection(self.env))
name = self.name or ''
# START modif of native method # START modif of native method
if not self._context.get('show_address') and self.ref: if partner.ref:
name = "[%s] %s" % (self.ref, name) name = "[%s] %s" % (partner.ref, name)
# END modif of native method
if self.company_name or self.parent_id:
if not name and self.type in displayed_types:
name = type_description[self.type]
if not self.is_company:
name = f"{self.commercial_company_name or self.sudo().parent_id.name}, {name}"
# START modif of native method
if not self._context.get('show_address') and self.parent_id.ref:
name = f"[{self.parent_id.ref}] {name}"
# END modif of native method # END modif of native method
if partner.company_name or partner.parent_id:
if not name and partner.type in ['invoice', 'delivery', 'other']:
name = dict(self.fields_get(
['type'])['type']['selection'])[partner.type]
if not partner.is_company:
# START modif of native name_get() method
company_name = partner.commercial_company_name or\
partner.sudo().parent_id.name
if partner.parent_id.ref:
company_name = "[%s] %s" % (partner.parent_id.ref, company_name)
name = "%s, %s" % (company_name, name)
# END modif of native name_get() method
if self._context.get('show_address_only'):
name = partner._display_address(without_company=True)
if self._context.get('show_address'):
name = name + "\n" + partner._display_address(without_company=True)
name = re.sub(r'\s+\n', '\n', name)
if self._context.get('partner_show_db_id'):
name = "%s (%s)" % (name, partner.id)
if self._context.get('address_inline'):
splitted_names = name.split("\n")
name = ", ".join([n for n in splitted_names if n.strip()])
if self._context.get('show_email') and partner.email:
name = "%s <%s>" % (name, partner.email)
if self._context.get('html_format'):
name = name.replace('\n', '<br/>')
if self._context.get('show_vat') and partner.vat:
name = "%s %s" % (name, partner.vat)
return name.strip() return name.strip()
# native _rec_names_search contains "ref", so no need to inherit name_search() @api.model
def name_search(self, name='', args=None, operator='ilike', limit=100):
if args is None:
args = []
if name and operator == 'ilike':
recs = self.search([('ref', '=', name)] + args, limit=limit)
if recs:
rec_childs = self.search([('id', 'child_of', recs.ids)])
return rec_childs.name_get()
return super().name_search(name=name, args=args, operator=operator, limit=limit)

View File

@@ -2,8 +2,11 @@
# @author: Alexis de Lattre <alexis.delattre@akretion.com> # @author: Alexis de Lattre <alexis.delattre@akretion.com>
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl). # License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).
from odoo import api, SUPERUSER_ID
def update_partner_display_name(env):
def update_partner_display_name(cr, registry):
env = api.Environment(cr, SUPERUSER_ID, {})
partners = env['res.partner'].with_context(active_test=False).search( partners = env['res.partner'].with_context(active_test=False).search(
[('ref', '!=', False)]) [('ref', '!=', False)])
partners.write({'invalidate_display_name': True}) partners.write({'invalidate_display_name': True})

View File

@@ -1,3 +0,0 @@
[build-system]
requires = ["whool"]
build-backend = "whool.buildapi"

Binary file not shown.

Before

Width:  |  Height:  |  Size: 9.2 KiB

View File

@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="utf-8"?> <?xml version="1.0" encoding="utf-8"?>
<!-- <!--
Copyright 2017-2024 Akretion France (https://www.akretion.com/) Copyright 2017-2023 Akretion France (http://www.akretion.com/)
@author: Alexis de Lattre <alexis.delattre@akretion.com> @author: Alexis de Lattre <alexis.delattre@akretion.com>
License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl). License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).
--> -->
@@ -13,9 +13,9 @@
<field name="inherit_id" ref="base.view_partner_form"/> <field name="inherit_id" ref="base.view_partner_form"/>
<field name="priority">1000</field> <!-- inherit after l10n_fr --> <field name="priority">1000</field> <!-- inherit after l10n_fr -->
<field name="arch" type="xml"> <field name="arch" type="xml">
<div class="o_address_format" position="after"> <field name="vat" position="before">
<field name="ref"/> <field name="ref"/>
</div> </field>
<xpath expr="//page[@name='sales_purchases']//field[@name='ref']" position="attributes"> <xpath expr="//page[@name='sales_purchases']//field[@name='ref']" position="attributes">
<attribute name="invisible">1</attribute> <attribute name="invisible">1</attribute>
</xpath> </xpath>

View File

@@ -1,43 +0,0 @@
# 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).
{
'name': 'Base Profile by Akretion',
'version': '18.0.1.0.0',
'category': 'Tools',
'license': 'AGPL-3',
'summary': 'Base module set selected by Alexis de Lattre',
'author': 'Akretion',
'website': 'https://github.com/akretion/odoo-usability',
'depends': [
# PARTNER
'partner_firstname', # OCA/partner-contact
'partner_email_duplicate_warn', # OCA/partner-contact
'partner_mobile_duplicate_warn', # OCA/partner-contact
'contacts', # official addons
# AUTH
'auth_admin_passkey', # OCA/server-auth
# REMOVE or FIX BAD NATIVE STUFF
'disable_odoo_online', # OCA/server-brand
'remove_odoo_enterprise', # OCA/server-brand
'mail_debrand', # OCA/mail
'partner_disable_gravatar', # OCA/partner-contact
'base_technical_features', # OCA/server-ux
### WEB
'web_responsive', # OCA/web
'web_environment_ribbon', # OCA/web
'web_no_bubble', # OCA/web
'web_dialog_size', # OCA/web
'web_chatter_position', # OCA/web
### MISC
'base_usability_akretion', # akretion/odoo-usability
'mail_usability_akretion', # akretion/odoo-usability
'eradicate_quick_create', # akretion/odoo-usability
'base_company_extension', # akretion/odoo-usability
# password_security will be enabled when the move to ir.config_parameter
# will be backported
#'password_security', # OCA/server-auth
],
'installable': True,
}

View File

@@ -1,3 +0,0 @@
[build-system]
requires = ["whool"]
build-backend = "whool.buildapi"

Binary file not shown.

Before

Width:  |  Height:  |  Size: 9.2 KiB

View File

@@ -2,13 +2,10 @@
Base Usability Base Usability
============== ==============
.. .. !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
!! This file is generated by oca-gen-addon-readme !! !! This file is generated by oca-gen-addon-readme !!
!! changes will be overwritten. !! !! changes will be overwritten. !!
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
!! source digest: sha256:6998b819c2a5d0be20947d00a368d24aa2a1e1f2655e6463e450f2d7ad9acfcd
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
.. |badge1| image:: https://img.shields.io/badge/maturity-Beta-yellow.png .. |badge1| image:: https://img.shields.io/badge/maturity-Beta-yellow.png
:target: https://odoo-community.org/page/development-status :target: https://odoo-community.org/page/development-status
@@ -16,11 +13,17 @@ Base Usability
.. |badge2| image:: https://img.shields.io/badge/licence-AGPL--3-blue.png .. |badge2| image:: https://img.shields.io/badge/licence-AGPL--3-blue.png
:target: http://www.gnu.org/licenses/agpl-3.0-standalone.html :target: http://www.gnu.org/licenses/agpl-3.0-standalone.html
:alt: License: AGPL-3 :alt: License: AGPL-3
.. |badge3| image:: https://img.shields.io/badge/github-akretion%2Fodoo--usability-lightgray.png?logo=github .. |badge3| image:: https://img.shields.io/badge/github-OCA%2Fodoo--usability-lightgray.png?logo=github
:target: https://github.com/akretion/odoo-usability/tree/18.0/base_usability_akretion :target: https://github.com/OCA/odoo-usability/tree/16.0/base_usability
:alt: akretion/odoo-usability :alt: OCA/odoo-usability
.. |badge4| image:: https://img.shields.io/badge/weblate-Translate%20me-F47D42.png
:target: https://translation.odoo-community.org/projects/odoo-usability-16-0/odoo-usability-16-0-base_usability
:alt: Translate me on Weblate
.. |badge5| image:: https://img.shields.io/badge/runboat-Try%20me-875A7B.png
:target: https://runboat.odoo-community.org/webui/builds.html?repo=OCA/odoo-usability&target_branch=16.0
:alt: Try me on Runboat
|badge1| |badge2| |badge3| |badge1| |badge2| |badge3| |badge4| |badge5|
This module adds the following functions: This module adds the following functions:
@@ -57,10 +60,10 @@ This module adds the following functions:
Bug Tracker Bug Tracker
=========== ===========
Bugs are tracked on `GitHub Issues <https://github.com/akretion/odoo-usability/issues>`_. Bugs are tracked on `GitHub Issues <https://github.com/OCA/odoo-usability/issues>`_.
In case of trouble, please check there if your issue has already been reported. 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 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_akretion%0Aversion:%2018.0%0A%0A**Steps%20to%20reproduce**%0A-%20...%0A%0A**Current%20behavior**%0A%0A**Expected%20behavior**>`_. `feedback <https://github.com/OCA/odoo-usability/issues/new?body=module:%20base_usability%0Aversion:%2016.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. Do not contact contributors directly about support or help with technical issues.
@@ -82,6 +85,16 @@ Contributors
Maintainers Maintainers
~~~~~~~~~~~ ~~~~~~~~~~~
This module is part of the `akretion/odoo-usability <https://github.com/akretion/odoo-usability/tree/18.0/base_usability_akretion>`_ project on GitHub. This module is maintained by the OCA.
You are welcome to contribute. .. image:: https://odoo-community.org/logo.png
:alt: Odoo Community Association
:target: https://odoo-community.org
OCA, or the Odoo Community Association, is a nonprofit organization whose
mission is to support the collaborative development of Odoo features and
promote its widespread use.
This module is part of the `OCA/odoo-usability <https://github.com/OCA/odoo-usability/tree/16.0/base_usability>`_ project on GitHub.
You are welcome to contribute. To learn how please visit https://odoo-community.org/page/Contribute.

View File

@@ -4,7 +4,7 @@
{ {
'name': 'Base Usability', 'name': 'Base Usability',
'version': '18.0.1.0.0', 'version': '16.0.1.0.0',
'category': 'Partner', 'category': 'Partner',
'license': 'AGPL-3', 'license': 'AGPL-3',
'summary': 'Better usability in base module', 'summary': 'Better usability in base module',
@@ -21,6 +21,7 @@
'views/ir_config_parameter.xml', 'views/ir_config_parameter.xml',
'views/ir_module.xml', 'views/ir_module.xml',
'views/ir_sequence.xml', 'views/ir_sequence.xml',
'views/ir_property.xml',
], ],
'installable': True, 'installable': True,
} }

View File

@@ -4,3 +4,4 @@ from . import res_partner_bank
from . import res_company from . import res_company
from . import ir_mail_server from . import ir_mail_server
from . import ir_model from . import ir_model
from . import ir_model_fields

View File

@@ -1,4 +1,4 @@
# Copyright 2015-2024 Akretion France (https://www.akretion.com/) # Copyright 2015-2022 Akretion France (http://www.akretion.com/)
# @author: Alexis de Lattre <alexis.delattre@akretion.com> # @author: Alexis de Lattre <alexis.delattre@akretion.com>
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl). # License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).
@@ -18,15 +18,8 @@ class IrMailServer(models.Model):
smtp_ssl_certificate=None, smtp_ssl_private_key=None, smtp_ssl_certificate=None, smtp_ssl_private_key=None,
smtp_debug=False, smtp_session=None): smtp_debug=False, smtp_session=None):
# Start copy from native method # Start copy from native method
smtp = smtp_session
if not smtp:
smtp = self.connect(
smtp_server, smtp_port, smtp_user, smtp_password, smtp_encryption,
smtp_from=message['From'], ssl_certificate=smtp_ssl_certificate, ssl_private_key=smtp_ssl_private_key,
smtp_debug=smtp_debug, mail_server_id=mail_server_id,)
smtp_from, smtp_to_list, message = self._prepare_email_message( smtp_from, smtp_to_list, message = self._prepare_email_message(
message, smtp) message, smtp_session)
# End copy from native method # End copy from native method
logger.info( logger.info(
"Sending email from '%s' to '%s' Cc '%s' Bcc '%s' " "Sending email from '%s' to '%s' Cc '%s' Bcc '%s' "

View File

@@ -1,4 +1,4 @@
# Copyright 2019-2024 Akretion France (https://www.akretion.com/) # Copyright 2019-2022 Akretion France (http://www.akretion.com/)
# @author: Alexis de Lattre <alexis.delattre@akretion.com> # @author: Alexis de Lattre <alexis.delattre@akretion.com>
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl). # License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).
@@ -9,6 +9,8 @@ class IrModel(models.Model):
_inherit = 'ir.model' _inherit = 'ir.model'
@api.depends('name', 'model') @api.depends('name', 'model')
def _compute_display_name(self): def name_get(self):
res = []
for rec in self: for rec in self:
rec.display_name = f'{rec.name} ({rec.model})' res.append((rec.id, '%s (%s)' % (rec.name, rec.model)))
return res

View File

@@ -0,0 +1,16 @@
# 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).
from odoo import api, models
class IrModelFields(models.Model):
_inherit = 'ir.model.fields'
@api.depends('name', 'field_description')
def name_get(self):
res = []
for rec in self:
res.append((rec.id, '%s (%s)' % (rec.field_description, rec.name)))
return res

View File

@@ -1,4 +1,4 @@
# Copyright 2015-2024 Akretion France (https://www.akretion.com/) # Copyright 2015-2022 Akretion France (http://www.akretion.com/)
# @author: Alexis de Lattre <alexis.delattre@akretion.com> # @author: Alexis de Lattre <alexis.delattre@akretion.com>
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl). # License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).

View File

@@ -1,4 +1,4 @@
# Copyright 2015-2024 Akretion France (https://www.akretion.com/) # Copyright 2015-2022 Akretion France (http://www.akretion.com/)
# @author: Alexis de Lattre <alexis.delattre@akretion.com> # @author: Alexis de Lattre <alexis.delattre@akretion.com>
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl). # License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).
@@ -125,20 +125,6 @@ class ResPartner(models.Model):
'label': _('Supplier Number:'), 'label': _('Supplier Number:'),
}, },
} }
if hasattr(self, 'siren'):
options['siren'] = {
'value': self.siren,
'label': _("SIREN:"),
}
if hasattr(self, 'siret'):
if hasattr(self, 'siren'): # l10n_fr_siret is installed
siret = self.siren and self.nic and self.siret or False
else:
siret = self.siret
options['siret'] = {
'value': siret,
'label': _("SIRET:"),
}
res = [] res = []
for detail in details: for detail in details:
if options.get(detail) and options[detail]['value']: if options.get(detail) and options[detail]['value']:

View File

@@ -0,0 +1,14 @@
# Copyright 2015-2022 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
class ResPartnerBank(models.Model):
_inherit = 'res.partner.bank'
# In the 'base' module, they didn't put any string, so the bank name is
# displayed as 'Name', which the string of the related field it
# points to
bank_name = fields.Char(string='Bank Name')

View File

@@ -2,7 +2,7 @@
# @author: Alexis de Lattre <alexis.delattre@akretion.com> # @author: Alexis de Lattre <alexis.delattre@akretion.com>
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl). # License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).
from odoo import api, fields, models from odoo import api, fields, models, SUPERUSER_ID
import logging import logging
from odoo.tools.misc import format_datetime from odoo.tools.misc import format_datetime
@@ -14,9 +14,11 @@ class ResUsers(models.Model):
@api.model @api.model
def _script_partners_linked_to_users_no_company(self): def _script_partners_linked_to_users_no_company(self):
if self.env.user.id != SUPERUSER_ID:
self = self.sudo()
logger.info( logger.info(
'START to set company_id=False on partners related to users') 'START to set company_id=False on partners related to users')
users = self.sudo().with_context(active_test=False).search([]) users = self.with_context(active_test=False).search([])
for user in users: for user in users:
if user.partner_id.company_id: if user.partner_id.company_id:
user.partner_id.write({'company_id': False}) user.partner_id.write({'company_id': False})

View File

@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="utf-8"?> <?xml version="1.0" encoding="utf-8"?>
<!-- <!--
Copyright 2016-2024 Akretion France (https://www.akretion.com/) Copyright 2016-2022 Akretion France (http://www.akretion.com/)
@author: Alexis de Lattre <alexis.delattre@akretion.com> @author: Alexis de Lattre <alexis.delattre@akretion.com>
License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl). License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).
--> -->

View File

Before

Width:  |  Height:  |  Size: 9.5 KiB

After

Width:  |  Height:  |  Size: 9.5 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"> <!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"> <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head> <head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<meta name="generator" content="Docutils: https://docutils.sourceforge.io/" /> <meta name="generator" content="Docutils: http://docutils.sourceforge.net/" />
<title>Base Usability</title> <title>Base Usability</title>
<style type="text/css"> <style type="text/css">
/* /*
:Author: David Goodger (goodger@python.org) :Author: David Goodger (goodger@python.org)
:Id: $Id: html4css1.css 9511 2024-01-13 09:50:07Z milde $ :Id: $Id: html4css1.css 7952 2016-07-26 18:15:59Z milde $
:Copyright: This stylesheet has been placed in the public domain. :Copyright: This stylesheet has been placed in the public domain.
Default cascading style sheet for the HTML output of Docutils. 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 See http://docutils.sf.net/docs/howto/html-stylesheets.html for how to
customize this style sheet. customize this style sheet.
*/ */
@@ -275,7 +275,7 @@ pre.literal-block, pre.doctest-block, pre.math, pre.code {
margin-left: 2em ; margin-left: 2em ;
margin-right: 2em } margin-right: 2em }
pre.code .ln { color: gray; } /* line numbers */ pre.code .ln { color: grey; } /* line numbers */
pre.code, code { background-color: #eeeeee } pre.code, code { background-color: #eeeeee }
pre.code .comment, code .comment { color: #5C6576 } pre.code .comment, code .comment { color: #5C6576 }
pre.code .keyword, code .keyword { color: #3B0D06; font-weight: bold } pre.code .keyword, code .keyword { color: #3B0D06; font-weight: bold }
@@ -301,7 +301,7 @@ span.option {
span.pre { span.pre {
white-space: pre } white-space: pre }
span.problematic, pre.problematic { span.problematic {
color: red } color: red }
span.section-subtitle { span.section-subtitle {
@@ -366,10 +366,8 @@ ul.auto-toc {
<!-- !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! <!-- !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
!! This file is generated by oca-gen-addon-readme !! !! This file is generated by oca-gen-addon-readme !!
!! changes will be overwritten. !! !! changes will be overwritten. !!
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
!! source digest: sha256:6998b819c2a5d0be20947d00a368d24aa2a1e1f2655e6463e450f2d7ad9acfcd
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! --> !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! -->
<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/18.0/base_usability_akretion"><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" 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/OCA/odoo-usability/tree/16.0/base_usability"><img alt="OCA/odoo-usability" src="https://img.shields.io/badge/github-OCA%2Fodoo--usability-lightgray.png?logo=github" /></a> <a class="reference external" href="https://translation.odoo-community.org/projects/odoo-usability-16-0/odoo-usability-16-0-base_usability"><img alt="Translate me on Weblate" src="https://img.shields.io/badge/weblate-Translate%20me-F47D42.png" /></a> <a class="reference external" href="https://runboat.odoo-community.org/webui/builds.html?repo=OCA/odoo-usability&amp;target_branch=16.0"><img alt="Try me on Runboat" src="https://img.shields.io/badge/runboat-Try%20me-875A7B.png" /></a></p>
<p>This module adds the following functions:</p> <p>This module adds the following functions:</p>
<ul class="simple"> <ul class="simple">
<li>Adds <em>track_visibility=onchange</em> on all the important fields of the Partner object</li> <li>Adds <em>track_visibility=onchange</em> on all the important fields of the Partner object</li>
@@ -400,33 +398,33 @@ ul.auto-toc {
<p><strong>Table of contents</strong></p> <p><strong>Table of contents</strong></p>
<div class="contents local topic" id="contents"> <div class="contents local topic" id="contents">
<ul class="simple"> <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="#bug-tracker" id="id1">Bug Tracker</a></li>
<li><a class="reference internal" href="#credits" id="toc-entry-2">Credits</a><ul> <li><a class="reference internal" href="#credits" id="id2">Credits</a><ul>
<li><a class="reference internal" href="#authors" id="toc-entry-3">Authors</a></li> <li><a class="reference internal" href="#authors" id="id3">Authors</a></li>
<li><a class="reference internal" href="#contributors" id="toc-entry-4">Contributors</a></li> <li><a class="reference internal" href="#contributors" id="id4">Contributors</a></li>
<li><a class="reference internal" href="#maintainers" id="toc-entry-5">Maintainers</a></li> <li><a class="reference internal" href="#maintainers" id="id5">Maintainers</a></li>
</ul> </ul>
</li> </li>
</ul> </ul>
</div> </div>
<div class="section" id="bug-tracker"> <div class="section" id="bug-tracker">
<h1><a class="toc-backref" href="#toc-entry-1">Bug Tracker</a></h1> <h1><a class="toc-backref" href="#id1">Bug Tracker</a></h1>
<p>Bugs are tracked on <a class="reference external" href="https://github.com/akretion/odoo-usability/issues">GitHub Issues</a>. <p>Bugs are tracked on <a class="reference external" href="https://github.com/OCA/odoo-usability/issues">GitHub Issues</a>.
In case of trouble, please check there if your issue has already been reported. 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 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_akretion%0Aversion:%2018.0%0A%0A**Steps%20to%20reproduce**%0A-%20...%0A%0A**Current%20behavior**%0A%0A**Expected%20behavior**">feedback</a>.</p> <a class="reference external" href="https://github.com/OCA/odoo-usability/issues/new?body=module:%20base_usability%0Aversion:%2016.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> <p>Do not contact contributors directly about support or help with technical issues.</p>
</div> </div>
<div class="section" id="credits"> <div class="section" id="credits">
<h1><a class="toc-backref" href="#toc-entry-2">Credits</a></h1> <h1><a class="toc-backref" href="#id2">Credits</a></h1>
<div class="section" id="authors"> <div class="section" id="authors">
<h2><a class="toc-backref" href="#toc-entry-3">Authors</a></h2> <h2><a class="toc-backref" href="#id3">Authors</a></h2>
<ul class="simple"> <ul class="simple">
<li>Akretion</li> <li>Akretion</li>
</ul> </ul>
</div> </div>
<div class="section" id="contributors"> <div class="section" id="contributors">
<h2><a class="toc-backref" href="#toc-entry-4">Contributors</a></h2> <h2><a class="toc-backref" href="#id4">Contributors</a></h2>
<ul class="simple"> <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>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>Raphaël Valyi &lt;<a class="reference external" href="mailto:rvalyi&#64;akretion.com">rvalyi&#64;akretion.com</a>&gt;</li>
@@ -434,9 +432,14 @@ If you spotted it first, help us to smash it by providing a detailed and welcome
</ul> </ul>
</div> </div>
<div class="section" id="maintainers"> <div class="section" id="maintainers">
<h2><a class="toc-backref" href="#toc-entry-5">Maintainers</a></h2> <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/18.0/base_usability_akretion">akretion/odoo-usability</a> project on GitHub.</p> <p>This module is maintained by the OCA.</p>
<p>You are welcome to contribute.</p> <a class="reference external image-reference" href="https://odoo-community.org"><img alt="Odoo Community Association" src="https://odoo-community.org/logo.png" /></a>
<p>OCA, or the Odoo Community Association, is a nonprofit organization whose
mission is to support the collaborative development of Odoo features and
promote its widespread use.</p>
<p>This module is part of the <a class="reference external" href="https://github.com/OCA/odoo-usability/tree/16.0/base_usability">OCA/odoo-usability</a> project on GitHub.</p>
<p>You are welcome to contribute. To learn how please visit <a class="reference external" href="https://odoo-community.org/page/Contribute">https://odoo-community.org/page/Contribute</a>.</p>
</div> </div>
</div> </div>
</div> </div>

View File

@@ -6,9 +6,9 @@
<field name="model">ir.config_parameter</field> <field name="model">ir.config_parameter</field>
<field name="inherit_id" ref="base.view_ir_config_list"/> <field name="inherit_id" ref="base.view_ir_config_list"/>
<field name="arch" type="xml"> <field name="arch" type="xml">
<list position="inside"> <xpath expr="//tree/field[last()]" position="after">
<field name="write_date" optional="show"/> <field name="write_date"/>
</list> </xpath>
</field> </field>
</record> </record>

View File

@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="utf-8"?> <?xml version="1.0" encoding="utf-8"?>
<!-- <!--
Copyright 2015-2024 Akretion France (https://www.akretion.com/) Copyright 2015-2022 Akretion France (http://www.akretion.com/)
@author: Alexis de Lattre <alexis.delattre@akretion.com> @author: Alexis de Lattre <alexis.delattre@akretion.com>
License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl). License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).
--> -->
@@ -13,7 +13,6 @@
<field name="inherit_id" ref="base.view_module_filter"/> <field name="inherit_id" ref="base.view_module_filter"/>
<field name="arch" type="xml"> <field name="arch" type="xml">
<xpath expr="//filter[@name='extra']" position="after"> <xpath expr="//filter[@name='extra']" position="after">
<separator/>
<filter name="installable" string="Installable" domain="[('state', '!=', 'uninstallable')]"/> <filter name="installable" string="Installable" domain="[('state', '!=', 'uninstallable')]"/>
</xpath> </xpath>
</field> </field>

View File

@@ -0,0 +1,40 @@
<?xml version="1.0" encoding="utf-8"?>
<!--
Copyright 2022 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="ir_property_view_tree" model="ir.ui.view">
<field name="model">ir.property</field>
<field name="inherit_id" ref="base.ir_property_view_tree"/>
<field name="arch" type="xml">
<field name="type" position="after">
<field name="value_reference" optional="show"/>
<field name="value_integer" optional="hide"/>
<field name="value_float" optional="hide"/>
<field name="value_datetime" optional="hide"/>
<field name="value_text" optional="hide"/>
</field>
<field name="type" position="attributes">
<attribute name="optional">hide</attribute>
</field>
</field>
</record>
<record id="ir_property_view_search" model="ir.ui.view">
<field name="model">ir.property</field>
<field name="inherit_id" ref="base.ir_property_view_search"/>
<field name="arch" type="xml">
<search position="inside">
<group name="groupby">
<filter name="field_groupby" string="Field" context="{'group_by': 'fields_id'}"/>
<filter name="company_groupby" string="Company" context="{'group_by': 'company_id'}"/>
</group>
</search>
</field>
</record>
</odoo>

View File

@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="utf-8"?> <?xml version="1.0" encoding="utf-8"?>
<!-- <!--
Copyright 2022-2024 Akretion France (https://www.akretion.com/) Copyright 2022 Akretion France (http://www.akretion.com/)
@author: Alexis de Lattre <alexis.delattre@akretion.com> @author: Alexis de Lattre <alexis.delattre@akretion.com>
License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl). License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).
--> -->

View File

@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="utf-8"?> <?xml version="1.0" encoding="utf-8"?>
<!-- <!--
Copyright 2015-2024 Akretion France (https://www.akretion.com/) Copyright 2015-2022 Akretion France (http://www.akretion.com/)
@author: Alexis de Lattre <alexis.delattre@akretion.com> @author: Alexis de Lattre <alexis.delattre@akretion.com>
License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl). License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).
--> -->
@@ -21,20 +21,18 @@
</field> </field>
</record> </record>
<record id="view_country_search" model="ir.ui.view"> <record id="res_country_search" model="ir.ui.view">
<field name="name">base_usability.res.country.search</field> <field name="name">base_usability.res.country.search</field>
<field name="model">res.country</field> <field name="model">res.country</field>
<field name="inherit_id" ref="base.view_country_search"/>
<field name="arch" type="xml"> <field name="arch" type="xml">
<field name="name" position="after"> <search>
<field name="name" filter_domain="['|', ('name', 'ilike', self), ('code', '=', self)]" string="Name or Code"/>
<field name="code"/> <field name="code"/>
<field name="currency_id"/> <field name="currency_id"/>
</field>
<field name="phone_code" position="after">
<group string="Group By" name="groupby"> <group string="Group By" name="groupby">
<filter name="currency_groupby" string="Currency" context="{'group_by': 'currency_id'}"/> <filter name="currency_groupby" string="Currency" context="{'group_by': 'currency_id'}"/>
</group> </group>
</field> </search>
</field> </field>
</record> </record>

View File

@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="utf-8"?> <?xml version="1.0" encoding="utf-8"?>
<!-- <!--
Copyright 2014-2024 Akretion (https://www.akretion.com/) Copyright 2014-2022 Akretion (http://www.akretion.com/)
@author: Alexis de Lattre <alexis.delattre@akretion.com> @author: Alexis de Lattre <alexis.delattre@akretion.com>
License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl). License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).
--> -->
@@ -14,13 +14,10 @@
<field name="arch" type="xml"> <field name="arch" type="xml">
<!-- Show title not only on Contacts --> <!-- Show title not only on Contacts -->
<xpath expr="//field[@name='child_ids']/form//field[@name='title']" position="attributes"> <xpath expr="//field[@name='child_ids']/form//field[@name='title']" position="attributes">
<attribute name="invisible"></attribute> <attribute name="attrs"></attribute>
</xpath> </xpath>
<!-- Show double VAT partner even when not in editable mode --> <!-- Show double VAT partner even when not in editable mode -->
<div name="warning_tax" position="attributes"> <div attrs="{'invisible': [('same_vat_partner_id', '=', False)]}" position="attributes">
<attribute name="class">alert alert-warning</attribute>
</div>
<div name="warning_company" position="attributes">
<attribute name="class">alert alert-warning</attribute> <attribute name="class">alert alert-warning</attribute>
</div> </div>
</field> </field>
@@ -42,10 +39,14 @@
<field name="model">res.partner</field> <field name="model">res.partner</field>
<field name="inherit_id" ref="base.view_partner_tree"/> <field name="inherit_id" ref="base.view_partner_tree"/>
<field name="arch" type="xml"> <field name="arch" type="xml">
<field name="complete_name" position="after"> <field name="display_name" position="after">
<field name="ref" optional="hide"/> <field name="ref" optional="hide"/>
</field> </field>
<field name="phone" position="after">
<field name="mobile" optional="show" widget="phone" class="o_force_ltr"/>
</field>
<field name="city" position="before"> <field name="city" position="before">
<field name="street" optional="hide"/>
<field name="street2" optional="hide"/> <field name="street2" optional="hide"/>
<field name="zip" optional="hide"/> <field name="zip" optional="hide"/>
</field> </field>
@@ -60,7 +61,7 @@
<field name="name" position="attributes"> <field name="name" position="attributes">
<attribute name="string">Name or Email or VAT or Reference</attribute> <attribute name="string">Name or Email or VAT or Reference</attribute>
<!-- for 'ref', change '=' to 'start with' --> <!-- for 'ref', change '=' to 'start with' -->
<attribute name="filter_domain">['|', '|', '|', '|', ('complete_name', 'ilike', self), ('ref', '=ilike', self + '%'), ('email', 'ilike', self), ('vat', 'ilike', self), ('company_registry', 'ilike', self)]</attribute> <attribute name="filter_domain">['|', '|', '|', '|', ('display_name', 'ilike', self), ('ref', '=ilike', self + '%'), ('email', 'ilike', self), ('vat', 'ilike', self), ('company_registry', 'ilike', self)]</attribute>
</field> </field>
<group name="group_by" position="inside"> <group name="group_by" position="inside">
<filter name="group_industry" string="Industry" context="{'group_by': 'industry_id'}"/> <filter name="group_industry" string="Industry" context="{'group_by': 'industry_id'}"/>

View File

@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="utf-8"?> <?xml version="1.0" encoding="utf-8"?>
<!-- <!--
Copyright 2018-2024 Akretion (https://www.akretion.com/) Copyright 2018-2022 Akretion (http://www.akretion.com/)
@author: Alexis de Lattre <alexis.delattre@akretion.com> @author: Alexis de Lattre <alexis.delattre@akretion.com>
License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl). License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).
--> -->
@@ -12,7 +12,7 @@
<field name="inherit_id" ref="base.view_partner_bank_tree"/> <field name="inherit_id" ref="base.view_partner_bank_tree"/>
<field name="arch" type="xml"> <field name="arch" type="xml">
<field name="bank_name" position="attributes"> <field name="bank_name" position="attributes">
<attribute name="column_invisible">1</attribute> <attribute name="invisible">1</attribute>
</field> </field>
<field name="bank_name" position="after"> <field name="bank_name" position="after">
<field name="bank_id"/> <field name="bank_id"/>

View File

@@ -0,0 +1,24 @@
diff --git a/addons/web/static/src/search/filter_menu/custom_filter_item.js b/addons/web/static/src/search/filter_menu/custom_filter_item.js
index f67f5fb40af..22525b7cbfd 100644
--- a/addons/web/static/src/search/filter_menu/custom_filter_item.js
+++ b/addons/web/static/src/search/filter_menu/custom_filter_item.js
@@ -46,6 +46,8 @@ const FIELD_OPERATORS = {
char: [
{ symbol: "ilike", description: _lt("contains") },
{ symbol: "not ilike", description: _lt("doesn't contain") },
+ { symbol: "startswith", description: _lt("starts with") },
+ { symbol: "endswith", description: _lt("ends with") },
{ symbol: "=", description: _lt("is equal to") },
{ symbol: "!=", description: _lt("is not equal to") },
{ symbol: "!=", description: _lt("is set"), value: false },
@@ -257,6 +259,10 @@ export class CustomFilterItem extends Component {
[field.name, ">=", domainValue[0]],
[field.name, "<=", domainValue[1]]
);
+ } else if (operator.symbol === "startswith") {
+ domainArray.push([field.name, '=ilike', domainValue[0] + '%']);
+ } else if (operator.symbol === "endswith") {
+ domainArray.push([field.name, '=ilike', '%' + domainValue[0]]);
} else {
domainArray.push([field.name, operator.symbol, domainValue[0]]);
}

View File

@@ -1,24 +0,0 @@
# Copyright 2015-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 api, fields, models
class ResPartnerBank(models.Model):
_inherit = 'res.partner.bank'
# In the 'base' module, they didn't put any string, so the bank name is
# displayed as 'Name', which the string of the related field it
# points to
bank_name = fields.Char(string='Bank Name')
@api.depends('currency_id')
def _compute_display_name(self):
for acc in self:
name = acc.acc_number
if acc.currency_id:
name = f"{name} ({acc.currency_id.name})"
if acc.bank_id:
name = f"{name} - {acc.bank_id.name}"
acc.display_name = name

View File

@@ -1,3 +0,0 @@
[build-system]
requires = ["whool"]
build-backend = "whool.buildapi"

View File

@@ -4,7 +4,7 @@
{ {
'name': 'Commission Simple', 'name': 'Commission Simple',
'version': '18.0.1.0.0', 'version': '16.0.1.0.0',
'category': 'Sales', 'category': 'Sales',
'license': 'AGPL-3', 'license': 'AGPL-3',
'summary': 'Compute commissions for salesman', 'summary': 'Compute commissions for salesman',
@@ -40,7 +40,7 @@ This module has been written by Alexis de Lattre from Akretion
'views/commission_profile.xml', 'views/commission_profile.xml',
'views/commission_rule.xml', 'views/commission_rule.xml',
'views/commission_result.xml', 'views/commission_result.xml',
'views/account_move_line.xml', # 'views/res_users.xml',
'views/res_config_settings.xml', 'views/res_config_settings.xml',
'wizards/commission_compute_view.xml', 'wizards/commission_compute_view.xml',
], ],

View File

@@ -1,34 +0,0 @@
<?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" invisible="display_type != 'product'">
<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

@@ -16,7 +16,7 @@
<field name="arch" type="xml"> <field name="arch" type="xml">
<form> <form>
<sheet> <sheet>
<widget name="web_ribbon" title="Archived" bg_color="bg-danger" invisible="active"/> <widget name="web_ribbon" title="Archived" bg_color="bg-danger" attrs="{'invisible': [('active', '=', True)]}"/>
<group name="main"> <group name="main">
<group name="main-left"> <group name="main-left">
<field name="name"/> <field name="name"/>
@@ -31,12 +31,12 @@
<notebook> <notebook>
<page name="assignments" string="Assignments"> <page name="assignments" string="Assignments">
<field name="assign_ids"> <field name="assign_ids">
<list editable="bottom"> <tree editable="bottom">
<field name="assign_type"/> <field name="assign_type"/>
<field name="user_id" required="assign_type == 'user'" readonly="assign_type != 'user'"/> <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" groups="base.group_multi_company"/>
<field name="company_id" invisible="1"/> <field name="company_id" invisible="1"/>
</list> </tree>
</field> </field>
</page> </page>
<page name="rules" string="Rules"> <page name="rules" string="Rules">
@@ -48,24 +48,23 @@
</field> </field>
</record> </record>
<record id="commission_profile_list" model="ir.ui.view"> <record id="commission_profile_tree" model="ir.ui.view">
<field name="name">commission.profile.list</field> <field name="name">commission.profile.tree</field>
<field name="model">commission.profile</field> <field name="model">commission.profile</field>
<field name="arch" type="xml"> <field name="arch" type="xml">
<list> <tree>
<field name="sequence" widget="handle"/> <field name="sequence" widget="handle"/>
<field name="name" decoration-bf="1"/> <field name="name" decoration-bf="1"/>
<field name="trigger_type" optional="show"/> <field name="trigger_type" optional="show"/>
<field name="company_id" groups="base.group_multi_company"/> <field name="company_id" groups="base.group_multi_company"/>
</list> </tree>
</field> </field>
</record> </record>
<record id="commission_profile_action" model="ir.actions.act_window"> <record id="commission_profile_action" model="ir.actions.act_window">
<field name="name">Commission Profiles</field> <field name="name">Commission Profiles</field>
<field name="path">commission-profile</field>
<field name="res_model">commission.profile</field> <field name="res_model">commission.profile</field>
<field name="view_mode">list,form</field> <field name="view_mode">tree,form</field>
</record> </record>
<menuitem id="commission_profile_menu" action="commission_profile_action" parent="commission_config_root" sequence="18"/> <menuitem id="commission_profile_menu" action="commission_profile_action" parent="commission_config_root" sequence="18"/>

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