diff --git a/addons/account/invoice.py b/addons/account/invoice.py index fe4d16196c8..93f91811b0f 100644 --- a/addons/account/invoice.py +++ b/addons/account/invoice.py @@ -35,7 +35,6 @@ import ir import pooler import mx.DateTime from mx.DateTime import RelativeDateTime - from tools import config from tools.translate import _ diff --git a/addons/custom/corporate_defaults.xsl b/addons/custom/corporate_defaults.xsl index 160ad1b07e5..71d940ca520 100644 --- a/addons/custom/corporate_defaults.xsl +++ b/addons/custom/corporate_defaults.xsl @@ -13,66 +13,69 @@ - - - - - 1cm 27.7cm 20cm 27.7cm - 1cm 25.7cm 7cm 25.7cm + + + + + 1cm 25.4cm 20cm 25.4cm + - - - + + + - - Phone: - - Mail: - + Phone: + + Mail: + + - 1.5cm 2.15cm 19.9cm 2.15cm - + 1.5cm 1.2cm 19.9cm 1.2cm Your contact : + + - - - - - 1cm 27.7cm 20cm 27.7cm - 1cm 25.7cm 7cm 25.7cm + + + + + 1cm 25.4cm 20cm 25.4cm + - - - + + + - - + + + - - Phone: - - Mail: - + Phone: + + Mail: + - 1.5cm 2.15cm 19.9cm 2.15cm - + 1.5cm 1.2cm 19.9cm 1.2cm - Your contact : + diff --git a/addons/purchase/report/order.rml b/addons/purchase/report/order.rml index cf048a690df..38306cb3fbf 100644 --- a/addons/purchase/report/order.rml +++ b/addons/purchase/report/order.rml @@ -1,3 +1,333 @@ -[[ repeatIn(objects,'o') ]] [[ repeatIn(o.dest_address_id and [o.dest_address_id] or [],'addr') ]]Shipping address :[[ o.partner_id.title or '' ]] [[ o.partner_id.name ]][[ addr.title or '' ]] [[ addr.name ]][[ addr.street ]][[ addr.street2 or '' ]][[ addr.zip or '' ]] [[ addr.city or '' ]][[ addr.state_id and addr.state_id.name or '' ]][[ addr.country_id and addr.country_id.name or '' ]] [[ o.partner_id.title or '' ]] [[ o.partner_id.name ]][[ o.partner_address_id.title or '' ]] [[ o.partner_address_id.name ]][[ o.partner_address_id.street ]][[ o.partner_address_id.street2 or '' ]][[ o.partner_address_id.zip or '' ]] [[ o.partner_address_id.city or '' ]][[ o.partner_address_id.state_id and o.partner_address_id.state_id.name or '' ]][[ o.partner_address_id.country_id and o.partner_address_id.country_id.name or '' ]] Tél. : [[ o.partner_address_id.phone or '' ]]Fax : [[ o.partner_address_id.fax or '' ]]TVA : [[ o.partner_id.vat or '' ]] Request for Quotation [[ (o.state=='draft' or removeParentNode('font')) and '' ]]Order [[ (o.state<>'draft' or removeParentNode('font')) and '' ]]N° : [[ o.name ]] Our order reference : [[ o.ref or '' ]]Your order reference : [[ o.partner_ref or '' ]]Date ordered : [[ time.strftime('%d/%m/%Y', time.strptime(o.date_order, '%Y-%m-%d')) ]]Validated by : [[ o.validator and o.validator.name or '' ]] Product DescriptionApplicable TaxesDate RequestedQtyUnit PriceNet Price
[[ repeatIn(o.order_line,'line') ]][[ line.product_id and get_product_code(line.product_id.id, o.partner_id.id) or '' ]][[ line.name ]][[ ', '.join(map(lambda x: x.name, line.taxes_id))]][[ time.strftime('%d/%m/%Y', time.strptime( line.date_planned, '%Y-%m-%d')) ]][[ '%.2f' % line.product_qty ]] [[ line.product_uom.name ]][[ '%.2f' % line.price_unit ]][[ '%.2f' % line.price_subtotal ]][[ repeatIn((line.notes and line.notes.splitlines()) or [], 'l') ]][[ l or removeParentNode('table') ]]
Net Total :[[ '%.2f' % o.amount_untaxed ]] [[ o.pricelist_id.currency_id.name ]] Taxes :[[ '%.2f' % o.amount_tax ]] [[ o.pricelist_id.currency_id.name ]] TOTAL :[[ '%.2f' % o.amount_total ]] [[ o.pricelist_id.currency_id.name ]] [[ format(o.notes or '') ]]
- + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + [[ repeatIn(objects,'o') ]] + + + + + + + [[ repeatIn(o.dest_address_id and [o.dest_address_id] or [],'addr') ]] + Shipping address : + [[ o.partner_id.title or '' ]] [[ o.partner_id.name ]] + [[ addr.title or '' ]] [[ addr.name ]] + [[ addr.street or '']] + [[ addr.street2 or '' ]] + [[ addr.zip or '' ]] [[ addr.city or '' ]] + [[ addr.state_id and addr.state_id.name or '' ]] + [[ addr.country_id and addr.country_id.name or '' ]] + + + [[ o.partner_id.title or '' ]] [[ o.partner_id.name ]] + [[ o.partner_address_id.title or '' ]] [[ o.partner_address_id.name ]] + [[ o.partner_address_id.street ]] + [[ o.partner_address_id.street2 or '' ]] + [[ o.partner_address_id.zip or '' ]] [[ o.partner_address_id.city or '' ]] + [[ o.partner_address_id.state_id and o.partner_address_id.state_id.name or '' ]] + [[ o.partner_address_id and o.partner_address_id.country_id and o.partner_address_id.country_id.name or '' ]] + + + + Tél. : [[ o.partner_address_id and o.partner_address_id.phone or '' ]] + Fax : [[ o.partner_address_id and o.partner_address_id.fax or '' ]] + TVA :[[ o.partner_id and o.partner_address_id.vat or '' ]] + + + + + + + Request for quotation [[ (o.state=='draft' or removeParentNode('font')) and '' ]] Order [[ (o.state&lt;&gt;'draft' or removeParentNode('font')) and '' ]] N° [[ o.name ]] + + + + + + + Our Order Reference + + + Your Order Reference + + + Date Ordered + + + Validated By + + + + + + + [[ o.ref or '' ]] + + + [[ o.partner_ref or '' ]] + + + [[ time.strftime('%d/%m/%Y', time.strptime(o.date_order, '%Y-%m-%d')) ]] + + + [[ o.validator and o.validator.name or '' ]] + + + + + + + + + + Description + + + Taxes + + + Date Req. + + + Qty + + + Unit Price + + + Net Price + + + +
+ [[ repeatIn(o.order_line,'line') ]] + + + + [[ line.name ]] + + + [[ ', '.join(map(lambda x: x.name, line.taxes_id)) ]] + + + [[ time.strftime('%d/%m/%Y', time.strptime( line.date_planned, '%Y-%m-%d')) ]] + + + [[line.product_qty ]] + + + [[ line.product_uom.name ]] + + + [[line.price_unit ]] + + + [[line.price_subtotal ]] + + + + + + + [[ repeatIn((line.notes and line.notes.splitlines()) or [], 'l') ]] + + + [[ l or removeParentNode('table') ]] + + + +
+ + + + + + + + + Net Total: + + + [[o.amount_untaxed or 0]] + + + [[ o.pricelist_id.currency_id.name ]] + + + + + + + + + + Taxes: + + + [[o.amount_tax or 0 ]] + + + [[ o.pricelist_id.currency_id.name ]] + + + + + + + + + + Total: + + + [[ o.amount_total ]] + + + [[ o.pricelist_id.currency_id.name ]] + + + + + + + + + + [[ format(o.notes or '') ]] + + + + + + +
+
diff --git a/addons/purchase/report/request_quotation.rml b/addons/purchase/report/request_quotation.rml index 768a28cf6ce..c6bbd184bee 100644 --- a/addons/purchase/report/request_quotation.rml +++ b/addons/purchase/report/request_quotation.rml @@ -1,3 +1,175 @@ -[[ repeatIn(objects,'order') ]][[ setLang(order.partner_id.lang) ]] [[ order.partner_id.title ]][[ order.partner_id.name ]][[ order.partner_address_id.title ]][[ order.partner_address_id.name ]][[ order.partner_address_id.street ]][[ order.partner_address_id.street2 ]][[ order.partner_address_id.zip ]][[ order.partner_address_id.city ]][[ (order.partner_address_id.state_id and order.partner_address_id.state_id.name) or '' ]][[ (order.partner_address_id.country_id and order.partner_address_id.country_id.name) or '' ]] Tel. : [[ order.partner_address_id.phone ]]Fax : [[ order.partner_address_id.fax ]]TVA : [[ order.partner_id.vat ]]Request for Quotation [[ order.name ]] Other reference :[[ order.ref ]]Printed: [[ time.strftime('%d/%m/%Y') ]] Please find hereby a request for quotation. ProductDateQty
[[ repeatIn(order.order_line,'order_line') ]][[ order_line.product_id.default_code ]] - [[ order_line.name ]][[ time.strftime('%d/%m/%Y', time.strptime( order_line.date_planned, '%Y-%m-%d')) ]][[ order_line.product_qty ]][[ order_line.product_uom.name ]][[ order_line.notes ]]
[[ order.notes ]] Thanks, [[ user.signature ]]
- + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + [[ repeatIn(objects,'order') ]] + [[ setLang(order.partner_id.lang) ]] + + + + + + + + + + + + + + [[ (order.partner_id and order.partner_id.title) or '' ]][[ order.partner_id.name ]] + [[ (order.partner_address_id and order.partner_address_id.title) or '' ]][[ order.partner_address_id.name ]] + [[ (order.partner_address_id and order.partner_address_id.street) or '']][[ order.partner_address_id.street2 ]] + [[ (order.partner_address_id and order.partner_address_id.zip) or '' ]][[ (order.partner_address_id and order.partner_address_id.city) or '' ]] + [[ order.partner_address_id.state_id.code ]][[ (order.partner_address_id and order.partner_address_id.country_id and order.partner_address_id.country_id.code) or '' ]] + + + + Tel.�: [[ (order.partner_address_id and order.partner_address_id.phone) or '' ]] + Fax�: [[ (order.partner_address_id and order.partner_address_id.fax) or '' ]] + TVA�: [[ (order.partner_id and order.partner_id.vat) or '' ]] + + + + Request for Quotation [[ order.name ]] + Other reference :[[ order.ref or '' ]] + Printed: [[ time.strftime('%d/%m/%Y') ]] + + + + Please find hereby a request for quotation. + + + + + + + Product + + + Description + + + Date + + + Qty + + + +
+ [[ repeatIn(order.order_line,'order_line') ]] + + + + [[ (order_line.product_id and order_line.product_id.default_code) or '']] + + + [[ order_line.name ]] + + + [[ time.strftime('%d/%m/%Y', time.strptime( order_line.date_planned, '%Y-%m-%d')) ]] + + + [[ order_line.product_qty or '' ]] + + + [[ (order_line.product_uom and order_line.product_uom.name) or '' ]] + + + + + + + [[ repeatIn((order_line.notes and order_line.notes.splitlines()) or [], 'l') ]] + + + [[ l or removeParentNode('table') ]] + + + +
+ + + + [[ order.notes or '' ]] + + + + Thanks, + + + + [[ user.signature or '' ]] +
+
diff --git a/addons/sale/report/__init__.py b/addons/sale/report/__init__.py index a12e74f71b8..f9469fbec46 100644 --- a/addons/sale/report/__init__.py +++ b/addons/sale/report/__init__.py @@ -30,6 +30,7 @@ import sale_prepare_allot import order +import shipping # vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4: diff --git a/addons/sale/report/order.rml b/addons/sale/report/order.rml index c0cced3ecc7..28422047abc 100644 --- a/addons/sale/report/order.rml +++ b/addons/sale/report/order.rml @@ -1,266 +1,367 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -[[ repeatIn(objects,'o') ]] [[ setLang(o.partner_id.lang) ]] - - - - -Shipping address : -[[ o.partner_id.title or '' ]] [[ o.partner_id.name ]] -[[ o.partner_shipping_id.title or '' ]] [[ o.partner_shipping_id.name ]] -[[ o.partner_shipping_id.street ]] -[[ o.partner_shipping_id.street2 or '' ]] -[[ o.partner_shipping_id.zip or '' ]] [[ o.partner_shipping_id.city or '' ]] [[ o.partner_shipping_id.country_id and (', %s' % (o.partner_shipping_id.country_id and o.partner_shipping_id.country_id.name or '')) ]] - - - - -Invoice address : -[[ o.partner_invoice_id.street ]][[ o.partner_invoice_id.street2 and (', %s' % o.partner_invoice_id.street2 or '') ]] -[[ o.partner_invoice_id.zip or '' ]] [[ o.partner_invoice_id.city or '' ]] [[ o.partner_invoice_id.country_id and (', %s' % (o.partner_invoice_id.country_id and o.partner_invoice_id.country_id.name or '')) ]] - - - - - - - -[[ o.partner_id.title or '' ]] [[ o.partner_id.name ]] -[[ o.partner_order_id.title or '' ]] [[ o.partner_order_id.name ]] -[[ o.partner_order_id.street ]] -[[ o.partner_order_id.street2 or '' ]] -[[ o.partner_order_id.zip or '' ]] [[ o.partner_order_id.city or '' ]] -[[ o.partner_order_id.state_id and o.partner_order_id.state_id.name or '' ]] -[[ o.partner_order_id.country_id and o.partner_order_id.country_id.name or '' ]] - - - -Tel. : [[ o.partner_order_id.phone or removeParentNode('para') ]] -Fax : [[ o.partner_order_id.fax or removeParentNode('para') ]] -VAT : [[ o.partner_id.vat or removeParentNode('para') ]] - - - - - - -[[ o.state<>'draft' and removeParentNode('para') ]] Quotation N° : [[ o.name ]] -[[ o.state=='draft' and removeParentNode('para') ]] Order N° : [[ o.name ]] - - - - - - -Your Reference - - -Date Ordered - - -Our Salesman - - -Payment Terms - - - - -[[ o.client_order_ref ]] - - -[[ o.date_order ]] - - -[[ o.user_id.name ]] - - -[[ o.partner_id.property_payment_term and o.partner_id.property_payment_term.note or False ]] - - - - - - - - - - -Description - - -VAT - - -Quantity - - -Unit Price - - -Disc. (%) - - -Price - - - - - [[ repeatIn(o.order_line,'line') ]] - [[ line.name ]] - [[ repeatIn((line.notes and line.notes.split('\n')) or [], 'l', 'para') ]][[ l ]] - - - [[ ', '.join(map(lambda x: x.name, line.tax_id))]] - - - [[ line.product_uos and line.product_uos_qty or line.product_uom_qty ]] [[ line.product_uos and line.product_uos.name or line.product_uom.name ]] - - - [[ line.price_unit ]] - - - [[ (line.discount and str(line.discount))or '' ]] - - - [[ line.price_subtotal ]] - - - - - - - - - - - - - - - -Net Total : - - -[[ o.amount_untaxed ]] [[ o.pricelist_id.currency_id.name ]] - - - - - - - - - - - -Total VAT: - - -[[ o.amount_tax or '0.00' ]] [[ o.pricelist_id.currency_id.name ]] - - - - - - - - - -Total : - - -[[ o.amount_total ]] [[ o.pricelist_id.currency_id.name ]] - - - - - - - - - -[[ format(o.note or '') ]] - - - - -[[ format((o.partner_id.property_payment_term and o.partner_id.property_payment_term.note) or '') ]] - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + [[ repeatIn(objects,'o') ]][[ setLang(o.partner_id.lang) ]] + + + + Shipping address : + [[ o.partner_id.title or '' ]][[ o.partner_id.name ]] + [[ o.partner_shipping_id.title or '' ]][[ o.partner_shipping_id.name ]] + [[ o.partner_shipping_id.street ]] + [[ o.partner_shipping_id.street2 or '' ]] + [[ o.partner_shipping_id.city or '' ]][[ o.partner_shipping_id.zip or '' ]] + [[ o.partner_shipping_id.state_id and o.partner_shipping_id.state_id.name or '' ]][[ o.partner_shipping_id.country_id and o.partner_shipping_id.country_id.name or '' ]] + + + + Invoice address : + [[ o.partner_invoice_id.street ]][[ o.partner_invoice_id.street2 and (', %s' % o.partner_invoice_id.street2 or '') ]] + [[ o.partner_invoice_id.zip or '' ]][[ o.partner_invoice_id.city or '' ]][[ o.partner_invoice_id.country_id and (', %s' % (o.partner_invoice_id.country_id and o.partner_invoice_id.country_id.name or '')) ]] + + + + + + + + [[ o.partner_id.title or '' ]][[ o.partner_id.name ]] + [[ o.partner_order_id.title or '' ]][[ o.partner_order_id.name ]] + [[ o.partner_order_id.street ]] + [[ o.partner_order_id.street2 or '' ]] + [[ o.partner_order_id.zip or '' ]][[ o.partner_order_id.city or '' ]] + [[ o.partner_order_id.state_id and o.partner_order_id.state_id.name or '' ]][[ o.partner_order_id.country_id and o.partner_order_id.country_id.name or '' ]] + + + + Tel. : [[ o.partner_order_id.phone or removeParentNode('para') ]] + Fax : [[ o.partner_order_id.fax or removeParentNode('para') ]] + VAT :[[ o.partner_id.vat or removeParentNode('para') ]] + + + + + + + [[ o.state<>'draft' and removeParentNode('para') ]] Quotation 1 : [[ o.name ]] + [[ o.state=='draft' and removeParentNode('para') ]] Order 1 : [[ o.name ]] + + + + + + + Your Reference + + + Date Ordered + + + Our Salesman + + + Payment Terms + + + + + + + [[ o.client_order_ref ]] + + + [[ o.date_order ]] + + + [[ o.user_id.name ]] + + + [[ o.client_ref and o.client_ref.property_payment_term and o.client_ref.property_payment_term[0] and o.client_ref.property_payment_term[0].name ]] + + + + + + + + + + Description + + + VAT + + + Quantity + + + Unit Price + + + Disc.(%) + + + Price + + + +
+ [[ repeatIn(o.order_line,'line') ]] + + + + [[ line.name ]] + + + [[ ', '.join(map(lambda x: x.name, line.tax_id)) ]] + + + [[ line.product_uos and line.product_uos_qty or line.product_uom_qty ]] + + + [[ line.product_uos and line.product_uos.name or line.product_uom.name ]] + + + [[ line.price_unit ]] + + + [[ line.discount and str(line.discount) or '' ]] + + + [[ line.price_subtotal ]] + + + + + + + [[ repeatIn((line.notes and line.notes.splitlines()) or [], 'l') ]] + + + [[ l or removeParentNode('table') ]] + + + + + + + + + + + +
+ + + + + + + + + Net Total : + + + [[ o.amount_untaxed ]] + + + [[ o.pricelist_id.currency_id.name ]] + + + + + + + + + + Taxes : + + + [[ o.amount_tax ]] + + + [[ o.pricelist_id.currency_id.name ]] + + + + + + + + + + Total : + + + [[ o.amount_total ]] + + + [[ o.pricelist_id.currency_id.name ]] + + + + + + + + + + [[ format(o.note or '') ]] + + + + + [[ format((o.partner_id.property_payment_term and o.partner_id.property_payment_term.note) or '') ]] + + + + + + +
- diff --git a/addons/sale/report/shipping.rml b/addons/sale/report/shipping.rml index 528ac21a0db..96fda43bd8f 100644 --- a/addons/sale/report/shipping.rml +++ b/addons/sale/report/shipping.rml @@ -2,7 +2,7 @@ @@ -10,179 +10,208 @@ - - - - - - + - + - - - - - + + + + + + + + + + + + + - + - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + - [[ repeatIn(objects, 'o') ]] - Delivery order [[ o.sale_id.name ]] - + [[ repeatIn(objects,'o') ]] + - [[ not(o.sale_id) and 'Error, no sale order attached to this picking !' or '' ]] - + [[ not(o.sale_id) and 'Error, no sale order attached to this picking !' or '' ]] + - Invoiced to - [[ o.sale_id.partner_invoice_id.partner_id.name ]] - [[ o.sale_id.partner_invoice_id.street ]] - [[ o.sale_id.partner_invoice_id.zip ]] [[ o.sale_id.partner_invoice_id.city ]] - [[ o.sale_id.partner_invoice_id.country_id and o.sale_id.partner_invoice_id.country_id.name ]] + Invoiced to + [[ o.sale_id and o.sale_id.partner_invoice_id and o.sale_id.partner_invoice_id.name or '']] + [[ o.sale_id and o.sale_id.partner_invoice_id and o.sale_id.partner_invoice_id.street or '']] + [[ o.sale_id and o.sale_id.partner_invoice_id and o.sale_id.partner_invoice_id.zip or '']] + [[ o.sale_id and o.sale_id.partner_invoice_id and o.sale_id.partner_invoice_id.city or '' ]] + [[ o.sale_id and o.sale_id.partner_invoice_id and o.sale_id.partner_invoice_id.country_id and o.sale_id.partner_invoice_id.country_id.name or '']] - Shipped to - [[ o.sale_id.partner_shipping_id.partner_id.name ]] - [[ o.sale_id.partner_shipping_id.street ]] - [[ o.sale_id.partner_shipping_id.zip ]] [[ o.sale_id.partner_shipping_id.city ]][[ o.sale_id.partner_shipping_id.country_id and o.sale_id.partner_shipping_id.country_id.name ]] + Shipped to + [[ o.sale_id and o.sale_id.partner_shipping_id and o.sale_id.partner_shipping_id.name or '']] + [[ o.sale_id and o.sale_id.partner_shipping_id and o.sale_id.partner_shipping_id.street or '']] + [[ o.sale_id and o.sale_id.partner_shipping_id and o.sale_id.partner_shipping_id.zip or '']] + [[ o.sale_id and o.sale_id.partner_shipping_id and o.sale_id.partner_shipping_id.city or '']] + [[ o.sale_id and o.sale_id.partner_shipping_id and o.sale_id.partner_shipping_id.country_id and o.sale_id.partner_shipping_id.country_id.name or '']] - + - + Delivery order [[ o.sale_id and o.sale_id.name ]] + + + + + + + - Order ref. + Order Ref. - Order date + Order Date - Shipping date + Shipping Date - Carrier - - - - - [[ o.sale_id.name ]] - - - [[ o.sale_id.date_order ]] - - - [[ o.date ]] - - - [[ o.carrier_id and o.carrier_id.name or '' ]] + Carrier - - - - + - Reference + [[ o.sale_id and o.sale_id.name ]] - Designation + [[ o.sale_id and o.sale_id.date_order or '']] - Quantity + [[ o.min_date ]] - S.U. + [[ o.carrier_id and o.carrier_id.name or '' ]] + + + + + + + + + + Reference + + + Designation + + + Quantity + + + S.U.
- [[ repeatIn(o.move_lines, 'line') ]] - + [[ repeatIn(o.move_lines, 'line') ]] + - [[line.product_id.code]] + [[line.product_id.code ]] - [[line.product_id.name]] + [[ line.product_id and line.product_id.name or '']] - [[line.product_qty]] + [[ line.product_qty ]] - [[line.product_uom.name]] - - - - - [[line.product_id.ean13]] - - - Logistical unit : [[line.product_packaging.qty]] - [[line.tracking_id and 'Packaging : %d package of %d P' % (1, line.product_packaging.qty) or '']] - [[line.tracking_id and 'Pallets reference: %s' % line.tracking_id.name or '']] Batch reference : [[ line.prodlot_id and line.prodlot_id.name or '/' ]] - - - [[ line.product_uos_qty ]] - - - [[line.product_uos.name]] + [[ line.product_uom and line.product_uom.name ]] - + + + +
- - -
- diff --git a/addons/stock/report/picking.rml b/addons/stock/report/picking.rml new file mode 100644 index 00000000000..62d6219de7e --- /dev/null +++ b/addons/stock/report/picking.rml @@ -0,0 +1,230 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + [[ repeatIn(objects,'picking') ]] + + + + + + + + + + + + + Shipping Address: + [[ (picking.address_id and picking.address_id.partner_id and picking.address_id.partner_id.title) or '' ]] [[ picking.address_id.partner_id.name ]] + [[ (picking.sale_id.partner_shipping_id and picking.sale_id.partner_shipping_id.title) or '' ]] [[ (picking.sale_id.partner_shipping_id and picking.sale_id.partner_shipping_id.name) or '' ]] + [[ (picking.sale_id.partner_shipping_id and picking.sale_id.partner_shipping_id.street) or '' ]] + [[ (picking.sale_id.partner_shipping_id and picking.sale_id.partner_shipping_id.zip) or '' ]] [[ (picking.sale_id.partner_shipping_id and picking.sale_id.partner_shipping_id.city) or '' ]] [[ (picking.address_id.state_id and picking.address_id.state_id.name) or '' ]] + [[ (picking.address_id.country_id and picking.address_id.country_id.name) or '' ]] + + + + + + + Packing List + + + + + + + + + + Customer Ref. + + + Recipient + + + Concerns + + + Packing Date + + + + + + + [[ (picking.address_id and picking.address_id.partner_id and picking.address_id.partner_id.id) or '' ]] + + + [[ (picking.sale_id and picking.sale_id.partner_shipping_id and picking.sale_id.partner_shipping_id and picking.sale_id.partner_shipping_id.title) or '' ]] [[ (picking.sale_id and picking.sale_id.partner_shipping_id and picking.sale_id.partner_shipping_id.name) or '' ]] + + + [[ picking.name ]] + + + [[ picking.date]] + + + + + + + + + + Product + + + Description + + + Tracking + + + Qty + + + Location + + + +
+ [[ repeatIn(picking.move_lines,'move_lines') ]] + + + + [[ move_lines.product_id.default_code ]] + + + [[ move_lines.product_id.name ]] + + + [[ (move_lines.tracking_id and move_lines.tracking_id.name) or '']] + + + [[ move_lines.product_qty ]] + + + [[ move_lines.product_uom.name ]] + + + [[ (move_lines.location_id and move_lines.location_id.name) or '' ]] + + + + + + +
+
+
diff --git a/addons/stock/report/picking.xml b/addons/stock/report/picking.xml deleted file mode 100644 index 523091a5b7c..00000000000 --- a/addons/stock/report/picking.xml +++ /dev/null @@ -1,45 +0,0 @@ - - - -
-
- - <name type="field" name="name"/> - <street type="field" name="street"/> - <zip type="field" name="zip"/> - <city type="field" name="city"/> - <state type="field" name="state_id.name"/> - <country type="field" name="country_id.name"/> - </address> - - <corporation type="zoom" name="address_id.partner_id"> - <id type="field" name="id"/> - <title type="field" name="title"/> - <name type="field" name="name"/> - </corporation> - - <picking-id type="field" name="id"/> - <picking-name type="field" name="name"/> - <picking-date type="field" name="date"/> - <expedition-date/> - <command-number>98798413</command-number> - </header> - <lines> - <line type="zoom" name="move_lines"> - <ref type="field" name="product_id.code">68854GZGZ</ref> - <tracking></tracking> - <quantity type="field" name="product_qty">0</quantity> - <location type="field" name="location_id.name">0</location> - <prod_uom type="field" name="product_uom.name">0</prod_uom> - <name type="field" name="product_id.name">Un joli t-shirt tout bo</name> - <variant type="field" name="product_id.variants">XL</variant> - <state type="field" name="state">draft</state> - - <lot type="zoom" name="tracking_id"> - <tracking type="field" name="name" /> - <serial type="field" name="serial" /> - </lot> - </line> - </lines> - </picking> -</pickinglist> diff --git a/addons/stock/report/picking.xsl b/addons/stock/report/picking.xsl deleted file mode 100644 index ab572280dba..00000000000 --- a/addons/stock/report/picking.xsl +++ /dev/null @@ -1,184 +0,0 @@ -<?xml version="1.0" encoding="utf-8"?> -<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:fo="http://www.w3.org/1999/XSL/Format"> - - <xsl:import href="../../custom/corporate_defaults.xsl"/> - <xsl:import href="../../base/report/rml_template.xsl"/> - - <xsl:template match="/"> - <xsl:call-template name="rml"/> - </xsl:template> - - <!-- frames (optional template - override corporate defaults) --> - - <xsl:template name="first_page_frames"> -<!-- - <frame id="smalltext" x1="14.5cm" y1="26cm" width="6cm" height="3cm"/> ---> - <frame id="address" x1="11cm" y1="21.5cm" width="6cm" height="4cm"/> - <frame id="main" x1="1cm" y1="3.5cm" width="19.0cm" height="17.5cm"/> - </xsl:template> - - <!-- report specific "graphics" --> - - <xsl:template name="first_page_graphics_report"> - <setFont name="Helvetica" size="16"/> - <drawCentredString x="105mm" y="28cm" t="1">PACKINGLIST</drawCentredString> - </xsl:template> - - <!-- stylesheet --> - - <xsl:template name="stylesheet"> - <blockTableStyle id="infos"> - <blockFont name="Helvetica-Bold" size="10" start="0,0" stop="-1,0"/> - <blockBackground colorName="grey" start="0,0" stop="-1,0"/> - <blockTextColor colorName="white" start="0,0" stop="-1,0"/> - <lineStyle kind="GRID" colorName="black"/> - </blockTableStyle> - <blockTableStyle id="products"> - <blockBackground colorName="lightgrey" start="0,0" stop="-1,0"/> - <blockFont name="Helvetica-Bold" size="10" start="0,0" stop="-1,0"/> - <lineStyle kind="LINEBELOW" colorName="black" start="0,0" stop="-1,0"/> - <blockValign value="TOP"/> - <blockAlignment value="RIGHT" start="3,0" stop="3,-1"/> - <blockAlignment value="RIGHT" start="6,0" stop="6,-1"/> - </blockTableStyle> - <paraStyle name="address-title" fontName="Helvetica-Bold" fontSize="8" alignment="left"/> - <paraStyle name="address" fontName="Helvetica" fontSize="8" alignment="left" leftIndent="1cm"/> - <paraStyle name="prod" fontName="Helvetica" fontSize="10" alignment="left"/> - <paraStyle name="prod-right" fontName="Helvetica" fontSize="10" alignment="right"/> - </xsl:template> - - <xsl:template name="story"> - <xsl:apply-templates select="pickinglist"/> - </xsl:template> - - <xsl:template match="pickinglist"> - <xsl:apply-templates select="picking"/> - </xsl:template> - - <xsl:template match="picking"> - <xsl:apply-templates select="header"/> - <xsl:apply-templates select="lines"/> - </xsl:template> - - <xsl:template match="header"> - <!-- start of smalltext frame --> -<!-- - <para t="1"> - Here is the picking list of this lot. Generated by Tiny ERP. - </para> ---> - <!-- end of smalltext frame --> -<!-- - <nextFrame/> ---> - <!-- start of address frame --> - - <para style="address-title" t="1"> - Shipping Address: - </para> - - <xsl:apply-templates select="corporation" mode="shipping"/> - <xsl:apply-templates select="address" mode="shipping"/> - - <!-- end of address frame --> - - <nextFrame/> - - <!-- start of products frame --> - - <para> - <b t="1">Recipient</b>: <xsl:apply-templates select="address" mode="header"/> - </para> - <para t="1"> - Concerns: <xsl:value-of select="picking-name"/> - </para> - - <spacer length="1cm" width="1mm"/> - - <blockTable colWidths="4cm,4cm,6cm,4cm" style="infos"> - <tr> - <td t="1">Customer ref.</td> - <td t="1">Shipping ref.</td> - <td t="1">Packing Date</td> - <td t="1">Shipping Date</td> - </tr><tr> - <td><para><xsl:value-of select="corporation/id"/></para></td> - <td><para><xsl:value-of select="picking-id"/></para></td> - <td><para><xsl:value-of select="picking-date"/></para></td> - <td><para><xsl:value-of select="expedition-date"/></para></td> - </tr> - </blockTable> - </xsl:template> - - <xsl:template match="corporation" mode="shipping"> - <para style="address"> - <xsl:value-of select="title"/> - <xsl:text> </xsl:text> - <xsl:value-of select="name"/> - </para> - </xsl:template> - - <xsl:template match="address" mode="shipping"> - <para style="address"> - <xsl:value-of select="title"/> - <xsl:text> </xsl:text> - <xsl:value-of select="name"/> - </para> - <para style="address"> - <xsl:value-of select="street"/> - </para> - <para style="address"> - <xsl:value-of select="zip"/> - <xsl:text> </xsl:text> - <xsl:value-of select="city"/> - </para> - <para style="address"> - <xsl:value-of select="country_id"/> - </para> - </xsl:template> - - <xsl:template match="address" mode="header"> - <xsl:value-of select="title"/> - <xsl:text> </xsl:text> - <xsl:value-of select="name"/> - </xsl:template> - - <xsl:template match="lines"> - <spacer length="0.5cm"/> - - <setNextTemplate name="other_pages"/> - <blockTable colWidths="2cm,2.2cm,2.2cm,2.5cm,2cm,4.5cm,2.1cm" style="products" repeatRows="1"> - <tr> - <td t="1">Product</td> - <td t="1">Tracking</td> - <td t="1">Serial</td> - <td t="1">Qty</td> - <td t="1">Location</td> - <td t="1">Description</td> - <td t="1">State</td> - </tr> - <xsl:for-each select="line"> - <tr> - <td><para style="prod"><xsl:value-of select="ref"/></para></td> - <td><para style="prod"><xsl:value-of select="lot/tracking"/></para></td> - <td><para style="prod"><xsl:value-of select="lot/serial"/></para></td> - <td> - <para style="prod-right"> - <xsl:value-of select="quantity"/> - <xsl:text> </xsl:text> - <xsl:value-of select="prod_uom"/> - </para> - </td> - <td><para style="prod"><xsl:value-of select="location"/></para></td> - <td><para style="prod"><xsl:value-of select="name"/><xsl:text> </xsl:text><xsl:value-of select="variant"/></para></td> - <td><para style="prod-right"><xsl:value-of select="state"/></para></td> - </tr> - </xsl:for-each> - </blockTable> - - <setNextTemplate name="first_page"/> - <nextFrame/> - </xsl:template> - -</xsl:stylesheet> diff --git a/addons/stock/stock.py b/addons/stock/stock.py index 78ac0677bc6..82570e94c03 100644 --- a/addons/stock/stock.py +++ b/addons/stock/stock.py @@ -331,6 +331,46 @@ stock_tracking() class stock_picking(osv.osv): _name = "stock.picking" _description = "Packing list" + def _set_minimum_date(self, cr, uid, ids, name, value, arg, context): + if value!=False: + cr.execute("update stock_picking set min_date='%s' where id in (%d)"%(value,ids)) + def get_minimum_date(self, cr, uid, ids, field_name, arg, context={}): + res = {} + for pick in self.browse(cr, uid, ids): + res[pick.id] = None + cr.execute("select min_date from stock_picking where id =%d"%pick.id) + min_date = cr.fetchone()[0] + if not min_date: + move_ids = [x.id for x in pick.move_lines ] + if len(move_ids): + cr.execute("select min(date_planned) from stock_move where id in (" + ','.join(map(str, move_ids)) + ")") + res[pick.id] = cr.fetchone()[0] or None + else: + res[pick.id]=min_date + + return res + + def _set_maximum_date(self, cr, uid, ids, name, value, arg, context): + if value!=False: + cr.execute("update stock_picking set max_date='%s' where id in (%d)"%(value,ids)) + def get_maximum_date(self, cr, uid, ids, field_name, arg, context={}): + res = {} + for pick in self.browse(cr, uid, ids): + res[pick.id] = None + cr.execute("select max_date from stock_picking where id =%d"%pick.id) + max_date = cr.fetchone()[0] + if not max_date: + move_ids = [x.id for x in pick.move_lines ] + if len(move_ids): + cr.execute("select max(date_planned) from stock_move where id in (" + ','.join(map(str, move_ids)) + ")") + res[pick.id] = cr.fetchone()[0] or None + else: + res[pick.id]=max_date + + return res + + + _columns = { 'name': fields.char('Packing name', size=64, required=True, select=True), 'origin': fields.char('Origin', size=64), @@ -350,8 +390,12 @@ class stock_picking(osv.osv): ('done','Done'), ('cancel','Cancel'), ], 'Status', readonly=True, select=True), + 'min_date': fields.function(get_minimum_date, fnct_inv=_set_minimum_date, + method=True,store=True, type='date', string='Min. Date', select=True), 'date':fields.datetime('Date create'), + 'max_date': fields.function(get_maximum_date, fnct_inv=_set_maximum_date, + method=True,store=True, type='date', string='Max. Date', select=True), 'move_lines': fields.one2many('stock.move', 'picking_id', 'Move lines'), 'auto_picking': fields.boolean('Auto-Packing'), diff --git a/addons/stock/stock_report.xml b/addons/stock/stock_report.xml index a00552c6688..0d786c9a4da 100644 --- a/addons/stock/stock_report.xml +++ b/addons/stock/stock_report.xml @@ -5,8 +5,8 @@ <report auto="False" id="report_product_history" model="product.product" name="stock.product.history" string="Future stock forecast"/> - <report id="report_picking_list" model="stock.picking" name="stock.picking.list" string="Packing list" xml="stock/report/picking.xml" xsl="stock/report/picking.xsl"/> - +<!-- <report id="report_picking_list" model="stock.picking" name="stock.picking.list" string="Packing list" xml="stock/report/picking.xml" xsl="stock/report/picking.xsl"/>--> + <report id="report_picking_list" model="stock.picking" name="stock.picking.list" string="Packing list" rml="stock/report/picking.rml"/> <report id="report_move_labels" model="stock.move" name="stock.move.label" string="Print Item Labels" xml="stock/report/lot_move_label.xml" xsl="stock/report/lot_move_label.xsl"/> <report id="report_location_overview" model="stock.location" name="stock.location.overview" string="Location Overview" xml="stock/report/lot_overview.xml" xsl="stock/report/lot_overview.xsl"/> diff --git a/addons/stock/stock_view.xml b/addons/stock/stock_view.xml index 0864f57b4a4..7b2c55ab110 100644 --- a/addons/stock/stock_view.xml +++ b/addons/stock/stock_view.xml @@ -465,6 +465,8 @@ <field name="invoice_state" readonly="1"/> <field name="origin" select="1"/> <field name="state" readonly="1"/> + <field name="min_date" select="1"/> + <field name="max_date" select="1"/> </tree> </field> </record> @@ -483,6 +485,8 @@ <field name="invoice_state" select="2"/> <newline/> <field name="location_id"/> + <field name="min_date" select="1"/> + <field name="max_date" select="1"/> <field name="location_dest_id"/> <field name="address_id" select="2"/> <field colspan="4" name="move_lines" nolabel="1" widget="one2many_list"> @@ -558,6 +562,8 @@ <field name="date" select="1"/> <field name="address_id" select="1"/> <field name="origin" select="1"/> + <field name="min_date" select="1"/> + <field name="max_date" select="1"/> <field name="state" readonly="1"/> </tree> </field> @@ -617,6 +623,8 @@ </page> <page string="Others info"> <field name="origin" select="2"/> + <field name="min_date" select="1"/> + <field name="max_date" select="1"/> <field name="active" select="2"/> <field name="auto_picking"/> <newline/> @@ -713,6 +721,8 @@ <field name="address_id" select="1"/> <field name="invoice_state" readonly="1"/> <field name="origin" select="1"/> + <field name="min_date" select="1"/> + <field name="max_date" select="1"/> <field name="state" readonly="1"/> </tree> </field> @@ -772,6 +782,8 @@ </page> <page string="Others info"> <field name="origin" select="2"/> + <field name="min_date" select="1"/> + <field name="max_date" select="1"/> <field name="active" select="2"/> <field name="auto_picking"/> <newline/> @@ -865,6 +877,8 @@ <field name="address_id" select="1"/> <field name="invoice_state" readonly="1"/> <field name="origin" select="1"/> + <field name="min_date" select="1"/> + <field name="max_date" select="1"/> <field name="state" readonly="1"/> </tree> </field> @@ -881,6 +895,8 @@ <field domain="[('usage','=','internal')]" name="location_dest_id"/> <field name="invoice_state" select="2" string="Supplier Invoice Control"/> <field name="origin" select="2"/> + <field name="min_date" select="1"/> + <field name="max_date" select="1"/> <notebook colspan="4"> <page string="General Information"> <field colspan="4" name="move_lines" nolabel="1" widget="one2many_list">