mirror of
https://github.com/bringout/oca-ocb-l10n_europe.git
synced 2026-04-27 15:22:03 +02:00
19.0 vanilla
This commit is contained in:
parent
ff721d030e
commit
7721452493
1826 changed files with 124775 additions and 274114 deletions
30
odoo-bringout-oca-ocb-l10n_cz/l10n_cz/models/account_move.py
Normal file
30
odoo-bringout-oca-ocb-l10n_cz/l10n_cz/models/account_move.py
Normal file
|
|
@ -0,0 +1,30 @@
|
|||
# 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'
|
||||
|
||||
@api.depends('country_code')
|
||||
def _compute_taxable_supply_date(self):
|
||||
super()._compute_taxable_supply_date()
|
||||
for move in self.filtered(lambda m: m.country_code == 'CZ' and not m.taxable_supply_date):
|
||||
move.taxable_supply_date = fields.Date.context_today(move)
|
||||
|
||||
@api.depends('country_code')
|
||||
def _compute_show_taxable_supply_date(self):
|
||||
super()._compute_show_taxable_supply_date()
|
||||
for move in self.filtered(lambda m: m.country_code == 'CZ' and m.move_type != 'entry'):
|
||||
move.show_taxable_supply_date = True
|
||||
|
||||
def _compute_date(self):
|
||||
super()._compute_date()
|
||||
for move in self:
|
||||
if move.country_code == 'CZ' and move.taxable_supply_date and move.state == 'draft' and not move.statement_line_id:
|
||||
move.date = move.taxable_supply_date
|
||||
|
||||
def _get_invoice_currency_rate_date(self):
|
||||
self.ensure_one()
|
||||
if self.country_code == 'CZ' and self.taxable_supply_date:
|
||||
return self.taxable_supply_date
|
||||
return super()._get_invoice_currency_rate_date()
|
||||
Loading…
Add table
Add a link
Reference in a new issue