- Improve warning message when user tries to create credit note - Hide 'Active' column in Taxes/Currencies and added default 'Active' filter in Taxes - Removed 'save this page...' under 'Account Follow-up Levels','Budget Management', 'Asset Management','Deferred Revenues Management' section in Accounting Settings - Fixed margin between Cash Rounding checkbox and it's link in Accounting Settings - Renamed action menu 'Confirm Payments' to 'Post Payments' for payments to make it consistent with it's form view - Hide payment acquirers config for non-adviser users and also restric editing access rights for non advisior and employee user (only data read access rights on payment acquirers) - Renamed Journal type from 'Sale' to 'Sales' and journals 'POS Sale Journal, Stock Journal, Cash Basis Tax Journal to Point of Sale Journal, Inventory Valuation Journal and Cash Basis Taxes Journal respectively - Renamed the stat button 'Entries' to 'Items' for account assets form view - Improved description and name of account_voucher module - Improved Menu typo, Purchase Receipts to Purchases Receipts - account_check_printing, hr_expense_check: made field storing check numbers character instead of integer, integer field for check numbers shows check numbers as amount (i.e., with thousand separator) on UI, which is wrong, hence replaced it with character type field and a constraint to allow only numbers to be stored in it. TaskID: 40157 Co-authored-by: Ravi Gohil <rgo@odoo.com> closes odoo/odoo#21982
41 lines
2.1 KiB
Python
41 lines
2.1 KiB
Python
# -*- coding: utf-8 -*-
|
|
|
|
from odoo import models, fields, api
|
|
|
|
|
|
class HrExpenseRegisterPaymentWizard(models.TransientModel):
|
|
_inherit = "hr.expense.sheet.register.payment.wizard"
|
|
|
|
check_amount_in_words = fields.Char(string="Amount in Words")
|
|
check_manual_sequencing = fields.Boolean(related='journal_id.check_manual_sequencing', readonly=False)
|
|
# Note: a check_number == 0 means that it will be attributed when the check is printed
|
|
check_number = fields.Char(string="Check Number", readonly=True, copy=False, default=0,
|
|
help="Number of the check corresponding to this payment. If your pre-printed check are not already numbered, "
|
|
"you can manage the numbering in the journal configuration page.")
|
|
payment_method_code_2 = fields.Char(related='payment_method_id.code',
|
|
help="Technical field used to adapt the interface to the payment type selected.",
|
|
string="Payment Method Code 2",
|
|
readonly=True)
|
|
|
|
@api.onchange('journal_id')
|
|
def _onchange_journal_id(self):
|
|
if hasattr(super(HrExpenseRegisterPaymentWizard, self), '_onchange_journal_id'):
|
|
super(HrExpenseRegisterPaymentWizard, self)._onchange_journal_id()
|
|
if self.journal_id.check_manual_sequencing:
|
|
self.check_number = self.journal_id.check_sequence_id.number_next_actual
|
|
|
|
@api.onchange('amount')
|
|
def _onchange_amount(self):
|
|
if hasattr(super(HrExpenseRegisterPaymentWizard, self), '_onchange_amount'):
|
|
super(HrExpenseRegisterPaymentWizard, self)._onchange_amount()
|
|
self.check_amount_in_words = self.currency_id.amount_to_text(self.amount)
|
|
|
|
def _get_payment_vals(self):
|
|
res = super(HrExpenseRegisterPaymentWizard, self)._get_payment_vals()
|
|
if self.payment_method_id == self.env.ref('account_check_printing.account_payment_method_check'):
|
|
res.update({
|
|
'check_amount_in_words': self.check_amount_in_words,
|
|
'check_manual_sequencing': self.check_manual_sequencing,
|
|
})
|
|
return res
|