This commit is contained in:
2026-03-26 19:15:14 +01:00
parent 841f7a1c20
commit 8b6b93171f
5 changed files with 4153 additions and 4 deletions

View File

@@ -186,6 +186,7 @@ def register():
module='purchase', type_='model')
Pool.register(
invoice.Invoice,
invoice.InvoiceLine,
module='account_invoice', type_='model')
Pool.register(
forex.Forex,

View File

@@ -249,3 +249,49 @@ class Invoice(metaclass=PoolMeta):
if shipment:
return shipment.number or ''
return ''
class InvoiceLine(metaclass=PoolMeta):
__name__ = 'account.invoice.line'
def _get_report_trade(self):
origin = getattr(self, 'origin', None)
if not origin:
return None
return getattr(origin, 'sale', None) or getattr(origin, 'purchase', None)
@property
def report_product_description(self):
if self.product:
return self.product.description or ''
origin = getattr(self, 'origin', None)
if origin and getattr(origin, 'product', None):
return origin.product.description or ''
return ''
@property
def report_crop_name(self):
trade = self._get_report_trade()
if trade and getattr(trade, 'crop', None):
return trade.crop.name or ''
return ''
@property
def report_attributes_name(self):
origin = getattr(self, 'origin', None)
if origin:
return getattr(origin, 'attributes_name', '') or ''
return ''
@property
def report_net(self):
if self.type == 'line':
return self.quantity
return ''
@property
def report_lbs(self):
net = self.report_net
if net == '':
return ''
return Decimal(net) * Decimal('2.20462')

View File

@@ -0,0 +1,17 @@
<?xml version="1.0"?>
<tryton>
<data>
<record model="ir.action.report" id="report_invoice_ict_final">
<field name="name">Final Invoice ICT</field>
<field name="model">account.invoice</field>
<field name="report_name">account.invoice</field>
<field name="report">purchase_trade/invoice_ict_final.fodt</field>
<field name="single" eval="True"/>
</record>
<record model="ir.action.keyword" id="report_invoice_ict_final_keyword">
<field name="keyword">form_print</field>
<field name="model">account.invoice,-1</field>
<field name="action" ref="report_invoice_ict_final"/>
</record>
</data>
</tryton>

File diff suppressed because it is too large Load Diff

View File

@@ -29,8 +29,9 @@ xml:
party.xml
forex.xml
global_reporting.xml
derivative.xml
valuation.xml
weight_report.xml
dimension.xml
derivative.xml
valuation.xml
weight_report.xml
dimension.xml
backtoback.xml
invoice.xml