Task 2005940
account:
* Use stored compute methods instead of default for
{out,in}bound_payment_method_ids
* Track is_move_sent in the chatter
* Split 'Invoices' and 'Bills' in the smart button of payment form
* Because account.payment.method can be shown on the res.partner form,
we need to relax the security level to readonly for all users
account_check_printing:
* Add the preferred payment method for partners, with a related on
account move allowing to do a group by and doing payments in batch
* Add a constraint to forbid twice the same check number in the same
journal
* The amount in words is now readonly to prevent typos and mismatches
with the amount in digits
* Remove the field `check_number_int`. The check number is kept as Char
so that '000012345' is not displayed (and printed) as '12,345' but it
is parsed so that comparison and incrementation are possible.
closes odoo/odoo#56179
Related: odoo/upgrade#1669
Related: odoo/enterprise#12527
Signed-off-by: oco-odoo <oco-odoo@users.noreply.github.com>
24 lines
763 B
Python
24 lines
763 B
Python
# -*- coding: utf-8 -*-
|
|
# Part of Odoo. See LICENSE file for full copyright and licensing details.
|
|
|
|
|
|
from odoo import models, fields, api
|
|
|
|
|
|
class AccountMove(models.Model):
|
|
_inherit = 'account.move'
|
|
|
|
preferred_payment_method_id = fields.Many2one(
|
|
string="Preferred Payment Method",
|
|
comodel_name='account.payment.method',
|
|
compute='_compute_preferred_payment_method_idd',
|
|
store=True,
|
|
)
|
|
|
|
@api.depends('partner_id')
|
|
def _compute_preferred_payment_method_idd(self):
|
|
for move in self:
|
|
partner = move.partner_id
|
|
# take the payment method corresponding to the move's company
|
|
move.preferred_payment_method_id = partner.with_company(move.company_id).property_payment_method_id
|