Use invoiced line tax field names
This commit is contained in:
+27
-27
@@ -126,40 +126,40 @@ class InvoiceLine(metaclass=PoolMeta):
|
||||
'on_change_with_product_type'
|
||||
)
|
||||
|
||||
itbis_line = fields.Function(Monetary(
|
||||
itbis_invoiced_line = fields.Function(Monetary(
|
||||
"ITBIS Invoiced", currency='currency', digits='currency',
|
||||
states=_LINE_STATES),
|
||||
'get_itbis_line'
|
||||
'get_itbis_invoiced_line'
|
||||
)
|
||||
|
||||
itbis_withholding_line = fields.Function(Monetary(
|
||||
itbis_withholding_invoiced_line = fields.Function(Monetary(
|
||||
"ITBIS Withholding", currency='currency', digits='currency',
|
||||
states=_LINE_STATES),
|
||||
'get_itbis_withholding_line'
|
||||
'get_itbis_withholding_invoiced_line'
|
||||
)
|
||||
|
||||
isc_line = fields.Function(Monetary(
|
||||
"ISC", currency='currency', digits='currency',
|
||||
isc_invoiced_line = fields.Function(Monetary(
|
||||
"ISC Invoiced", currency='currency', digits='currency',
|
||||
states=_LINE_STATES),
|
||||
'get_isc_line'
|
||||
'get_isc_invoiced_line'
|
||||
)
|
||||
|
||||
cdt_line = fields.Function(Monetary(
|
||||
"CDT", currency='currency', digits='currency',
|
||||
cdt_invoiced_line = fields.Function(Monetary(
|
||||
"CDT Invoiced", currency='currency', digits='currency',
|
||||
states=_LINE_STATES),
|
||||
'get_cdt_line'
|
||||
'get_cdt_invoiced_line'
|
||||
)
|
||||
|
||||
isr_withholding_line = fields.Function(Monetary(
|
||||
isr_withholding_invoiced_line = fields.Function(Monetary(
|
||||
"ISR Withholding", currency='currency', digits='currency',
|
||||
states=_LINE_STATES),
|
||||
'get_isr_withholding_line'
|
||||
'get_isr_withholding_invoiced_line'
|
||||
)
|
||||
|
||||
tip_line = fields.Function(Monetary(
|
||||
"Tip", currency='currency', digits='currency',
|
||||
tip_invoiced_line = fields.Function(Monetary(
|
||||
"Tip Invoiced", currency='currency', digits='currency',
|
||||
states=_LINE_STATES),
|
||||
'get_tip_line'
|
||||
'get_tip_invoiced_line'
|
||||
)
|
||||
|
||||
line_total = fields.Function(Monetary(
|
||||
@@ -239,27 +239,27 @@ class InvoiceLine(metaclass=PoolMeta):
|
||||
return Decimal('0.0')
|
||||
|
||||
@classmethod
|
||||
def get_itbis_line(cls, lines, name):
|
||||
def get_itbis_invoiced_line(cls, lines, name):
|
||||
return {l.id: cls._compute_tax_kind_amount(l, 'itbis') for l in lines}
|
||||
|
||||
@classmethod
|
||||
def get_itbis_withholding_line(cls, lines, name):
|
||||
def get_itbis_withholding_invoiced_line(cls, lines, name):
|
||||
return {l.id: cls._compute_tax_kind_amount(l, 'itbis_withholding') for l in lines}
|
||||
|
||||
@classmethod
|
||||
def get_isc_line(cls, lines, name):
|
||||
def get_isc_invoiced_line(cls, lines, name):
|
||||
return {l.id: cls._compute_tax_kind_amount(l, 'isc') for l in lines}
|
||||
|
||||
@classmethod
|
||||
def get_cdt_line(cls, lines, name):
|
||||
def get_cdt_invoiced_line(cls, lines, name):
|
||||
return {l.id: cls._compute_tax_kind_amount(l, 'cdt') for l in lines}
|
||||
|
||||
@classmethod
|
||||
def get_isr_withholding_line(cls, lines, name):
|
||||
def get_isr_withholding_invoiced_line(cls, lines, name):
|
||||
return {l.id: cls._compute_tax_kind_amount(l, 'isr_withholding') for l in lines}
|
||||
|
||||
@classmethod
|
||||
def get_tip_line(cls, lines, name):
|
||||
def get_tip_invoiced_line(cls, lines, name):
|
||||
return {l.id: cls._compute_tax_kind_amount(l, 'tip') for l in lines}
|
||||
|
||||
@classmethod
|
||||
@@ -267,27 +267,27 @@ class InvoiceLine(metaclass=PoolMeta):
|
||||
return {l.id: cls._compute_line_total_amount(l) for l in lines}
|
||||
|
||||
@fields.depends(*_LINE_DEPENDS, methods=['on_change_with_amount'])
|
||||
def on_change_with_itbis_line(self, name=None):
|
||||
def on_change_with_itbis_invoiced_line(self, name=None):
|
||||
return InvoiceLine._compute_tax_kind_amount(self, 'itbis')
|
||||
|
||||
@fields.depends(*_LINE_DEPENDS, methods=['on_change_with_amount'])
|
||||
def on_change_with_itbis_withholding_line(self, name=None):
|
||||
def on_change_with_itbis_withholding_invoiced_line(self, name=None):
|
||||
return InvoiceLine._compute_tax_kind_amount(self, 'itbis_withholding')
|
||||
|
||||
@fields.depends(*_LINE_DEPENDS, methods=['on_change_with_amount'])
|
||||
def on_change_with_isc_line(self, name=None):
|
||||
def on_change_with_isc_invoiced_line(self, name=None):
|
||||
return InvoiceLine._compute_tax_kind_amount(self, 'isc')
|
||||
|
||||
@fields.depends(*_LINE_DEPENDS, methods=['on_change_with_amount'])
|
||||
def on_change_with_cdt_line(self, name=None):
|
||||
def on_change_with_cdt_invoiced_line(self, name=None):
|
||||
return InvoiceLine._compute_tax_kind_amount(self, 'cdt')
|
||||
|
||||
@fields.depends(*_LINE_DEPENDS, methods=['on_change_with_amount'])
|
||||
def on_change_with_isr_withholding_line(self, name=None):
|
||||
def on_change_with_isr_withholding_invoiced_line(self, name=None):
|
||||
return InvoiceLine._compute_tax_kind_amount(self, 'isr_withholding')
|
||||
|
||||
@fields.depends(*_LINE_DEPENDS, methods=['on_change_with_amount'])
|
||||
def on_change_with_tip_line(self, name=None):
|
||||
def on_change_with_tip_invoiced_line(self, name=None):
|
||||
return InvoiceLine._compute_tax_kind_amount(self, 'tip')
|
||||
|
||||
@fields.depends(*_LINE_DEPENDS, methods=['on_change_with_amount'])
|
||||
|
||||
+9
-9
@@ -92,28 +92,28 @@ msgctxt "selection:ir.cron,method:"
|
||||
msgid "Process Posted Supplier Invoices"
|
||||
msgstr "Procesar Facturas de Proveedores Contabilizadas"
|
||||
|
||||
msgctxt "field:account.invoice.line,itbis_line:"
|
||||
msgctxt "field:account.invoice.line,itbis_invoiced_line:"
|
||||
msgid "ITBIS Invoiced"
|
||||
msgstr "ITBIS Facturado"
|
||||
|
||||
msgctxt "field:account.invoice.line,itbis_withholding_line:"
|
||||
msgctxt "field:account.invoice.line,itbis_withholding_invoiced_line:"
|
||||
msgid "ITBIS Withholding"
|
||||
msgstr "ITBIS Retenido"
|
||||
|
||||
msgctxt "field:account.invoice.line,isc_line:"
|
||||
msgid "ISC"
|
||||
msgctxt "field:account.invoice.line,isc_invoiced_line:"
|
||||
msgid "ISC Invoiced"
|
||||
msgstr "ISC Facturado"
|
||||
|
||||
msgctxt "field:account.invoice.line,cdt_line:"
|
||||
msgid "CDT"
|
||||
msgctxt "field:account.invoice.line,cdt_invoiced_line:"
|
||||
msgid "CDT Invoiced"
|
||||
msgstr "CDT Facturado"
|
||||
|
||||
msgctxt "field:account.invoice.line,isr_withholding_line:"
|
||||
msgctxt "field:account.invoice.line,isr_withholding_invoiced_line:"
|
||||
msgid "ISR Withholding"
|
||||
msgstr "ISR Retenido"
|
||||
|
||||
msgctxt "field:account.invoice.line,tip_line:"
|
||||
msgid "Tip"
|
||||
msgctxt "field:account.invoice.line,tip_invoiced_line:"
|
||||
msgid "Tip Invoiced"
|
||||
msgstr "Propina Legal"
|
||||
|
||||
msgctxt "field:account.invoice.line,line_total:"
|
||||
|
||||
@@ -53,7 +53,7 @@ class AccountInvoiceDoUnitTestCase(unittest.TestCase):
|
||||
InvoiceLine._compute_tax_kind_amount(line, 'itbis'),
|
||||
Decimal('18.00'))
|
||||
self.assertEqual(
|
||||
InvoiceLine.on_change_with_itbis_line(line),
|
||||
InvoiceLine.on_change_with_itbis_invoiced_line(line),
|
||||
Decimal('18.00'))
|
||||
self.assertEqual(
|
||||
InvoiceLine._compute_line_total_amount(line),
|
||||
|
||||
@@ -98,7 +98,7 @@ class AccountInvoiceDoTestCase(ModuleTestCase):
|
||||
self.assertEqual(invoice.total_amount, Decimal('300.00'))
|
||||
line, = invoice.lines
|
||||
self.assertEqual(line.product_type, '')
|
||||
self.assertEqual(line.itbis_line, Decimal('0.00'))
|
||||
self.assertEqual(line.itbis_invoiced_line, Decimal('0.00'))
|
||||
self.assertEqual(line.line_total, Decimal('300.00'))
|
||||
|
||||
|
||||
|
||||
+12
-12
@@ -5,18 +5,18 @@ this repository contains the full copyright notices and license terms. -->
|
||||
<xpath expr="/form/notebook/page[@id='general']/field[@name='amount']"
|
||||
position="after">
|
||||
<newline/>
|
||||
<label name="itbis_line"/>
|
||||
<field name="itbis_line"/>
|
||||
<label name="itbis_withholding_line"/>
|
||||
<field name="itbis_withholding_line"/>
|
||||
<label name="isc_line"/>
|
||||
<field name="isc_line"/>
|
||||
<label name="cdt_line"/>
|
||||
<field name="cdt_line"/>
|
||||
<label name="isr_withholding_line"/>
|
||||
<field name="isr_withholding_line"/>
|
||||
<label name="tip_line"/>
|
||||
<field name="tip_line"/>
|
||||
<label name="itbis_invoiced_line"/>
|
||||
<field name="itbis_invoiced_line"/>
|
||||
<label name="itbis_withholding_invoiced_line"/>
|
||||
<field name="itbis_withholding_invoiced_line"/>
|
||||
<label name="isc_invoiced_line"/>
|
||||
<field name="isc_invoiced_line"/>
|
||||
<label name="cdt_invoiced_line"/>
|
||||
<field name="cdt_invoiced_line"/>
|
||||
<label name="isr_withholding_invoiced_line"/>
|
||||
<field name="isr_withholding_invoiced_line"/>
|
||||
<label name="tip_invoiced_line"/>
|
||||
<field name="tip_invoiced_line"/>
|
||||
<label name="line_total"/>
|
||||
<field name="line_total"/>
|
||||
</xpath>
|
||||
|
||||
@@ -15,12 +15,12 @@ this repository contains the full copyright notices and license terms. -->
|
||||
</xpath>
|
||||
|
||||
<xpath expr="/tree/field[@name='amount']" position="after">
|
||||
<field name="itbis_line" optional="0"/>
|
||||
<field name="itbis_withholding_line" optional="0"/>
|
||||
<field name="isc_line" optional="0"/>
|
||||
<field name="cdt_line" optional="0"/>
|
||||
<field name="isr_withholding_line" optional="0"/>
|
||||
<field name="tip_line" optional="0"/>
|
||||
<field name="itbis_invoiced_line" optional="0"/>
|
||||
<field name="itbis_withholding_invoiced_line" optional="0"/>
|
||||
<field name="isc_invoiced_line" optional="0"/>
|
||||
<field name="cdt_invoiced_line" optional="0"/>
|
||||
<field name="isr_withholding_invoiced_line" optional="0"/>
|
||||
<field name="tip_invoiced_line" optional="0"/>
|
||||
<field name="line_total" optional="0"/>
|
||||
</xpath>
|
||||
|
||||
|
||||
Reference in New Issue
Block a user