Bỏ qua để đến Nội dung
Menu
Câu hỏi này đã bị gắn cờ
1 Trả lời
1173 Lượt xem

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.



Ảnh đại diện
Huỷ bỏ
Câu trả lời hay nhất

Thank you!

Ảnh đại diện
Huỷ bỏ
Bài viết liên quan Trả lời Lượt xem Hoạt động
3
thg 7 25
1822
1
thg 6 25
1889
2
thg 5 25
1790
1
thg 5 25
1051
1
thg 2 25
38