Přejít na obsah
Menu
You need to be registered to interact with the community.
This question has been flagged
1 Odpovědět
1269 Zobrazení

I added the 2 fields in journal entries 

<xpath expr="//page[@name='aml_tab']/field[@name='line_ids']/tree/field[@name='debit']" position="before">
<field name="deferred_start_date"/>
<field name="deferred_end_date"/>
</xpath>

in odoo default the onchange function makes the field set to false 

@api.onchange('deferred_start_date')
def _onchange_deferred_start_date(self):
if not self._is_compatible_account():
self.deferred_start_date = False

@api.onchange('deferred_end_date')
def _onchange_deferred_end_date(self):
if not self._is_compatible_account():
self.deferred_end_date = False


The other function is this 

def _is_compatible_account(self):
self.ensure_one()
return (
self.move_id.is_purchase_document()
and
self.account_id.account_type in ('expense', 'expense_depreciation', 'expense_direct_cost')
) or (
self.move_id.is_sale_document()
and
self.account_id.account_type in ('income', 'income_other')
)


the _is_compatible_account function also called from _get_deferred_tax_key .


and in generate entries function 

def _generate_deferred_entries(self):
"""
Generates the deferred entries for the invoice.
"""
self.ensure_one()
if self.is_entry():
raise UserError(_("You cannot generate deferred entries for a miscellaneous journal entry."))

What is the specific reason odoo not allowed to generate deferred entries from journal entries . ??

i think one reason is tax . 
odoo only allowed to generate entries from invoice, bills. debit note and credit notes.



Avatar
Zrušit
Nejlepší odpověď

Thank you!

Avatar
Zrušit
Related Posts Odpovědi Zobrazení Aktivita
3
čvc 25
1939
1
čvn 25
2212
2
kvě 25
1933
1
kvě 25
1171
1
úno 25
38