[IMP] account,sale,purchase: edi - generate canonical report printout when exporting
bzr revid: odo@openerp.com-20111010143806-wxxdoheg562mo8re
This commit is contained in:
parent
1e80c28ef1
commit
b3276b708c
|
@ -69,6 +69,9 @@ class account_invoice(osv.osv, EDIMixin):
|
||||||
res_partner_address = self.pool.get('res.partner.address')
|
res_partner_address = self.pool.get('res.partner.address')
|
||||||
edi_doc_list = []
|
edi_doc_list = []
|
||||||
for invoice in records:
|
for invoice in records:
|
||||||
|
# generate the main report
|
||||||
|
self._edi_generate_report_attachment(cr, uid, invoice, context=context)
|
||||||
|
|
||||||
edi_doc = super(account_invoice,self).edi_export(cr, uid, [invoice], edi_struct, context)[0]
|
edi_doc = super(account_invoice,self).edi_export(cr, uid, [invoice], edi_struct, context)[0]
|
||||||
edi_doc.update({
|
edi_doc.update({
|
||||||
'company_address': res_company.edi_export_address(cr, uid, invoice.company_id, context=context),
|
'company_address': res_company.edi_export_address(cr, uid, invoice.company_id, context=context),
|
||||||
|
|
|
@ -60,6 +60,9 @@ class purchase_order(osv.osv, EDIMixin):
|
||||||
res_partner_address = self.pool.get('res.partner.address')
|
res_partner_address = self.pool.get('res.partner.address')
|
||||||
edi_doc_list = []
|
edi_doc_list = []
|
||||||
for order in records:
|
for order in records:
|
||||||
|
# generate the main report
|
||||||
|
self._edi_generate_report_attachment(cr, uid, order, context=context)
|
||||||
|
|
||||||
# Get EDI doc based on struct. The result will also contain all metadata fields and attachments.
|
# Get EDI doc based on struct. The result will also contain all metadata fields and attachments.
|
||||||
edi_doc = super(purchase_order,self).edi_export(cr, uid, [order], edi_struct, context)[0]
|
edi_doc = super(purchase_order,self).edi_export(cr, uid, [order], edi_struct, context)[0]
|
||||||
edi_doc.update({
|
edi_doc.update({
|
||||||
|
|
|
@ -1,7 +1,11 @@
|
||||||
<?xml version="1.0" encoding="utf-8"?>
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
<openerp>
|
<openerp>
|
||||||
<data>
|
<data>
|
||||||
<report auto="False" id="report_purchase_quotation" model="purchase.order" name="purchase.quotation" rml="purchase/report/request_quotation.rml" string="Request for Quotation"/>
|
<report auto="False" id="report_purchase_quotation" model="purchase.order"
|
||||||
<report auto="False" id="report_purchase_order" model="purchase.order" name="purchase.order" rml="purchase/report/order.rml" string="Purchase Order"/>
|
name="purchase.quotation" rml="purchase/report/request_quotation.rml"
|
||||||
|
string="Request for Quotation"/>
|
||||||
|
<report auto="False" id="report_purchase_order" model="purchase.order"
|
||||||
|
name="purchase.order" rml="purchase/report/order.rml"
|
||||||
|
usage="default" string="Purchase Order"/>
|
||||||
</data>
|
</data>
|
||||||
</openerp>
|
</openerp>
|
||||||
|
|
|
@ -60,6 +60,9 @@ class sale_order(osv.osv, EDIMixin):
|
||||||
res_partner_address = self.pool.get('res.partner.address')
|
res_partner_address = self.pool.get('res.partner.address')
|
||||||
edi_doc_list = []
|
edi_doc_list = []
|
||||||
for order in records:
|
for order in records:
|
||||||
|
# generate the main report
|
||||||
|
self._edi_generate_report_attachment(cr, uid, order, context=context)
|
||||||
|
|
||||||
# Get EDI doc based on struct. The result will also contain all metadata fields and attachments.
|
# Get EDI doc based on struct. The result will also contain all metadata fields and attachments.
|
||||||
edi_doc = super(sale_order,self).edi_export(cr, uid, [order], edi_struct, context)[0]
|
edi_doc = super(sale_order,self).edi_export(cr, uid, [order], edi_struct, context)[0]
|
||||||
edi_doc.update({
|
edi_doc.update({
|
||||||
|
@ -177,7 +180,7 @@ class sale_order_line(osv.osv, EDIMixin):
|
||||||
_inherit='sale.order.line'
|
_inherit='sale.order.line'
|
||||||
|
|
||||||
def edi_export(self, cr, uid, records, edi_struct=None, context=None):
|
def edi_export(self, cr, uid, records, edi_struct=None, context=None):
|
||||||
"""Overridden to provides sale order line fields with the expected names
|
"""Overridden to provide sale order line fields with the expected names
|
||||||
(sale and purchase orders have different column names)"""
|
(sale and purchase orders have different column names)"""
|
||||||
edi_struct = dict(edi_struct or SALE_ORDER_LINE_EDI_STRUCT)
|
edi_struct = dict(edi_struct or SALE_ORDER_LINE_EDI_STRUCT)
|
||||||
edi_doc_list = []
|
edi_doc_list = []
|
||||||
|
|
|
@ -2,7 +2,9 @@
|
||||||
<openerp>
|
<openerp>
|
||||||
<data>
|
<data>
|
||||||
|
|
||||||
<report auto="False" id="report_sale_order" model="sale.order" name="sale.order" rml="sale/report/sale_order.rml" string="Quotation / Order"/>
|
<report auto="False" id="report_sale_order" model="sale.order" name="sale.order"
|
||||||
|
rml="sale/report/sale_order.rml" string="Quotation / Order"
|
||||||
|
usage="default"/>
|
||||||
|
|
||||||
</data>
|
</data>
|
||||||
</openerp>
|
</openerp>
|
||||||
|
|
Loading…
Reference in New Issue