Skip to content

Commit

Permalink
Merge commit 'refs/pull/96074/head' of https://github.com/odoo/odoo i…
Browse files Browse the repository at this point in the history
…nto 16.0-390
  • Loading branch information
docker-odoo committed Nov 7, 2022
2 parents 12ac629 + a318d4a commit aca5a65
Show file tree
Hide file tree
Showing 27 changed files with 2,551 additions and 5 deletions.
12 changes: 8 additions & 4 deletions addons/account/models/account_payment.py
Original file line number Diff line number Diff line change
Expand Up @@ -815,17 +815,21 @@ def _synchronize_from_moves(self, changed_fields):
move.write(move._cleanup_write_orm_values(move, move_vals_to_write))
pay.write(move._cleanup_write_orm_values(pay, payment_vals_to_write))

@api.model
def _get_trigger_fields_to_synchronize(self):
return (
'date', 'amount', 'payment_type', 'partner_type', 'payment_reference', 'is_internal_transfer',
'currency_id', 'partner_id', 'destination_account_id', 'partner_bank_id', 'journal_id'
)

def _synchronize_to_moves(self, changed_fields):
''' Update the account.move regarding the modified account.payment.
:param changed_fields: A list containing all modified fields on account.payment.
'''
if self._context.get('skip_account_move_synchronization'):
return

if not any(field_name in changed_fields for field_name in (
'date', 'amount', 'payment_type', 'partner_type', 'payment_reference', 'is_internal_transfer',
'currency_id', 'partner_id', 'destination_account_id', 'partner_bank_id', 'journal_id'
)):
if not any(field_name in changed_fields for field_name in self._get_trigger_fields_to_synchronize()):
return

for pay in self.with_context(skip_account_move_synchronization=True):
Expand Down
9 changes: 9 additions & 0 deletions addons/account_check_printing/models/account_payment.py
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,15 @@ class AccountPayment(models.Model):
"or if the current numbering is wrong, you can change it in the journal configuration page.",
)
payment_method_line_id = fields.Many2one(index=True)
show_check_number = fields.Boolean(compute='_compute_show_check_number')

@api.depends('payment_method_line_id.code', 'check_number')
def _compute_show_check_number(self):
for payment in self:
payment.show_check_number = (
payment.payment_method_line_id.code == 'check_printing'
and payment.check_number
)

@api.constrains('check_number', 'journal_id')
def _constrains_check_number(self):
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,8 @@
</xpath>
<xpath expr="//field[@name='payment_method_line_id']" position="after">
<field name="check_manual_sequencing" invisible="1"/>
<field name="check_number" attrs="{'invisible': ['|', ('payment_method_code', '!=', 'check_printing'), ('check_number', '=', False)]}"/>
<field name="show_check_number" invisible="1"/>
<field name="check_number" attrs="{'invisible': [('show_check_number', '=', False)]}"/>
</xpath>
<xpath expr="//field[@name='name']" position='before'>
<widget name="web_ribbon" title="Sent" attrs="{'invisible': [('is_move_sent', '!=', True)]}"/>
Expand Down
2 changes: 2 additions & 0 deletions addons/l10n_latam_check/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
from . import models
from . import wizards
65 changes: 65 additions & 0 deletions addons/l10n_latam_check/__manifest__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,65 @@
# Part of Odoo. See LICENSE file for full copyright and licensing details.
{
'name': 'Advanced Check Management',
'version': "1.0.0",
'category': 'Accounting/Localizations',
'summary': 'Checks Management',
'description': """
Own Checks Management
---------------------
Extends 'Check Printing Base' module to manage own checks with more features:
* allow using own checks that are not printed but filled manually by the user
* allow to use checkbooks to track numbering
* allow to use different checkbooks type (deferred, electronic, current)
* add an optional "payment date" for post-dated checks (deferred payments)
* add a menu to track own checks
* two modifications are done when using checkbooks:
* the next number of the check is suggested but editable by the user. This is needed for electronic checks where the next number is given by the bank and also when using pre-printed checkbooks where it's really common that the order of inputting checks in odoo is not the same as the numbering
* the printing functionality is disabled because there is not standard format and a report for each bank should be implemented. It's a nice to have that could be implemented by customization if needed
Third Party Checks Management
-----------------------------
Add new "Third party check Management" feature.
There are 2 main Payment Methods additions:
* New Third party checks:
* allow the user create a check on the fly from a payment
* create a third party check from a customer payment
* Third party check:
* allow the user to reuse a Third party check already created
* pay a vendor bill using an existing Third party check
* move an existing checks between journals (i.e. move to Rejected)
* Send/Receive again a check already used in a Vendor Bill/Customer INV
* allow the user to do mass check transfers
""",
'author': 'ADHOC SA',
'license': 'LGPL-3',
'images': [
],
'depends': [
'account_check_printing',
'base_vat',
],
'data': [
'data/account_payment_method_data.xml',
'security/ir.model.access.csv',
'views/account_payment_view.xml',
'views/l10n_latam_checkbook_view.xml',
'views/account_journal_view.xml',
'wizards/account_payment_register_views.xml',
'wizards/l10n_latam_payment_mass_transfer_views.xml',
],
'installable': True,
'auto_install': False,
'application': False,
}
23 changes: 23 additions & 0 deletions addons/l10n_latam_check/data/account_payment_method_data.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
<?xml version="1.0" encoding="utf-8"?>
<odoo noupdate="1">

<!-- third party checks -->
<record id="account_payment_method_new_third_party_checks" model="account.payment.method">
<field name="name">New Third party checks</field>
<field name="code">new_third_party_checks</field>
<field name="payment_type">inbound</field>
</record>

<record id="account_payment_method_in_third_party_checks" model="account.payment.method">
<field name="name">Third party checks</field>
<field name="code">in_third_party_checks</field>
<field name="payment_type">inbound</field>
</record>

<record id="account_payment_method_out_third_party_checks" model="account.payment.method">
<field name="name">Third party checks</field>
<field name="code">out_third_party_checks</field>
<field name="payment_type">outbound</field>
</record>

</odoo>

0 comments on commit aca5a65

Please sign in to comment.