26.03.26
This commit is contained in:
@@ -186,6 +186,7 @@ def register():
|
|||||||
module='purchase', type_='model')
|
module='purchase', type_='model')
|
||||||
Pool.register(
|
Pool.register(
|
||||||
invoice.Invoice,
|
invoice.Invoice,
|
||||||
|
invoice.InvoiceLine,
|
||||||
module='account_invoice', type_='model')
|
module='account_invoice', type_='model')
|
||||||
Pool.register(
|
Pool.register(
|
||||||
forex.Forex,
|
forex.Forex,
|
||||||
|
|||||||
@@ -249,3 +249,49 @@ class Invoice(metaclass=PoolMeta):
|
|||||||
if shipment:
|
if shipment:
|
||||||
return shipment.number or ''
|
return shipment.number or ''
|
||||||
return ''
|
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')
|
||||||
|
|||||||
17
modules/purchase_trade/invoice.xml
Normal file
17
modules/purchase_trade/invoice.xml
Normal 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>
|
||||||
4084
modules/purchase_trade/invoice_ict_final.fodt
Normal file
4084
modules/purchase_trade/invoice_ict_final.fodt
Normal file
File diff suppressed because it is too large
Load Diff
@@ -34,3 +34,4 @@ xml:
|
|||||||
weight_report.xml
|
weight_report.xml
|
||||||
dimension.xml
|
dimension.xml
|
||||||
backtoback.xml
|
backtoback.xml
|
||||||
|
invoice.xml
|
||||||
|
|||||||
Reference in New Issue
Block a user