mirror of
https://github.com/OCA/stock-logistics-reporting.git
synced 2025-02-16 17:13:21 +02:00
bill_of_lading_webkit: initialize module
This commit is contained in:
23
bill_of_lading_webkit/__init__.py
Normal file
23
bill_of_lading_webkit/__init__.py
Normal file
@@ -0,0 +1,23 @@
|
||||
# -*- coding: utf-8 -*-
|
||||
##############################################################################
|
||||
#
|
||||
# Copyright (c) 2011-2013 Camptocamp SA (http://www.camptocamp.com)
|
||||
# @author Nicolas Bessi
|
||||
#
|
||||
# This program is free software: you can redistribute it and/or modify
|
||||
# it under the terms of the GNU General Public License as published by
|
||||
# the Free Software Foundation, either version 3 of the License, or
|
||||
# (at your option) any later version.
|
||||
#
|
||||
# This program is distributed in the hope that it will be useful,
|
||||
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
# GNU General Public License for more details.
|
||||
#
|
||||
# You should have received a copy of the GNU General Public License
|
||||
# along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
#
|
||||
##############################################################################
|
||||
|
||||
from . import stock
|
||||
from . import report
|
||||
58
bill_of_lading_webkit/__openerp__.py
Normal file
58
bill_of_lading_webkit/__openerp__.py
Normal file
@@ -0,0 +1,58 @@
|
||||
# -*- encoding: utf-8 -*-
|
||||
###############################################################################
|
||||
#
|
||||
# OpenERP, Open Source Management Solution
|
||||
# This module copyright (C) 2014 Savoir-faire Linux
|
||||
# (<http://www.savoirfairelinux.com>).
|
||||
#
|
||||
# This program is free software: you can redistribute it and/or modify
|
||||
# it under the terms of the GNU Affero General Public License as
|
||||
# published by the Free Software Foundation, either version 3 of the
|
||||
# License, or (at your option) any later version.
|
||||
#
|
||||
# This program is distributed in the hope that it will be useful,
|
||||
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
# GNU Affero General Public License for more details.
|
||||
#
|
||||
# You should have received a copy of the GNU Affero General Public License
|
||||
# along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
#
|
||||
###############################################################################
|
||||
|
||||
|
||||
{
|
||||
'name': 'Bill of Lading using Webkit Library',
|
||||
'version': '1.0',
|
||||
'category': 'Reports/Webkit',
|
||||
'description': """
|
||||
|
||||
A Bill of Lading is a document issued by a carrier to a shipper of goods.
|
||||
It is a negotiable instrument, and it serves three purposes:
|
||||
- it is a receipt for the goods shipped;
|
||||
- it evidences the contract of carriage;
|
||||
- it serves as a document of title (i.e. ownership).
|
||||
|
||||
This document could be different from a Delivery Order as it has some legal issues.
|
||||
|
||||
Two reports are provided in this module
|
||||
- Bill of Lading for Delivey Orders;
|
||||
- Bill of Lading for Incoming Shipment (the use-case is shipment from an international Warehouse
|
||||
to the local Warehouse).
|
||||
|
||||
This module also add a new field for a warehouse to pick form or deliver to;
|
||||
this field will be used if the default warehouse_id is not set (normally from a PO).
|
||||
|
||||
Contributors
|
||||
------------
|
||||
* Marc Cassuto (marc.cassuto@savoirfairelinux.com)
|
||||
* Mathieu Benoit (mathieu.benoit@savoirfairelinux.com)
|
||||
* Camptocamp with its original module stock_picking_webkit
|
||||
""",
|
||||
'author': 'Savoir-faire Linux',
|
||||
'website': 'http://www.savoirfairelinux.com',
|
||||
'depends': ['base', 'report_webkit', 'base_headers_webkit', 'stock', 'delivery'],
|
||||
'data': ['report.xml', 'stock_view.xml'],
|
||||
'installable': True,
|
||||
'auto_install': False,
|
||||
}
|
||||
103
bill_of_lading_webkit/i18n/bill_of_lading_webkit.pot
Normal file
103
bill_of_lading_webkit/i18n/bill_of_lading_webkit.pot
Normal file
@@ -0,0 +1,103 @@
|
||||
# Translation of OpenERP Server.
|
||||
# This file contains the translation of the following modules:
|
||||
# * bill_of_lading_webkit
|
||||
#
|
||||
msgid ""
|
||||
msgstr ""
|
||||
"Project-Id-Version: OpenERP Server 7.0\n"
|
||||
"Report-Msgid-Bugs-To: \n"
|
||||
"POT-Creation-Date: 2014-05-09 15:06+0000\n"
|
||||
"PO-Revision-Date: 2014-05-09 15:06+0000\n"
|
||||
"Last-Translator: <>\n"
|
||||
"Language-Team: \n"
|
||||
"MIME-Version: 1.0\n"
|
||||
"Content-Type: text/plain; charset=UTF-8\n"
|
||||
"Content-Transfer-Encoding: \n"
|
||||
"Plural-Forms: \n"
|
||||
|
||||
#. module: bill_of_lading_webkit
|
||||
#: report:addons/bill_of_lading_webkit/report/bol_in.mako:58
|
||||
#: report:addons/bill_of_lading_webkit/report/bol_out.mako:56
|
||||
msgid "Origin"
|
||||
msgstr ""
|
||||
|
||||
#. module: bill_of_lading_webkit
|
||||
#: report:addons/bill_of_lading_webkit/report/bol_in.mako:59
|
||||
#: report:addons/bill_of_lading_webkit/report/bol_out.mako:57
|
||||
msgid "Scheduled Date"
|
||||
msgstr ""
|
||||
|
||||
#. module: bill_of_lading_webkit
|
||||
#: report:addons/bill_of_lading_webkit/report/bol_in.mako:76
|
||||
#: report:addons/bill_of_lading_webkit/report/bol_out.mako:74
|
||||
msgid "Description"
|
||||
msgstr ""
|
||||
|
||||
#. module: bill_of_lading_webkit
|
||||
#: report:addons/bill_of_lading_webkit/report/bol_out.mako:20
|
||||
msgid "Ship to:"
|
||||
msgstr ""
|
||||
|
||||
#. module: bill_of_lading_webkit
|
||||
#: report:addons/bill_of_lading_webkit/report/bol_in.mako:61
|
||||
#: report:addons/bill_of_lading_webkit/report/bol_out.mako:59
|
||||
msgid "Delivery Method"
|
||||
msgstr ""
|
||||
|
||||
#. module: bill_of_lading_webkit
|
||||
#: report:addons/bill_of_lading_webkit/report/bol_in.mako:53
|
||||
#: report:addons/bill_of_lading_webkit/report/bol_out.mako:51
|
||||
msgid "Delivery Order"
|
||||
msgstr ""
|
||||
|
||||
#. module: bill_of_lading_webkit
|
||||
#: report:addons/bill_of_lading_webkit/report/bol_in.mako:75
|
||||
#: report:addons/bill_of_lading_webkit/report/bol_out.mako:73
|
||||
msgid "Item"
|
||||
msgstr ""
|
||||
|
||||
#. module: bill_of_lading_webkit
|
||||
#: report:addons/bill_of_lading_webkit/report/bol_in.mako:77
|
||||
#: report:addons/bill_of_lading_webkit/report/bol_out.mako:75
|
||||
msgid "Serial Number"
|
||||
msgstr ""
|
||||
|
||||
#. module: bill_of_lading_webkit
|
||||
#: report:addons/bill_of_lading_webkit/report/bol_in.mako:57
|
||||
#: report:addons/bill_of_lading_webkit/report/bol_out.mako:55
|
||||
msgid "Contact"
|
||||
msgstr ""
|
||||
|
||||
#. module: bill_of_lading_webkit
|
||||
#: report:addons/bill_of_lading_webkit/report/bol_in.mako:78
|
||||
#: report:addons/bill_of_lading_webkit/report/bol_out.mako:76
|
||||
msgid "Weight (kg)"
|
||||
msgstr ""
|
||||
|
||||
#. module: bill_of_lading_webkit
|
||||
#: report:addons/bill_of_lading_webkit/report/bol_in.mako:40
|
||||
msgid "Ship to :"
|
||||
msgstr ""
|
||||
|
||||
#. module: bill_of_lading_webkit
|
||||
#: report:addons/bill_of_lading_webkit/report/bol_in.mako:79
|
||||
#: report:addons/bill_of_lading_webkit/report/bol_out.mako:77
|
||||
msgid "Quantity"
|
||||
msgstr ""
|
||||
|
||||
#. module: bill_of_lading_webkit
|
||||
#: report:addons/bill_of_lading_webkit/report/bol_in.mako:21
|
||||
msgid "From :"
|
||||
msgstr ""
|
||||
|
||||
#. module: bill_of_lading_webkit
|
||||
#: report:addons/bill_of_lading_webkit/report/bol_in.mako:60
|
||||
#: report:addons/bill_of_lading_webkit/report/bol_out.mako:58
|
||||
msgid "Total Weight"
|
||||
msgstr ""
|
||||
|
||||
#. module: bill_of_lading_webkit
|
||||
#: report:addons/bill_of_lading_webkit/report/bol_out.mako:38
|
||||
msgid "Customer name & address:"
|
||||
msgstr ""
|
||||
|
||||
103
bill_of_lading_webkit/i18n/fr.po
Normal file
103
bill_of_lading_webkit/i18n/fr.po
Normal file
@@ -0,0 +1,103 @@
|
||||
# Translation of OpenERP Server.
|
||||
# This file contains the translation of the following modules:
|
||||
# * bill_of_lading_webkit
|
||||
#
|
||||
msgid ""
|
||||
msgstr ""
|
||||
"Project-Id-Version: OpenERP Server 7.0\n"
|
||||
"Report-Msgid-Bugs-To: \n"
|
||||
"POT-Creation-Date: 2014-05-09 15:06+0000\n"
|
||||
"PO-Revision-Date: 2014-05-09 11:14-0500\n"
|
||||
"Last-Translator: Marc Cassuto <marc.cassuto@savoirfairelinux.com>\n"
|
||||
"Language-Team: \n"
|
||||
"MIME-Version: 1.0\n"
|
||||
"Content-Type: text/plain; charset=UTF-8\n"
|
||||
"Content-Transfer-Encoding: 8bit\n"
|
||||
"Plural-Forms: \n"
|
||||
|
||||
#. module: bill_of_lading_webkit
|
||||
#: report:addons/bill_of_lading_webkit/report/bol_in.mako:58
|
||||
#: report:addons/bill_of_lading_webkit/report/bol_out.mako:56
|
||||
msgid "Origin"
|
||||
msgstr "Origine"
|
||||
|
||||
#. module: bill_of_lading_webkit
|
||||
#: report:addons/bill_of_lading_webkit/report/bol_in.mako:59
|
||||
#: report:addons/bill_of_lading_webkit/report/bol_out.mako:57
|
||||
msgid "Scheduled Date"
|
||||
msgstr "Date prévue"
|
||||
|
||||
#. module: bill_of_lading_webkit
|
||||
#: report:addons/bill_of_lading_webkit/report/bol_in.mako:76
|
||||
#: report:addons/bill_of_lading_webkit/report/bol_out.mako:74
|
||||
msgid "Description"
|
||||
msgstr "Description"
|
||||
|
||||
#. module: bill_of_lading_webkit
|
||||
#: report:addons/bill_of_lading_webkit/report/bol_out.mako:20
|
||||
msgid "Ship to:"
|
||||
msgstr "Livré à:"
|
||||
|
||||
#. module: bill_of_lading_webkit
|
||||
#: report:addons/bill_of_lading_webkit/report/bol_in.mako:61
|
||||
#: report:addons/bill_of_lading_webkit/report/bol_out.mako:59
|
||||
msgid "Delivery Method"
|
||||
msgstr "Méthode de livraison"
|
||||
|
||||
#. module: bill_of_lading_webkit
|
||||
#: report:addons/bill_of_lading_webkit/report/bol_in.mako:53
|
||||
#: report:addons/bill_of_lading_webkit/report/bol_out.mako:51
|
||||
msgid "Delivery Order"
|
||||
msgstr "Ordre de livraison"
|
||||
|
||||
#. module: bill_of_lading_webkit
|
||||
#: report:addons/bill_of_lading_webkit/report/bol_in.mako:75
|
||||
#: report:addons/bill_of_lading_webkit/report/bol_out.mako:73
|
||||
msgid "Item"
|
||||
msgstr "Item"
|
||||
|
||||
#. module: bill_of_lading_webkit
|
||||
#: report:addons/bill_of_lading_webkit/report/bol_in.mako:77
|
||||
#: report:addons/bill_of_lading_webkit/report/bol_out.mako:75
|
||||
msgid "Serial Number"
|
||||
msgstr "N° lot / N° série"
|
||||
|
||||
#. module: bill_of_lading_webkit
|
||||
#: report:addons/bill_of_lading_webkit/report/bol_in.mako:57
|
||||
#: report:addons/bill_of_lading_webkit/report/bol_out.mako:55
|
||||
msgid "Contact"
|
||||
msgstr "Contact"
|
||||
|
||||
#. module: bill_of_lading_webkit
|
||||
#: report:addons/bill_of_lading_webkit/report/bol_in.mako:78
|
||||
#: report:addons/bill_of_lading_webkit/report/bol_out.mako:76
|
||||
msgid "Weight (kg)"
|
||||
msgstr "Poids (kg)"
|
||||
|
||||
#. module: bill_of_lading_webkit
|
||||
#: report:addons/bill_of_lading_webkit/report/bol_in.mako:40
|
||||
msgid "Ship to :"
|
||||
msgstr "Livré à:"
|
||||
|
||||
#. module: bill_of_lading_webkit
|
||||
#: report:addons/bill_of_lading_webkit/report/bol_in.mako:79
|
||||
#: report:addons/bill_of_lading_webkit/report/bol_out.mako:77
|
||||
msgid "Quantity"
|
||||
msgstr "Quantité"
|
||||
|
||||
#. module: bill_of_lading_webkit
|
||||
#: report:addons/bill_of_lading_webkit/report/bol_in.mako:21
|
||||
msgid "From :"
|
||||
msgstr "De :"
|
||||
|
||||
#. module: bill_of_lading_webkit
|
||||
#: report:addons/bill_of_lading_webkit/report/bol_in.mako:60
|
||||
#: report:addons/bill_of_lading_webkit/report/bol_out.mako:58
|
||||
msgid "Total Weight"
|
||||
msgstr "Poid total"
|
||||
|
||||
#. module: bill_of_lading_webkit
|
||||
#: report:addons/bill_of_lading_webkit/report/bol_out.mako:38
|
||||
msgid "Customer name & address:"
|
||||
msgstr "Nom et adresse du client:"
|
||||
|
||||
26
bill_of_lading_webkit/report.xml
Normal file
26
bill_of_lading_webkit/report.xml
Normal file
@@ -0,0 +1,26 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<openerp>
|
||||
<data>
|
||||
|
||||
|
||||
<report id="stock.bill_of_lading_out"
|
||||
name="webkit.bill_of_lading_out"
|
||||
auto="False"
|
||||
model="stock.picking.out"
|
||||
file="bill_of_lading_webkit/report/bol_out.mako"
|
||||
string="Bill of Lading"
|
||||
report_type="webkit"
|
||||
header="True"
|
||||
webkit_header="base_headers_webkit.base_reports_portrait_header"/>
|
||||
<report id="stock.bill_of_lading_in"
|
||||
name="webkit.bill_of_lading_in"
|
||||
auto="False"
|
||||
model="stock.picking.in"
|
||||
file="bill_of_lading_webkit/report/bol_in.mako"
|
||||
string="Bill of Lading (Return of Products)"
|
||||
report_type="webkit"
|
||||
header="True"
|
||||
webkit_header="base_headers_webkit.base_reports_portrait_header"/>
|
||||
|
||||
</data>
|
||||
</openerp>
|
||||
21
bill_of_lading_webkit/report/__init__.py
Normal file
21
bill_of_lading_webkit/report/__init__.py
Normal file
@@ -0,0 +1,21 @@
|
||||
# -*- coding: utf-8 -*-
|
||||
##############################################################################
|
||||
#
|
||||
# Copyright (c) 2011-2013 Camptocamp SA (http://www.camptocamp.com)
|
||||
# @author Nicolas Bessi
|
||||
#
|
||||
# This program is free software: you can redistribute it and/or modify
|
||||
# it under the terms of the GNU General Public License as published by
|
||||
# the Free Software Foundation, either version 3 of the License, or
|
||||
# (at your option) any later version.
|
||||
#
|
||||
# This program is distributed in the hope that it will be useful,
|
||||
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
# GNU General Public License for more details.
|
||||
#
|
||||
# You should have received a copy of the GNU General Public License
|
||||
# along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
#
|
||||
##############################################################################
|
||||
from . import stock_report
|
||||
106
bill_of_lading_webkit/report/bol_in.mako
Normal file
106
bill_of_lading_webkit/report/bol_in.mako
Normal file
@@ -0,0 +1,106 @@
|
||||
## -*- coding: utf-8 -*-
|
||||
<html>
|
||||
<head>
|
||||
<style type="text/css">
|
||||
${css}
|
||||
</style>
|
||||
</head>
|
||||
|
||||
<body>
|
||||
<%page expression_filter="entity"/>
|
||||
<%
|
||||
def carriage_returns(text):
|
||||
return text.replace('\n', '<br />')
|
||||
%>
|
||||
%for picking in objects:
|
||||
<% setLang(picking.partner_id.lang) %>
|
||||
<div class="address">
|
||||
<%
|
||||
warehouse_addr = warehouse_address(picking)
|
||||
%>
|
||||
<table class="recipient">
|
||||
<tr><td class="address_title">${_("Ship to :")}</td></tr>
|
||||
<tr><td class="name">${warehouse_addr.title and warehouse_addr.title.name or ''} ${warehouse_addr.name }</td></tr>
|
||||
%if warehouse_addr.contact_address:
|
||||
<% address_lines = warehouse_addr.contact_address.split("\n") %>
|
||||
%for part in address_lines:
|
||||
%if part:
|
||||
<tr><td>${part}</td></tr>
|
||||
%endif
|
||||
%endfor
|
||||
%endif
|
||||
</table>
|
||||
<table class="invoice">
|
||||
%if picking.partner_id:
|
||||
<tr><td class="address_title">${_("From :")}</td></tr>
|
||||
%if picking.partner_id.parent_id:
|
||||
<tr><td>${picking.partner_id.parent_id.name or ''}</td></tr>
|
||||
<tr><td>${picking.partner_id.title and picking.partner_id.title.name or ''} ${picking.partner_id.name }</td></tr>
|
||||
<% address_lines = picking.partner_id.contact_address.split("\n")[1:] %>
|
||||
%else:
|
||||
<tr><td class="name">${picking.partner_id.title and picking.partner_id.title.name or ''} ${picking.partner_id.name }</td></tr>
|
||||
<% address_lines = picking.partner_id.contact_address.split("\n") %>
|
||||
%endif
|
||||
%for part in address_lines:
|
||||
%if part:
|
||||
<tr><td>${part}</td></tr>
|
||||
%endif
|
||||
%endfor
|
||||
%endif
|
||||
</table>
|
||||
</div>
|
||||
|
||||
<h1 style="clear:both;">${_(u'Delivery Order') } ${picking.name}</h1>
|
||||
|
||||
<table class="basic_table" width="100%">
|
||||
<tr>
|
||||
<td style="font-weight:bold;">${_("Contact")}</td>
|
||||
<td style="font-weight:bold;">${_("Origin")}</td>
|
||||
<td style="font-weight:bold;">${_("Scheduled Date")}</td>
|
||||
<td style="font-weight:bold;">${_('Total Weight')}</td>
|
||||
<td style="font-weight:bold;">${_('Delivery Method')}</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>${user.name}</td>
|
||||
<td>${picking.origin or ''}</td>
|
||||
<td>${formatLang(picking.min_date, date=True)}</td>
|
||||
<td>${picking.weight}</td>
|
||||
<td>${picking.carrier_id and picking.carrier_id.name or ''}</td>
|
||||
</tr>
|
||||
</table>
|
||||
|
||||
<table class="list_sale_table" width="100%" style="margin-top: 20px;">
|
||||
<thead>
|
||||
<tr>
|
||||
<th style="text-align:left; ">${_("Item")}</th>
|
||||
<th style="text-align:left; ">${_("Description")}</th>
|
||||
<th style="text-align:left; ">${_("Serial Number")}</th>
|
||||
<th style="text-align:right; ">${_("Weight (kg)")}</th>
|
||||
<th class="amount">${_("Quantity")}</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
%for line in picking.move_lines:
|
||||
<%
|
||||
weight = line.product_id.weight * line.product_qty
|
||||
%>
|
||||
<tr class="line">
|
||||
<td style="text-align:left; " >${ line.product_id.name }</td>
|
||||
<td style="text-align:left; " >${ line.product_id.description or '' }</td>
|
||||
<td style="text-align:left; " >${ line.prodlot_id and line.prodlot_id.name or ''}</td>
|
||||
<td style="text-align:right; " >${ formatLang(weight) }</td>
|
||||
<td class="amount" >${ formatLang(line.product_qty) } ${line.product_uom.name}</td>
|
||||
</tr>
|
||||
%endfor
|
||||
</table>
|
||||
|
||||
<br/>
|
||||
%if picking.note :
|
||||
<p class="std_text">${picking.note | carriage_returns}</p>
|
||||
%endif
|
||||
|
||||
<p style="page-break-after: always"/>
|
||||
<br/>
|
||||
%endfor
|
||||
</body>
|
||||
</html>
|
||||
133
bill_of_lading_webkit/report/bol_out.mako
Normal file
133
bill_of_lading_webkit/report/bol_out.mako
Normal file
@@ -0,0 +1,133 @@
|
||||
## -*- coding: utf-8 -*-
|
||||
<html>
|
||||
<head>
|
||||
<style type="text/css">
|
||||
${css}
|
||||
</style>
|
||||
</head>
|
||||
|
||||
<body>
|
||||
<%page expression_filter="entity"/>
|
||||
<%
|
||||
def carriage_returns(text):
|
||||
return text.replace('\n', '<br />')
|
||||
%>
|
||||
%for picking in objects:
|
||||
<% setLang(picking.partner_id.lang) %>
|
||||
<div class="address">
|
||||
<%
|
||||
invoice_addr = invoice_address(picking)
|
||||
%>
|
||||
<table class="recipient">
|
||||
<tr><td class="address_title">${_("Contact info:")}</td></tr>
|
||||
%if invoice_addr.phone:
|
||||
<tr><td><b>${_("Phone:")}</b> ${invoice_addr.phone }</td></tr>
|
||||
%endif
|
||||
%if invoice_addr.mobile:
|
||||
<tr><td><b>${_("Cell:")}</b> ${invoice_addr.mobile }</td></tr>
|
||||
%endif
|
||||
%if invoice_addr.email:
|
||||
<tr><td><b>${_("Email:")}</b> ${invoice_addr.email }</td></tr>
|
||||
%endif
|
||||
</table>
|
||||
<table class="invoice">
|
||||
<tr><td class="address_title">${_("Customer name & address:")}</td></tr>
|
||||
<tr><td>${invoice_addr.title and invoice_addr.title.name or ''} ${invoice_addr.name }</td></tr>
|
||||
%if invoice_addr.contact_address:
|
||||
<% address_lines = invoice_addr.contact_address.split("\n") %>
|
||||
%for part in address_lines:
|
||||
%if part:
|
||||
<tr><td>${part}</td></tr>
|
||||
%endif
|
||||
%endfor
|
||||
%endif
|
||||
</table>
|
||||
</div>
|
||||
<div class="address">
|
||||
<%
|
||||
picking_addr = picking_address(picking)
|
||||
%>
|
||||
<table class="recipient">
|
||||
<tr><td class="address_title">${_("Ship to:")}</td></tr>
|
||||
%if picking.partner_id.parent_id:
|
||||
<tr><td>${picking.partner_id.parent_id.name or ''}</td></tr>
|
||||
<tr><td>${picking.partner_id.title and picking.partner_id.title.name or ''} ${picking.partner_id.name }</td></tr>
|
||||
<% address_lines = picking.partner_id.contact_address.split("\n")[1:] %>
|
||||
%else:
|
||||
<tr><td >${picking.partner_id.title and picking.partner_id.title.name or ''} ${picking.partner_id.name }</td></tr>
|
||||
<% address_lines = picking.partner_id.contact_address.split("\n") %>
|
||||
%endif
|
||||
%for part in address_lines:
|
||||
%if part:
|
||||
<tr><td>${part}</td></tr>
|
||||
%endif
|
||||
%endfor
|
||||
</table>
|
||||
<table class="invoice">
|
||||
<tr><td class="address_title">${_("Pick from:")}</td></tr>
|
||||
<tr><td>${picking_addr.title and picking_addr.title.name or ''} ${picking_addr.name }</td></tr>
|
||||
%if picking_addr.contact_address:
|
||||
<% address_lines = picking_addr.contact_address.split("\n") %>
|
||||
%for part in address_lines:
|
||||
%if part:
|
||||
<tr><td>${part}</td></tr>
|
||||
%endif
|
||||
%endfor
|
||||
%endif
|
||||
</table>
|
||||
</div>
|
||||
|
||||
<h1 style="clear:both;">${_(u'Delivery Order') } ${picking.name}</h1>
|
||||
|
||||
<table class="basic_table" width="100%">
|
||||
<tr>
|
||||
<td style="font-weight:bold;">${_("Customer Ref")}</td>
|
||||
<td style="font-weight:bold;">${_("Origin")}</td>
|
||||
<td style="font-weight:bold;">${_("Scheduled Date")}</td>
|
||||
<td style="font-weight:bold;">${_('Total Weight')}</td>
|
||||
<td style="font-weight:bold;">${_('Delivery Method')}</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>${picking.sale_id.client_order_ref if picking.sale_id else ''}</td>
|
||||
<td>${picking.origin or ''}</td>
|
||||
<td>${formatLang(picking.min_date, date=True)}</td>
|
||||
<td>${picking.weight}</td>
|
||||
<td>${picking.carrier_id and picking.carrier_id.name or ''}</td>
|
||||
</tr>
|
||||
</table>
|
||||
|
||||
<table class="list_sale_table" width="100%" style="margin-top: 20px;">
|
||||
<thead>
|
||||
<tr>
|
||||
<th style="text-align:left; ">${_("Item")}</th>
|
||||
<th style="text-align:left; ">${_("Description")}</th>
|
||||
<th style="text-align:left; ">${_("Serial Number")}</th>
|
||||
<th style="text-align:right; ">${_("Weight (kg)")}</th>
|
||||
<th class="amount">${_("Quantity")}</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
%for line in picking.move_lines:
|
||||
<%
|
||||
weight = line.product_id.weight * line.product_qty
|
||||
%>
|
||||
<tr class="line">
|
||||
<td style="text-align:left; " >${ line.product_id.name }</td>
|
||||
<td style="text-align:left; " >${ line.product_id.description or ''}</td>
|
||||
<td style="text-align:left; " >${ line.prodlot_id and line.prodlot_id.name or ''}</td>
|
||||
<td style="text-align:right; " >${ formatLang(weight) }</td>
|
||||
<td class="amount" >${ formatLang(line.product_qty) } ${line.product_uom.name}</td>
|
||||
</tr>
|
||||
%endfor
|
||||
</table>
|
||||
|
||||
<br/>
|
||||
%if picking.note :
|
||||
<p class="std_text">${picking.note | carriage_returns}</p>
|
||||
%endif
|
||||
|
||||
<p style="page-break-after: always"/>
|
||||
<br/>
|
||||
%endfor
|
||||
</body>
|
||||
</html>
|
||||
93
bill_of_lading_webkit/report/stock_report.py
Normal file
93
bill_of_lading_webkit/report/stock_report.py
Normal file
@@ -0,0 +1,93 @@
|
||||
# -*- coding: utf-8 -*-
|
||||
##############################################################################
|
||||
#
|
||||
# Copyright (c) 2011-2013 Camptocamp SA (http://www.camptocamp.com)
|
||||
# @author Nicolas Bessi
|
||||
# Copyright (c) 2013 Agile Business Group (http://www.agilebg.com)
|
||||
# @author Lorenzo Battistini
|
||||
#
|
||||
# This program is free software: you can redistribute it and/or modify
|
||||
# it under the terms of the GNU General Public License as published by
|
||||
# the Free Software Foundation, either version 3 of the License, or
|
||||
# (at your option) any later version.
|
||||
#
|
||||
# This program is distributed in the hope that it will be useful,
|
||||
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
# GNU General Public License for more details.
|
||||
#
|
||||
# You should have received a copy of the GNU General Public License
|
||||
# along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
#
|
||||
##############################################################################
|
||||
|
||||
from report import report_sxw
|
||||
import pooler
|
||||
import time
|
||||
|
||||
|
||||
class BillOfLadingOut(report_sxw.rml_parse):
|
||||
def _get_invoice_address(self, picking):
|
||||
if picking.sale_id:
|
||||
return picking.sale_id.partner_invoice_id
|
||||
partner_obj = self.pool.get('res.partner')
|
||||
invoice_address_id = picking.partner_id.address_get(
|
||||
adr_pref=['invoice']
|
||||
)['invoice']
|
||||
return partner_obj.browse(
|
||||
self.cr, self.uid, invoice_address_id)
|
||||
|
||||
def _get_picking_address(self, picking):
|
||||
# By default, print the warehouse selected manually
|
||||
if picking.manual_warehouse_id:
|
||||
return picking.manual_warehouse_id.partner_id
|
||||
# if not set, print the shipping address of the default company's warehouse
|
||||
partner_obj = self.pool.get('res.partner')
|
||||
warehouse_address_id = picking.company_id.partner_id.address_get(
|
||||
adr_pref=['shipping']
|
||||
)['shipping']
|
||||
return partner_obj.browse(
|
||||
self.cr, self.uid, warehouse_address_id)
|
||||
|
||||
def __init__(self, cr, uid, name, context):
|
||||
super(BillOfLadingOut, self).__init__(cr, uid, name, context=context)
|
||||
self.localcontext.update({
|
||||
'time': time,
|
||||
'invoice_address': self._get_invoice_address,
|
||||
'picking_address': self._get_picking_address,
|
||||
})
|
||||
|
||||
report_sxw.report_sxw('report.webkit.bill_of_lading_out',
|
||||
'stock.picking',
|
||||
'addons/bill_of_lading_webkit/report/bol_out.mako',
|
||||
parser=BillOfLadingOut)
|
||||
|
||||
|
||||
class BillOfLadingIn(report_sxw.rml_parse):
|
||||
def _get_warehouse_address(self, picking):
|
||||
# By default, print the warehouse selected from the related purchase order
|
||||
if picking.purchase_id:
|
||||
return picking.purchase_id.warehouse_id.partner_id
|
||||
# else, print the warehouse selected manually
|
||||
if picking.manual_warehouse_id:
|
||||
return picking.manual_warehouse_id.partner_id
|
||||
# if none of the above, print the shipping address of the default company's warehouse
|
||||
partner_obj = self.pool.get('res.partner')
|
||||
warehouse_address_id = picking.company_id.partner_id.address_get(
|
||||
adr_pref=['shipping']
|
||||
)['shipping']
|
||||
return partner_obj.browse(
|
||||
self.cr, self.uid, warehouse_address_id)
|
||||
|
||||
def __init__(self, cr, uid, name, context):
|
||||
super(BillOfLadingIn, self).__init__(cr, uid, name, context=context)
|
||||
self.localcontext.update({
|
||||
'time': time,
|
||||
'warehouse_address': self._get_warehouse_address,
|
||||
})
|
||||
|
||||
|
||||
report_sxw.report_sxw('report.webkit.bill_of_lading_in',
|
||||
'stock.picking',
|
||||
'addons/bill_of_lading_webkit/report/bol_in.mako',
|
||||
parser=BillOfLadingIn)
|
||||
BIN
bill_of_lading_webkit/static/src/img/icon.png
Normal file
BIN
bill_of_lading_webkit/static/src/img/icon.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 8.1 KiB |
70
bill_of_lading_webkit/stock.py
Normal file
70
bill_of_lading_webkit/stock.py
Normal file
@@ -0,0 +1,70 @@
|
||||
# -*- encoding: utf-8 -*-
|
||||
##############################################################################
|
||||
#
|
||||
# OpenERP, Open Source Management Solution
|
||||
# This module copyright (C) 2014 Savoir-faire Linux
|
||||
# (<http://www.savoirfairelinux.com>).
|
||||
#
|
||||
# This program is free software: you can redistribute it and/or modify
|
||||
# it under the terms of the GNU Affero General Public License as
|
||||
# published by the Free Software Foundation, either version 3 of the
|
||||
# License, or (at your option) any later version.
|
||||
#
|
||||
# This program is distributed in the hope that it will be useful,
|
||||
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
# GNU Affero General Public License for more details.
|
||||
#
|
||||
# You should have received a copy of the GNU Affero General Public License
|
||||
# along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
#
|
||||
##############################################################################
|
||||
from openerp.osv import fields, orm
|
||||
|
||||
|
||||
class stock_picking_out_warehouse(orm.Model):
|
||||
_inherit = "stock.picking.out"
|
||||
_columns = {
|
||||
'manual_warehouse_id': fields.many2one(
|
||||
'stock.warehouse',
|
||||
'Picking from',
|
||||
readonly=True,
|
||||
states={
|
||||
'draft': [('readonly', False)],
|
||||
'confirmed': [('readonly', False)],
|
||||
'assigned': [('readonly', False)],
|
||||
}
|
||||
),
|
||||
}
|
||||
|
||||
|
||||
class stock_picking_in_warehouse(orm.Model):
|
||||
_inherit = "stock.picking.in"
|
||||
_columns = {
|
||||
'manual_warehouse_id': fields.many2one(
|
||||
'stock.warehouse',
|
||||
'Deliver to',
|
||||
readonly=True,
|
||||
states={
|
||||
'draft': [('readonly', False)],
|
||||
'confirmed': [('readonly', False)],
|
||||
'assigned': [('readonly', False)],
|
||||
}
|
||||
),
|
||||
}
|
||||
|
||||
|
||||
class stock_picking_warehouse(orm.Model):
|
||||
_inherit = "stock.picking"
|
||||
_columns = {
|
||||
'manual_warehouse_id': fields.many2one(
|
||||
'stock.warehouse',
|
||||
'Warehouse',
|
||||
readonly=True,
|
||||
states={
|
||||
'draft': [('readonly', False)],
|
||||
'confirmed': [('readonly', False)],
|
||||
'assigned': [('readonly', False)],
|
||||
}
|
||||
),
|
||||
}
|
||||
36
bill_of_lading_webkit/stock_view.xml
Normal file
36
bill_of_lading_webkit/stock_view.xml
Normal file
@@ -0,0 +1,36 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<openerp>
|
||||
<data>
|
||||
|
||||
<record id="view_picking_warehouse_form" model="ir.ui.view">
|
||||
<field name="model">stock.picking</field>
|
||||
<field name="inherit_id" ref="stock.view_picking_form"/>
|
||||
<field name="arch" type="xml">
|
||||
<xpath expr="//sheet/group/group[1]/field[last()]" position="after">
|
||||
<field name="manual_warehouse_id" widget="selection" />
|
||||
</xpath>
|
||||
</field>
|
||||
</record>
|
||||
|
||||
<record id="view_picking_warehouse_out_form" model="ir.ui.view">
|
||||
<field name="model">stock.picking.out</field>
|
||||
<field name="inherit_id" ref="stock.view_picking_form"/>
|
||||
<field name="arch" type="xml">
|
||||
<xpath expr="//sheet/group/group[1]/field[last()]" position="after">
|
||||
<field name="manual_warehouse_id" widget="selection" />
|
||||
</xpath>
|
||||
</field>
|
||||
</record>
|
||||
|
||||
<record id="view_picking_warehouse_in_form" model="ir.ui.view">
|
||||
<field name="model">stock.picking.in</field>
|
||||
<field name="inherit_id" ref="stock.view_picking_form"/>
|
||||
<field name="arch" type="xml">
|
||||
<xpath expr="//sheet/group/group[1]/field[last()]" position="after">
|
||||
<field name="manual_warehouse_id" widget="selection" />
|
||||
</xpath>
|
||||
</field>
|
||||
</record>
|
||||
|
||||
</data>
|
||||
</openerp>
|
||||
Reference in New Issue
Block a user