Merge lp:~savoirfairelinux-openerp/purchase-wkfl/pallet-delivery into lp:~purchase-core-editors/purchase-wkfl/7.0
- pallet-delivery
- Merge into 7.0
Status: | Needs review |
---|---|
Proposed branch: | lp:~savoirfairelinux-openerp/purchase-wkfl/pallet-delivery |
Merge into: | lp:~purchase-core-editors/purchase-wkfl/7.0 |
Diff against target: |
9311 lines (+8583/-0) 133 files modified
delivery_editable_dates/__openerp__.py (+39/-0) delivery_editable_dates/editable_delivery_dates_view.xml (+37/-0) delivery_editable_dates/i18n/delivery_editable_dates.pot (+16/-0) landed_cost_per_pallet/__init__.py (+22/-0) landed_cost_per_pallet/__openerp__.py (+52/-0) landed_cost_per_pallet/i18n/fr.po (+46/-0) landed_cost_per_pallet/i18n/landed_cost_per_pallet.pot (+47/-0) landed_cost_per_pallet/landed_cost_per_pallet_view.xml (+27/-0) landed_cost_per_pallet/purchase.py (+125/-0) pallet_delivery/__init__.py (+22/-0) pallet_delivery/__openerp__.py (+58/-0) pallet_delivery/i18n/fr.po (+186/-0) pallet_delivery/i18n/pallet_delivery.pot (+225/-0) pallet_delivery/pallet_delivery_data.xml (+35/-0) pallet_delivery/pallet_delivery_view.xml (+160/-0) pallet_delivery/security/ir.model.access.csv (+5/-0) pallet_delivery/stock.py (+310/-0) pallet_delivery/stock_workflow.xml (+30/-0) partner_discount/__init__.py (+25/-0) partner_discount/__openerp__.py (+41/-0) partner_discount/i18n/fr.po (+36/-0) partner_discount/i18n/partner_discount.pot (+36/-0) partner_discount/res_partner.py (+36/-0) partner_discount/res_partner_view.xml (+19/-0) produce_details/__init__.py (+22/-0) produce_details/__openerp__.py (+49/-0) produce_details/i18n/fr.po (+41/-0) produce_details/i18n/produce_details.pot (+42/-0) produce_details/produce_details_view.xml (+34/-0) produce_details/product.py (+36/-0) product_reserve_forecast/__init__.py (+23/-0) product_reserve_forecast/__openerp__.py (+44/-0) product_reserve_forecast/i18n/fr.po (+67/-0) product_reserve_forecast/i18n/product_reserve_forecast.pot (+66/-0) product_reserve_forecast/product.py (+70/-0) product_reserve_forecast/product_reserve_forecast_view.xml (+28/-0) product_reserve_forecast/sale_stock.py (+94/-0) product_reserve_forecast/security/ir.model.access.csv (+1/-0) product_reserve_forecast/security/product_reserve_forecast_security.xml (+11/-0) purchase_gains/__init__.py (+23/-0) purchase_gains/__openerp__.py (+45/-0) purchase_gains/purchase.py (+106/-0) purchase_gains/purchase_report.xml (+9/-0) purchase_gains/purchase_view.xml (+14/-0) purchase_gains/report/__init__.py (+24/-0) purchase_gains/report/order.py (+35/-0) purchase_gains/report/order.rml (+172/-0) purchase_lot_tracking/__init__.py (+28/-0) purchase_lot_tracking/__openerp__.py (+52/-0) purchase_lot_tracking/account.py (+88/-0) purchase_lot_tracking/account_view.xml (+28/-0) purchase_lot_tracking/i18n/fr.po (+109/-0) purchase_lot_tracking/i18n/purchase_lot_tracking.pot (+110/-0) purchase_lot_tracking/product.py (+44/-0) purchase_lot_tracking/purchase.py (+265/-0) purchase_lot_tracking/purchase_lot_tracking.py (+72/-0) purchase_lot_tracking/purchase_lot_tracking_view.xml (+69/-0) purchase_lot_tracking/purchase_workflow.xml (+12/-0) purchase_lot_tracking/sale.py (+95/-0) purchase_lot_tracking/stock.py (+141/-0) purchase_lot_tracking/wizard/__init__.py (+1/-0) purchase_lot_tracking/wizard/stock_partial_picking.py (+53/-0) purchase_order_pick_up_date/__init__.py (+22/-0) purchase_order_pick_up_date/__openerp__.py (+44/-0) purchase_order_pick_up_date/i18n/fr.po (+31/-0) purchase_order_pick_up_date/i18n/purchase_order_pick_up_date.pot (+32/-0) purchase_order_pick_up_date/purchase.py (+33/-0) purchase_order_pick_up_date/purchase_order_pick_up_date_report.xml (+21/-0) purchase_order_pick_up_date/purchase_order_pick_up_date_view.xml (+26/-0) purchase_order_pick_up_date/report/order.rml (+335/-0) purchase_order_pick_up_date/report/request_quotation.rml (+156/-0) sale_improved_slip/__init__.py (+23/-0) sale_improved_slip/__openerp__.py (+47/-0) sale_improved_slip/i18n/fr.po (+266/-0) sale_improved_slip/i18n/sale_improved_slip.pot (+192/-0) sale_improved_slip/report/__init__.py (+1/-0) sale_improved_slip/report/picking.py (+72/-0) sale_improved_slip/report/picking.rml (+427/-0) sale_improved_slip/sale.py (+30/-0) sale_improved_slip/sale_improved_slip_report.xml (+11/-0) sale_improved_slip/sale_improved_slip_view.xml (+15/-0) sale_landed_cost_per_pallet/__init__.py (+23/-0) sale_landed_cost_per_pallet/__openerp__.py (+50/-0) sale_landed_cost_per_pallet/sale.py (+96/-0) sale_landed_cost_per_pallet/sale_cost_per_pallet_view.xml (+27/-0) sale_lot_available/__init__.py (+22/-0) sale_lot_available/__openerp__.py (+43/-0) sale_lot_available/wizard/__init__.py (+1/-0) sale_lot_available/wizard/stock_move.py (+80/-0) sale_lot_available/wizard/stock_move_view.xml (+15/-0) sale_warn_under/__init__.py (+23/-0) sale_warn_under/__openerp__.py (+44/-0) sale_warn_under/i18n/fr.po (+86/-0) sale_warn_under/i18n/sale_warn_under.pot (+87/-0) sale_warn_under/sale.py (+92/-0) sale_warn_under/sale_warn_under_view.xml (+15/-0) sale_warn_under/security/ir.model.access.csv (+2/-0) sale_warn_under/static/src/css/wizard.css (+11/-0) sale_warn_under/wizard/__init__.py (+1/-0) sale_warn_under/wizard/sale_wizard.py (+41/-0) sale_warn_under/wizard/sale_wizard.xml (+44/-0) stock_delivery_split/__init__.py (+25/-0) stock_delivery_split/__openerp__.py (+42/-0) stock_delivery_split/wizard/__init__.py (+25/-0) stock_delivery_split/wizard/stock_move.py (+75/-0) stock_delivery_split/wizard/stock_move.xml (+42/-0) stock_forecast/__init__.py (+21/-0) stock_forecast/__openerp__.py (+39/-0) stock_forecast/report/__init__.py (+21/-0) stock_forecast/report/stock.rml (+244/-0) stock_forecast/report/stock_forecast.py (+656/-0) stock_forecast/report/stock_forecast_view.xml (+69/-0) stock_forecast/security/ir.model.access.csv (+2/-0) stock_move_autolot/__init__.py (+26/-0) stock_move_autolot/__openerp__.py (+41/-0) stock_move_autolot/account.py (+71/-0) stock_move_autolot/stock.py (+86/-0) stock_picking_create_lot_button/__init__.py (+22/-0) stock_picking_create_lot_button/__openerp__.py (+53/-0) stock_picking_create_lot_button/stock.py (+70/-0) stock_picking_create_lot_button/stock_view.xml (+22/-0) supplier_register_identification_number/__init__.py (+22/-0) supplier_register_identification_number/__openerp__.py (+48/-0) supplier_register_identification_number/i18n/fr.po (+36/-0) supplier_register_identification_number/i18n/supplier_register_identification_number.pot (+37/-0) supplier_register_identification_number/res_partner.py (+33/-0) supplier_register_identification_number/supplier_register_identification_number_view.xml (+15/-0) whole_quantity/__init__.py (+22/-0) whole_quantity/__openerp__.py (+40/-0) whole_quantity/whole_quantity_data.xml (+8/-0) writeoff_lot_tracking/__init__.py (+1/-0) writeoff_lot_tracking/__openerp__.py (+47/-0) writeoff_lot_tracking/account.py (+177/-0) |
To merge this branch: | bzr merge lp:~savoirfairelinux-openerp/purchase-wkfl/pallet-delivery |
Related bugs: |
Reviewer | Review Type | Date Requested | Status |
---|---|---|---|
Pedro Manuel Baeza | Needs Resubmitting | ||
Yannick Vaucher @ Camptocamp | Needs Fixing | ||
Review via email: mp+216325@code.launchpad.net |
Commit message
Description of the change
- 131. By Vincent Vinet
-
Remove context from a call -- that breaks views
- 132. By Mathieu Benoit
-
[FIX] purchase_
lot_tracking: show error when missing serial number or when no analytic account in line. - 133. By Mathieu Benoit
-
[ADD] sale_warn_under: access_
sale_order_ warn to group base.group_ sale_salesman with read/write/create - 134. By Mathieu Benoit
-
[IMP] stock_forecast: add default security access
- 135. By Mathieu Benoit
-
[DEL] product_
reserve_ forecast: remove unsued access security. - 136. By Mathieu Benoit
-
[FIX] product_
reserve_ forecast: revert last commit - 137. By Mathieu Benoit
-
Merge pallet-delivery
Yannick Vaucher @ Camptocamp (yvaucher-c2c) wrote : | # |
- 138. By Mathieu Benoit
-
[FIX] writeoff_
lot_tracking: missing var move_lines in function writeoff_ move_line_ get - 139. By Mathieu Benoit
-
[IMP] pallet: change int nb_pallet to float
- 140. By Mathieu Benoit
-
[IMP] stock_forecast: add in green po_line in draft. Change 0 to empy in some columns.
- 141. By Mathieu Benoit
-
[IMP] sale_improved_slip: add more line of table CPC/CHEP in picking.rml
- 142. By Mathieu Benoit
-
[FIX] purchase_
lot_tracking: don't write prodlot when not matching between order_line and product. - 143. By Mathieu Benoit
-
[FIX] purchase_
lot_tracking: ignore service when match analytic account with stock.move - 144. By Mathieu Benoit
-
[FIX] stock_move_
autolot/ account. py, don't calcul if don't find account_analytic_id associated. - 145. By Mathieu Benoit
-
[FIX] writeoff_
lot_tracking/ account. py, ignore writeoff move line when it's supplier, bug when it's more than 2 currency. - 146. By Mathieu Benoit
-
[IMP] clean purchase_
lot_tracking/ purchase. py and adapt function to be utilize in another module. - 147. By Mathieu Benoit
-
[ADD] add module stock_picking_
create_ lot_button in tree view of Incoming Shipment. - 148. By Mathieu Benoit
-
[FIX] delivery stock when the stock_move is not associated with a po, but only with stock.picking.in. clean stock_move of sale_lot_available.
Pedro Manuel Baeza (pedro.baeza) wrote : | # |
This project is now hosted on https:/
- 149. By Mathieu Benoit
-
[FIX] stock_move_
autolot/ account. py, fix list out of index. - 150. By Mathieu Benoit
-
[IMP] sale_lot_available: show only positive prodlot. Add limit of 10 in selection.
- 151. By Mathieu Benoit
-
FIX: generate error when create new lot on tree view if not in stock.move.in
- 152. By Mathieu Benoit
-
[IMP] sale_lot_available: reduice available lot in other stock.picking.line where stock.picking is not done.
- 153. By Mathieu Benoit
-
[FIX] Revert commit 150,cause another bug in Delivery Orders, we need to show all prodlot_id to associate it with an empty prodlot.
- 154. By Mathieu Benoit
-
[FIX] sale_lot_available: ignore compute lot when cancel.
Unmerged revisions
- 154. By Mathieu Benoit
-
[FIX] sale_lot_available: ignore compute lot when cancel.
- 153. By Mathieu Benoit
-
[FIX] Revert commit 150,cause another bug in Delivery Orders, we need to show all prodlot_id to associate it with an empty prodlot.
- 152. By Mathieu Benoit
-
[IMP] sale_lot_available: reduice available lot in other stock.picking.line where stock.picking is not done.
- 151. By Mathieu Benoit
-
FIX: generate error when create new lot on tree view if not in stock.move.in
- 150. By Mathieu Benoit
-
[IMP] sale_lot_available: show only positive prodlot. Add limit of 10 in selection.
- 149. By Mathieu Benoit
-
[FIX] stock_move_
autolot/ account. py, fix list out of index. - 148. By Mathieu Benoit
-
[FIX] delivery stock when the stock_move is not associated with a po, but only with stock.picking.in. clean stock_move of sale_lot_available.
- 147. By Mathieu Benoit
-
[ADD] add module stock_picking_
create_ lot_button in tree view of Incoming Shipment. - 146. By Mathieu Benoit
-
[IMP] clean purchase_
lot_tracking/ purchase. py and adapt function to be utilize in another module. - 145. By Mathieu Benoit
-
[FIX] writeoff_
lot_tracking/ account. py, ignore writeoff move line when it's supplier, bug when it's more than 2 currency.
Preview Diff
1 | === added directory 'delivery_editable_dates' |
2 | === added file 'delivery_editable_dates/__init__.py' |
3 | === added file 'delivery_editable_dates/__openerp__.py' |
4 | --- delivery_editable_dates/__openerp__.py 1970-01-01 00:00:00 +0000 |
5 | +++ delivery_editable_dates/__openerp__.py 2014-08-27 19:22:25 +0000 |
6 | @@ -0,0 +1,39 @@ |
7 | +# -*- coding: utf-8 -*- |
8 | +############################################################################## |
9 | +# |
10 | +# OpenERP, Open Source Management Solution |
11 | +# Copyright (C) 2013 Savoir-faire Linux (<http://www.savoirfairelinux.com>). |
12 | +# |
13 | +# This program is free software: you can redistribute it and/or modify |
14 | +# it under the terms of the GNU Affero General Public License as |
15 | +# published by the Free Software Foundation, either version 3 of the |
16 | +# License, or (at your option) any later version. |
17 | +# |
18 | +# This program is distributed in the hope that it will be useful, |
19 | +# but WITHOUT ANY WARRANTY; without even the implied warranty of |
20 | +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
21 | +# GNU Affero General Public License for more details. |
22 | +# |
23 | +# You should have received a copy of the GNU Affero General Public License |
24 | +# along with this program. If not, see <http://www.gnu.org/licenses/>. |
25 | +# |
26 | +############################################################################## |
27 | + |
28 | +{ |
29 | + 'name': 'Editable Delivery Dates', |
30 | + 'version': '0.1', |
31 | + 'author': 'Savoir-faire Linux', |
32 | + 'maintainer': 'Savoir-faire Linux', |
33 | + 'website': 'http://www.savoirfairelinux.com', |
34 | + 'caterogy': 'sales', |
35 | + 'description': """ |
36 | +""", |
37 | + 'depends': ['base', 'sale'], |
38 | + 'data': [ |
39 | + 'editable_delivery_dates_view.xml', |
40 | + ], |
41 | + 'demo': [], |
42 | + 'test': [], |
43 | + 'installable': True, |
44 | + 'active': False, |
45 | +} |
46 | |
47 | === added file 'delivery_editable_dates/editable_delivery_dates_view.xml' |
48 | --- delivery_editable_dates/editable_delivery_dates_view.xml 1970-01-01 00:00:00 +0000 |
49 | +++ delivery_editable_dates/editable_delivery_dates_view.xml 2014-08-27 19:22:25 +0000 |
50 | @@ -0,0 +1,37 @@ |
51 | +<?xml version="1.0" encoding="utf-8" ?> |
52 | +<openerp> |
53 | + <data> |
54 | + <record id="editable_so_form" model="ir.ui.view"> |
55 | + <field name="name">sale.order.editable.form</field> |
56 | + <field name="model">sale.order</field> |
57 | + <field name="inherit_id" ref="sale.view_order_form" /> |
58 | + <field name="arch" type="xml"> |
59 | + <field name="date_order" position="replace"> |
60 | + <field name="date_order" attrs="{'readonly': False}" /> |
61 | + </field> |
62 | + </field> |
63 | + </record> |
64 | + |
65 | + <record id="editable_do_form" model="ir.ui.view"> |
66 | + <field name="name">stock.picking.out.editable.form</field> |
67 | + <field name="model">stock.picking.out</field> |
68 | + <field name="inherit_id" ref="stock.view_picking_out_form" /> |
69 | + <field name="arch" type="xml"> |
70 | + <field name="min_date" position="replace"> |
71 | + <field name="min_date" attrs="{'readonly': False, 'invisible': [('min_date', '=', False)]}" /> |
72 | + </field> |
73 | + </field> |
74 | + </record> |
75 | + |
76 | + <record id="editable_in_form" model="ir.ui.view"> |
77 | + <field name="name">stock.picking.in.editable.form</field> |
78 | + <field name="model">stock.picking.in</field> |
79 | + <field name="inherit_id" ref="stock.view_picking_in_form" /> |
80 | + <field name="arch" type="xml"> |
81 | + <field name="min_date" position="replace"> |
82 | + <field name="min_date" attrs="{'readonly': False, 'invisible': [('min_date', '=', False)]}" /> |
83 | + </field> |
84 | + </field> |
85 | + </record> |
86 | + </data> |
87 | +</openerp> |
88 | |
89 | === added directory 'delivery_editable_dates/i18n' |
90 | === added file 'delivery_editable_dates/i18n/delivery_editable_dates.pot' |
91 | --- delivery_editable_dates/i18n/delivery_editable_dates.pot 1970-01-01 00:00:00 +0000 |
92 | +++ delivery_editable_dates/i18n/delivery_editable_dates.pot 2014-08-27 19:22:25 +0000 |
93 | @@ -0,0 +1,16 @@ |
94 | +# Translation of OpenERP Server. |
95 | +# This file contains the translation of the following modules: |
96 | +# |
97 | +msgid "" |
98 | +msgstr "" |
99 | +"Project-Id-Version: OpenERP Server 7.0-20130811-231021\n" |
100 | +"Report-Msgid-Bugs-To: \n" |
101 | +"POT-Creation-Date: 2013-09-18 14:19+0000\n" |
102 | +"PO-Revision-Date: 2013-09-18 14:19+0000\n" |
103 | +"Last-Translator: <>\n" |
104 | +"Language-Team: \n" |
105 | +"MIME-Version: 1.0\n" |
106 | +"Content-Type: text/plain; charset=UTF-8\n" |
107 | +"Content-Transfer-Encoding: \n" |
108 | +"Plural-Forms: \n" |
109 | + |
110 | |
111 | === added directory 'landed_cost_per_pallet' |
112 | === added file 'landed_cost_per_pallet/README' |
113 | === added file 'landed_cost_per_pallet/__init__.py' |
114 | --- landed_cost_per_pallet/__init__.py 1970-01-01 00:00:00 +0000 |
115 | +++ landed_cost_per_pallet/__init__.py 2014-08-27 19:22:25 +0000 |
116 | @@ -0,0 +1,22 @@ |
117 | +# -*- coding: utf-8 -*- |
118 | +############################################################################## |
119 | +# |
120 | +# OpenERP, Open Source Management Solution |
121 | +# Copyright (C) 2013 Savoir-faire Linux (<http://www.savoirfairelinux.com>). |
122 | +# |
123 | +# This program is free software: you can redistribute it and/or modify |
124 | +# it under the terms of the GNU Affero General Public License as |
125 | +# published by the Free Software Foundation, either version 3 of the |
126 | +# License, or (at your option) any later version. |
127 | +# |
128 | +# This program is distributed in the hope that it will be useful, |
129 | +# but WITHOUT ANY WARRANTY; without even the implied warranty of |
130 | +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
131 | +# GNU Affero General Public License for more details. |
132 | +# |
133 | +# You should have received a copy of the GNU Affero General Public License |
134 | +# along with this program. If not, see <http://www.gnu.org/licenses/>. |
135 | +# |
136 | +############################################################################## |
137 | + |
138 | +import purchase |
139 | |
140 | === added file 'landed_cost_per_pallet/__openerp__.py' |
141 | --- landed_cost_per_pallet/__openerp__.py 1970-01-01 00:00:00 +0000 |
142 | +++ landed_cost_per_pallet/__openerp__.py 2014-08-27 19:22:25 +0000 |
143 | @@ -0,0 +1,52 @@ |
144 | +# -*- coding: utf-8 -*- |
145 | +############################################################################## |
146 | +# |
147 | +# OpenERP, Open Source Management Solution |
148 | +# Copyright (C) 2013 Savoir-faire Linux (<http://www.savoirfairelinux.com>). |
149 | +# |
150 | +# This program is free software: you can redistribute it and/or modify |
151 | +# it under the terms of the GNU Affero General Public License as |
152 | +# published by the Free Software Foundation, either version 3 of the |
153 | +# License, or (at your option) any later version. |
154 | +# |
155 | +# This program is distributed in the hope that it will be useful, |
156 | +# but WITHOUT ANY WARRANTY; without even the implied warranty of |
157 | +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
158 | +# GNU Affero General Public License for more details. |
159 | +# |
160 | +# You should have received a copy of the GNU Affero General Public License |
161 | +# along with this program. If not, see <http://www.gnu.org/licenses/>. |
162 | +# |
163 | +############################################################################## |
164 | + |
165 | +# NOTE: The name of the supplied field was initially "display_name", but it seems that OpenERP, |
166 | +# whenever it seems "name" in the field, returns the value for "name". Well... |
167 | + |
168 | +{ |
169 | + 'name': 'Landed Cost per Pallet', |
170 | + 'version': '1.1', |
171 | + 'author': 'Savoir-faire Linux', |
172 | + 'maintainer': 'Savoir-faire Linux', |
173 | + 'website': 'http://www.savoirfairelinux.com', |
174 | + 'category': 'Generic Modules/Purchases', |
175 | + 'description': """ |
176 | + |
177 | +Lets you manage product quantities using crates and pallets |
178 | +=========================================================== |
179 | + |
180 | +This module modifies the purchase module to let you manage product |
181 | +quantities by specifying a number of pallets and a number of crates |
182 | +per pallet. |
183 | + |
184 | +This also adds a 'Per Pallet' option to landed costs, in order to compute the |
185 | +landed costs per pallet. |
186 | +""", |
187 | + 'depends': ['base', 'purchase', 'purchase_landed_costs'], |
188 | + 'data': [ |
189 | + 'landed_cost_per_pallet_view.xml', |
190 | + ], |
191 | + 'demo': [], |
192 | + 'test': [], |
193 | + 'installable': True, |
194 | + 'active': False, |
195 | +} |
196 | |
197 | === added directory 'landed_cost_per_pallet/i18n' |
198 | === added file 'landed_cost_per_pallet/i18n/fr.po' |
199 | --- landed_cost_per_pallet/i18n/fr.po 1970-01-01 00:00:00 +0000 |
200 | +++ landed_cost_per_pallet/i18n/fr.po 2014-08-27 19:22:25 +0000 |
201 | @@ -0,0 +1,46 @@ |
202 | +# Translation of OpenERP Server. |
203 | +# This file contains the translation of the following modules: |
204 | +# * landed_cost_per_pallet |
205 | +# |
206 | +msgid "" |
207 | +msgstr "" |
208 | +"Project-Id-Version: OpenERP Server 7.0-20130811-231021\n" |
209 | +"Report-Msgid-Bugs-To: \n" |
210 | +"POT-Creation-Date: 2013-09-18 14:21+0000\n" |
211 | +"PO-Revision-Date: 2013-09-18 14:21+0000\n" |
212 | +"Last-Translator: Alexandre Boily <alexandre.boily@savoirfairelinux.com>\n" |
213 | +"Language-Team: Savoir-faire Linux\n" |
214 | +"MIME-Version: 1.0\n" |
215 | +"Content-Type: text/plain; charset=UTF-8\n" |
216 | +"Content-Transfer-Encoding: \n" |
217 | +"Plural-Forms: \n" |
218 | + |
219 | +#. module: landed_cost_per_pallet |
220 | +#: field:purchase.order,landed_cost_base_pallet:0 |
221 | +msgid "Landed Costs Base Pallet" |
222 | +msgstr "Coûts d'aterissage par palette" |
223 | + |
224 | +#. module: landed_cost_per_pallet |
225 | +#: model:ir.model,name:landed_cost_per_pallet.model_purchase_order_line |
226 | +msgid "Purchase Order Line" |
227 | +msgstr "Ligne de bon de commande" |
228 | + |
229 | +#. module: landed_cost_per_pallet |
230 | +#: model:ir.model,name:landed_cost_per_pallet.model_purchase_order |
231 | +msgid "Purchase Order" |
232 | +msgstr "Bon de commande" |
233 | + |
234 | +#. module: landed_cost_per_pallet |
235 | +#: field:purchase.order.line,nb_crates_per_pallet:0 |
236 | +msgid "Crates per pallet" |
237 | +msgstr "Caisses par palette" |
238 | + |
239 | +#. module: landed_cost_per_pallet |
240 | +#: field:purchase.order.line,nb_pallets:0 |
241 | +msgid "Pallets" |
242 | +msgstr "Palettes" |
243 | + |
244 | +#. module: landed_cost_per_pallet |
245 | +#: model:ir.model,name:landed_cost_per_pallet.model_landed_cost_position |
246 | +msgid "landed.cost.position" |
247 | +msgstr "landed.cost.position" |
248 | |
249 | === added file 'landed_cost_per_pallet/i18n/landed_cost_per_pallet.pot' |
250 | --- landed_cost_per_pallet/i18n/landed_cost_per_pallet.pot 1970-01-01 00:00:00 +0000 |
251 | +++ landed_cost_per_pallet/i18n/landed_cost_per_pallet.pot 2014-08-27 19:22:25 +0000 |
252 | @@ -0,0 +1,47 @@ |
253 | +# Translation of OpenERP Server. |
254 | +# This file contains the translation of the following modules: |
255 | +# * landed_cost_per_pallet |
256 | +# |
257 | +msgid "" |
258 | +msgstr "" |
259 | +"Project-Id-Version: OpenERP Server 7.0-20130811-231021\n" |
260 | +"Report-Msgid-Bugs-To: \n" |
261 | +"POT-Creation-Date: 2013-09-18 14:21+0000\n" |
262 | +"PO-Revision-Date: 2013-09-18 14:21+0000\n" |
263 | +"Last-Translator: <>\n" |
264 | +"Language-Team: \n" |
265 | +"MIME-Version: 1.0\n" |
266 | +"Content-Type: text/plain; charset=UTF-8\n" |
267 | +"Content-Transfer-Encoding: \n" |
268 | +"Plural-Forms: \n" |
269 | + |
270 | +#. module: landed_cost_per_pallet |
271 | +#: field:purchase.order,landed_cost_base_pallet:0 |
272 | +msgid "Landed Costs Base Pallet" |
273 | +msgstr "" |
274 | + |
275 | +#. module: landed_cost_per_pallet |
276 | +#: model:ir.model,name:landed_cost_per_pallet.model_purchase_order_line |
277 | +msgid "Purchase Order Line" |
278 | +msgstr "" |
279 | + |
280 | +#. module: landed_cost_per_pallet |
281 | +#: model:ir.model,name:landed_cost_per_pallet.model_purchase_order |
282 | +msgid "Purchase Order" |
283 | +msgstr "" |
284 | + |
285 | +#. module: landed_cost_per_pallet |
286 | +#: field:purchase.order.line,nb_crates_per_pallet:0 |
287 | +msgid "Crates per pallet" |
288 | +msgstr "" |
289 | + |
290 | +#. module: landed_cost_per_pallet |
291 | +#: field:purchase.order.line,nb_pallets:0 |
292 | +msgid "Pallets" |
293 | +msgstr "" |
294 | + |
295 | +#. module: landed_cost_per_pallet |
296 | +#: model:ir.model,name:landed_cost_per_pallet.model_landed_cost_position |
297 | +msgid "landed.cost.position" |
298 | +msgstr "" |
299 | + |
300 | |
301 | === added file 'landed_cost_per_pallet/landed_cost_per_pallet_view.xml' |
302 | --- landed_cost_per_pallet/landed_cost_per_pallet_view.xml 1970-01-01 00:00:00 +0000 |
303 | +++ landed_cost_per_pallet/landed_cost_per_pallet_view.xml 2014-08-27 19:22:25 +0000 |
304 | @@ -0,0 +1,27 @@ |
305 | +<?xml version="1.0" encoding="utf-8"?> |
306 | +<openerp> |
307 | + <data> |
308 | + <record id="view_purchase_pallet_crate_order_line" model="ir.ui.view"> |
309 | + <field name="name">purchase.order.form</field> |
310 | + <field name="model">purchase.order</field> |
311 | + <field name="inherit_id" ref="purchase.purchase_order_form"/> |
312 | + <field name="arch" type="xml"> |
313 | + <field name="product_qty" position="before"> |
314 | + <field name="nb_pallets"/> |
315 | + <field name="nb_crates_per_pallet"/> |
316 | + </field> |
317 | + </field> |
318 | + </record> |
319 | + |
320 | + <record id="view_purchase_pallet_crate_thing" model="ir.ui.view"> |
321 | + <field name="name">purchase.order.landing.form</field> |
322 | + <field name="model">purchase.order</field> |
323 | + <field name="inherit_id" ref="purchase_landed_costs.c2c_purchase_order_landed_cost_view" /> |
324 | + <field name="arch" type="xml"> |
325 | + <field name="landed_cost_base_value" position="after"> |
326 | + <field name="landed_cost_base_pallet" /> |
327 | + </field> |
328 | + </field> |
329 | + </record> |
330 | + </data> |
331 | +</openerp> |
332 | |
333 | === added file 'landed_cost_per_pallet/purchase.py' |
334 | --- landed_cost_per_pallet/purchase.py 1970-01-01 00:00:00 +0000 |
335 | +++ landed_cost_per_pallet/purchase.py 2014-08-27 19:22:25 +0000 |
336 | @@ -0,0 +1,125 @@ |
337 | +# -*- coding: utf-8 -*- |
338 | +############################################################################## |
339 | +# |
340 | +# OpenERP, Open Source Management Solution |
341 | +# Copyright (C) 2013 Savoir-faire Linux (<http://www.savoirfairelinux.com>). |
342 | +# |
343 | +# This program is free software: you can redistribute it and/or modify |
344 | +# it under the terms of the GNU Affero General Public License as |
345 | +# published by the Free Software Foundation, either version 3 of the |
346 | +# License, or (at your option) any later version. |
347 | +# |
348 | +# This program is distributed in the hope that it will be useful, |
349 | +# but WITHOUT ANY WARRANTY; without even the implied warranty of |
350 | +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
351 | +# GNU Affero General Public License for more details. |
352 | +# |
353 | +# You should have received a copy of the GNU Affero General Public License |
354 | +# along with this program. If not, see <http://www.gnu.org/licenses/>. |
355 | +# |
356 | +############################################################################## |
357 | + |
358 | +from openerp.osv import orm, fields |
359 | +import openerp.addons.decimal_precision as dp |
360 | + |
361 | +class purchase_order(orm.Model): |
362 | + |
363 | + _inherit = 'purchase.order' |
364 | + |
365 | + def _landed_cost_base_pallet(self, cr, uid, ids, name, args, context): |
366 | + if not ids: |
367 | + return {} |
368 | + |
369 | + result = {} |
370 | + landed_costs_base_pallet = 0.0 |
371 | + |
372 | + for line in self.browse(cr, uid, ids): |
373 | + if line.landed_cost_line_ids: |
374 | + for costs in line.landed_cost_line_ids: |
375 | + if costs.price_type == 'per_pallet': |
376 | + landed_costs_base_pallet += costs.amount |
377 | + result[line.id] = landed_costs_base_pallet |
378 | + |
379 | + return result |
380 | + |
381 | + _columns = { |
382 | + 'landed_cost_base_pallet': fields.function( |
383 | + _landed_cost_base_pallet, |
384 | + digits_compute=dp.get_precision('Account'), |
385 | + string='Landed Costs Base Pallet'), |
386 | + } |
387 | + |
388 | + |
389 | +class purchase_order_line(orm.Model): |
390 | + |
391 | + _inherit = 'purchase.order.line' |
392 | + |
393 | + def _product_quantity(self, cursor, user, ids, name, arg, context=None): |
394 | + res = {} |
395 | + for line in self.browse(cursor, user, ids, context=context): |
396 | + if not line.nb_crates_per_pallet or not line.nb_pallets: |
397 | + res[line.id] = 0 |
398 | + else: |
399 | + res[line.id] = line.nb_crates_per_pallet * line.nb_pallets |
400 | + return res |
401 | + |
402 | + def _landing_cost_order(self, cr, uid, ids, name, args, context): |
403 | + if not ids: |
404 | + return {} |
405 | + |
406 | + result = {} |
407 | + |
408 | + lines = self.browse(cr, uid, ids) |
409 | + |
410 | + # Pre-compute total number of pallets |
411 | + pallets_total = 0.0 |
412 | + for line in lines: |
413 | + for po_line in line.order_id.order_line: |
414 | + if po_line.order_id.landed_cost_line_ids: |
415 | + pallets_total += po_line.nb_pallets |
416 | + |
417 | + # Landed costs line by line |
418 | + for line in lines: |
419 | + landed_costs = 0.0 |
420 | + # distribution of landed costs of PO |
421 | + if line.order_id.landed_cost_line_ids: |
422 | + # Base value (Absolute Value) |
423 | + landed_costs += line.order_id.landed_cost_base_value / line.order_id.amount_total * line.price_subtotal |
424 | + |
425 | + # Base quantity (Per Quantity) |
426 | + landed_costs += line.order_id.landed_cost_base_quantity / line.order_id.quantity_total * line.product_qty |
427 | + |
428 | + # Base pallet (Per Pallet) |
429 | + landed_costs += line.order_id.landed_cost_base_pallet / pallets_total * line.nb_pallets |
430 | + result[line.id] = landed_costs |
431 | + |
432 | + return result |
433 | + |
434 | + _columns = { |
435 | + 'nb_pallets': fields.float('Pallets', required=True), |
436 | + 'nb_crates_per_pallet': fields.integer('Crates per pallet', required=True), |
437 | + 'product_qty': fields.function(_product_quantity, |
438 | + digits_compute=dp.get_precision('Product Unit of Measure'), |
439 | + string="Quantity", |
440 | + type='float'), |
441 | + 'landing_costs_order': fields.function(_landing_cost_order, |
442 | + digits_compute=dp.get_precision('Account'), |
443 | + string='Landing Costs from Order'), |
444 | + } |
445 | + |
446 | + |
447 | +class landed_cost_position(orm.Model): |
448 | + |
449 | + _inherit = 'landed.cost.position' |
450 | + |
451 | + _columns = { |
452 | + 'price_type': fields.selection( |
453 | + [('per_pallet', 'Per Pallet'), ('per_unit','Per Quantity'), ('value','Absolute Value')], |
454 | + 'Amount Type', |
455 | + required=True, |
456 | + help="Defines if the amount is to be calculated for each quantity or an absolute value"), |
457 | + } |
458 | + |
459 | + _defaults = { |
460 | + 'price_type': 'per_pallet', |
461 | + } |
462 | |
463 | === added directory 'pallet_delivery' |
464 | === added file 'pallet_delivery/README' |
465 | === added file 'pallet_delivery/__init__.py' |
466 | --- pallet_delivery/__init__.py 1970-01-01 00:00:00 +0000 |
467 | +++ pallet_delivery/__init__.py 2014-08-27 19:22:25 +0000 |
468 | @@ -0,0 +1,22 @@ |
469 | +# -*- coding: utf-8 -*- |
470 | +############################################################################## |
471 | +# |
472 | +# OpenERP, Open Source Management Solution |
473 | +# Copyright (C) 2013 Savoir-faire Linux (<http://www.savoirfairelinux.com>). |
474 | +# |
475 | +# This program is free software: you can redistribute it and/or modify |
476 | +# it under the terms of the GNU Affero General Public License as |
477 | +# published by the Free Software Foundation, either version 3 of the |
478 | +# License, or (at your option) any later version. |
479 | +# |
480 | +# This program is distributed in the hope that it will be useful, |
481 | +# but WITHOUT ANY WARRANTY; without even the implied warranty of |
482 | +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
483 | +# GNU Affero General Public License for more details. |
484 | +# |
485 | +# You should have received a copy of the GNU Affero General Public License |
486 | +# along with this program. If not, see <http://www.gnu.org/licenses/>. |
487 | +# |
488 | +############################################################################## |
489 | + |
490 | +import stock |
491 | |
492 | === added file 'pallet_delivery/__openerp__.py' |
493 | --- pallet_delivery/__openerp__.py 1970-01-01 00:00:00 +0000 |
494 | +++ pallet_delivery/__openerp__.py 2014-08-27 19:22:25 +0000 |
495 | @@ -0,0 +1,58 @@ |
496 | +# -*- coding: utf-8 -*- |
497 | +############################################################################## |
498 | +# |
499 | +# OpenERP, Open Source Management Solution |
500 | +# Copyright (C) 2013 Savoir-faire Linux (<http://www.savoirfairelinux.com>). |
501 | +# |
502 | +# This program is free software: you can redistribute it and/or modify |
503 | +# it under the terms of the GNU Affero General Public License as |
504 | +# published by the Free Software Foundation, either version 3 of the |
505 | +# License, or (at your option) any later version. |
506 | +# |
507 | +# This program is distributed in the hope that it will be useful, |
508 | +# but WITHOUT ANY WARRANTY; without even the implied warranty of |
509 | +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
510 | +# GNU Affero General Public License for more details. |
511 | +# |
512 | +# You should have received a copy of the GNU Affero General Public License |
513 | +# along with this program. If not, see <http://www.gnu.org/licenses/>. |
514 | +# |
515 | +############################################################################## |
516 | + |
517 | +# NOTE: The name of the supplied field was initially "display_name", but it seems that OpenERP, |
518 | +# whenever it seems "name" in the field, returns the value for "name". Well... |
519 | + |
520 | +{ |
521 | + 'name': 'Pallet delivery', |
522 | + 'version': '1.1', |
523 | + 'author': 'Savoir-faire Linux', |
524 | + 'maintainer': 'Savoir-faire Linux', |
525 | + 'website': 'http://www.savoirfairelinux.com', |
526 | + 'category': 'warehouse', |
527 | + 'description': """ |
528 | + |
529 | +Lets you manage truck deliveries |
530 | +=========================================================== |
531 | + |
532 | +This module lets you specify where exactly in the delivery truck |
533 | +was the merchandise. |
534 | + |
535 | +Also lets you give more specific information like the temperature |
536 | +at various points. |
537 | + |
538 | +""", |
539 | + 'depends': [ |
540 | + 'base', 'purchase', 'stock', |
541 | + 'landed_cost_per_pallet', 'purchase_lot_tracking', |
542 | + ], |
543 | + 'data': [ |
544 | + 'security/ir.model.access.csv', |
545 | + 'stock_workflow.xml', |
546 | + 'pallet_delivery_data.xml', |
547 | + 'pallet_delivery_view.xml', |
548 | + ], |
549 | + 'demo': [], |
550 | + 'test': [], |
551 | + 'installable': True, |
552 | + 'active': False, |
553 | +} |
554 | |
555 | === added directory 'pallet_delivery/i18n' |
556 | === added file 'pallet_delivery/i18n/fr.po' |
557 | --- pallet_delivery/i18n/fr.po 1970-01-01 00:00:00 +0000 |
558 | +++ pallet_delivery/i18n/fr.po 2014-08-27 19:22:25 +0000 |
559 | @@ -0,0 +1,186 @@ |
560 | +# Translation of OpenERP Server. |
561 | +# This file contains the translation of the following modules: |
562 | +# * pallet_delivery |
563 | +# |
564 | +msgid "" |
565 | +msgstr "" |
566 | +"Project-Id-Version: OpenERP Server 7.0-20130811-231021\n" |
567 | +"Report-Msgid-Bugs-To: \n" |
568 | +"POT-Creation-Date: 2013-09-05 14:56+0000\n" |
569 | +"PO-Revision-Date: 2013-09-05 14:56+0000\n" |
570 | +"Last-Translator: <>\n" |
571 | +"Language-Team: \n" |
572 | +"MIME-Version: 1.0\n" |
573 | +"Content-Type: text/plain; charset=UTF-8\n" |
574 | +"Content-Transfer-Encoding: \n" |
575 | +"Plural-Forms: \n" |
576 | + |
577 | +#. module: pallet_delivery |
578 | +#: model:ir.actions.act_window,help:pallet_delivery.action_truck_pending |
579 | +msgid "<p class=\"oe_view_nocontent_create\">Click to create a draft truck</p>\n" |
580 | +"\n" |
581 | +" <p>The truck contains an incoming, physical shipment. With it you can\n" |
582 | +" register the truck's details, such as its serial number, sampled\n" |
583 | +" temperatures, and other information. Also, the truck serves you as a\n" |
584 | +" map of what your company received.</p>\n" |
585 | +"\n" |
586 | +" <p>When you confirm the truck, it will act as an “Incoming Shipment”\n" |
587 | +" confirmation, and the products will be moved from your Suppliers (as\n" |
588 | +" listed in Purchase Orders) to your Stock.</p>\n" |
589 | +" " |
590 | +msgstr "<p class=\"oe_view_nocontent_create\">Cliquez pour créer un camion brouillon</p>\n |
591 | +<p>Le camion contient une livraison physique entrante. Avec celui-ci, vous |
592 | +pouvez enregistrer les détails du camion, comme son numéro de série, les |
593 | +températures échantillonnées, et d'autre informations. De même, le camion est |
594 | +utile comme carte des produits reçus.</p> |
595 | +<p>Lorsque vous confirmez la réception du camion, ce dernier agira comme une |
596 | +\"Livraison entrante\" confirmée, et le produits seront déplacés de vos |
597 | +fournisseurs (tels que listés dans vos bons de commandes) vers votre |
598 | +entrepôt.</p>" |
599 | + |
600 | +#. module: pallet_delivery |
601 | +#: model:ir.model,name:pallet_delivery.model_purchase_order_line |
602 | +msgid "Purchase Order Line" |
603 | +msgstr "Ligne de bon d'achat" |
604 | + |
605 | +#. module: pallet_delivery |
606 | +#: view:stock.truck:0 |
607 | +msgid "Confirm" |
608 | +msgstr "Confirmer" |
609 | + |
610 | +#. module: pallet_delivery |
611 | +#: model:ir.model,name:pallet_delivery.model_stock_truck_line |
612 | +msgid "A single pallet shipped in an incoming truck" |
613 | +msgstr "Une seule palette livrée dans un camion entrant" |
614 | + |
615 | +#. module: pallet_delivery |
616 | +#: view:stock.truck:0 |
617 | +#: field:stock.truck.line,crates:0 |
618 | +msgid "Crates" |
619 | +msgstr "Caisses" |
620 | + |
621 | +#. module: pallet_delivery |
622 | +#: field:stock.truck.line,pallet:0 |
623 | +msgid "Pallet" |
624 | +msgstr "Palette" |
625 | + |
626 | +#. module: pallet_delivery |
627 | +#: field:stock.truck,state:0 |
628 | +msgid "State" |
629 | +msgstr "État" |
630 | + |
631 | +#. module: pallet_delivery |
632 | +#: model:ir.model,name:pallet_delivery.model_stock_truck |
633 | +msgid "Incoming truck" |
634 | +msgstr "Camion entrant" |
635 | + |
636 | +#. module: pallet_delivery |
637 | +#: selection:stock.truck,state:0 |
638 | +msgid "Draft" |
639 | +msgstr "Ébauche" |
640 | + |
641 | +#. module: pallet_delivery |
642 | +#: view:stock.truck:0 |
643 | +msgid "Details" |
644 | +msgstr "Détails" |
645 | + |
646 | +#. module: pallet_delivery |
647 | +#: field:stock.truck,front_temperature:0 |
648 | +msgid "Front Temperature" |
649 | +msgstr "Température avant" |
650 | + |
651 | +#. module: pallet_delivery |
652 | +#: field:stock.truck,supplier:0 |
653 | +msgid "Supplier" |
654 | +msgstr "Fournisseur" |
655 | + |
656 | +#. module: pallet_delivery |
657 | +#: view:stock.truck:0 |
658 | +msgid "Truck Composition" |
659 | +msgstr "Composition du camion" |
660 | + |
661 | +#. module: pallet_delivery |
662 | +#: field:stock.truck,back_temperature:0 |
663 | +msgid "Back Temperature" |
664 | +msgstr "Température arrière" |
665 | + |
666 | +#. module: pallet_delivery |
667 | +#: view:stock.truck:0 |
668 | +msgid "Serial Number" |
669 | +msgstr "Numéro de série" |
670 | + |
671 | +#. module: pallet_delivery |
672 | +#: view:stock.truck:0 |
673 | +msgid "Left Pallets" |
674 | +msgstr "Palettes gauche" |
675 | + |
676 | +#. module: pallet_delivery |
677 | +#: field:stock.truck,left_pallet_ids:0 |
678 | +#: field:stock.truck,right_pallet_ids:0 |
679 | +msgid "Pallets" |
680 | +msgstr "Palettes" |
681 | + |
682 | +#. module: pallet_delivery |
683 | +#: field:stock.truck,truck_sn:0 |
684 | +msgid "Truck S/N" |
685 | +msgstr "Numéro de série" |
686 | + |
687 | +#. module: pallet_delivery |
688 | +#: field:stock.truck,name:0 |
689 | +#: field:stock.truck.line,name:0 |
690 | +msgid "Name" |
691 | +msgstr "Nom" |
692 | + |
693 | +#. module: pallet_delivery |
694 | +#: field:purchase.order,stock_truck_ids:0 |
695 | +msgid "Trucks" |
696 | +msgstr "Camions" |
697 | + |
698 | +#. module: pallet_delivery |
699 | +#: view:stock.truck:0 |
700 | +msgid "Search Truck" |
701 | +msgstr "Rechercher un camion" |
702 | + |
703 | +#. module: pallet_delivery |
704 | +#: model:ir.model,name:pallet_delivery.model_purchase_order |
705 | +msgid "Purchase Order" |
706 | +msgstr "Bon d'achat" |
707 | + |
708 | +#. module: pallet_delivery |
709 | +#: field:stock.truck,arrival:0 |
710 | +msgid "Date of Arrival" |
711 | +msgstr "Date d'arrivée" |
712 | + |
713 | +#. module: pallet_delivery |
714 | +#: view:stock.truck:0 |
715 | +#: field:stock.truck.line,left_id:0 |
716 | +#: field:stock.truck.line,right_id:0 |
717 | +msgid "Truck" |
718 | +msgstr "Camion" |
719 | + |
720 | +#. module: pallet_delivery |
721 | +#: view:stock.truck:0 |
722 | +msgid "Right Pallets" |
723 | +msgstr "Palettes droite" |
724 | + |
725 | +#. module: pallet_delivery |
726 | +#: model:ir.actions.act_window,name:pallet_delivery.action_truck_pending |
727 | +msgid "On Draft Truck" |
728 | +msgstr "Camion en ébauche" |
729 | + |
730 | +#. module: pallet_delivery |
731 | +#: model:ir.ui.menu,name:pallet_delivery.menu_truck |
732 | +msgid "Incoming Truck" |
733 | +msgstr "Camion entrant" |
734 | + |
735 | +#. module: pallet_delivery |
736 | +#: selection:stock.truck,state:0 |
737 | +msgid "Done" |
738 | +msgstr "Complété" |
739 | + |
740 | +#. module: pallet_delivery |
741 | +#: view:stock.truck:0 |
742 | +#: field:stock.truck,purchase_order_ids:0 |
743 | +msgid "Purchase Orders" |
744 | +msgstr "Bons d'achats" |
745 | + |
746 | |
747 | === added file 'pallet_delivery/i18n/pallet_delivery.pot' |
748 | --- pallet_delivery/i18n/pallet_delivery.pot 1970-01-01 00:00:00 +0000 |
749 | +++ pallet_delivery/i18n/pallet_delivery.pot 2014-08-27 19:22:25 +0000 |
750 | @@ -0,0 +1,225 @@ |
751 | +# Translation of OpenERP Server. |
752 | +# This file contains the translation of the following modules: |
753 | +# * pallet_delivery |
754 | +# |
755 | +msgid "" |
756 | +msgstr "" |
757 | +"Project-Id-Version: OpenERP Server 7.0\n" |
758 | +"Report-Msgid-Bugs-To: \n" |
759 | +"POT-Creation-Date: 2014-05-04 15:54+0000\n" |
760 | +"PO-Revision-Date: 2014-05-04 15:54+0000\n" |
761 | +"Last-Translator: <>\n" |
762 | +"Language-Team: \n" |
763 | +"MIME-Version: 1.0\n" |
764 | +"Content-Type: text/plain; charset=UTF-8\n" |
765 | +"Content-Transfer-Encoding: \n" |
766 | +"Plural-Forms: \n" |
767 | + |
768 | +#. module: pallet_delivery |
769 | +#: model:ir.actions.act_window,help:pallet_delivery.action_truck_pending |
770 | +msgid "<p class=\"oe_view_nocontent_create\">Click to create a draft truck</p>\n" |
771 | +"\n" |
772 | +" <p>The truck contains an incoming, physical shipment. With it you can\n" |
773 | +" register the truck's details, such as its serial number, sampled\n" |
774 | +" temperatures, and other information. Also, the truck serves you as a\n" |
775 | +" map of what your company received.</p>\n" |
776 | +"\n" |
777 | +" <p>When you confirm the truck, it will act as an “Incoming Shipment”\n" |
778 | +" confirmation, and the products will be moved from your Suppliers (as\n" |
779 | +" listed in Purchase Orders) to your Stock.</p>\n" |
780 | +" " |
781 | +msgstr "" |
782 | + |
783 | +#. module: pallet_delivery |
784 | +#: model:ir.model,name:pallet_delivery.model_purchase_order_line |
785 | +msgid "Purchase Order Line" |
786 | +msgstr "" |
787 | + |
788 | +#. module: pallet_delivery |
789 | +#: field:stock.truck,back_temperature:0 |
790 | +msgid "Back Temperature" |
791 | +msgstr "" |
792 | + |
793 | +#. module: pallet_delivery |
794 | +#: model:ir.model,name:pallet_delivery.model_stock_picking_in |
795 | +msgid "Incoming Shipments" |
796 | +msgstr "" |
797 | + |
798 | +#. module: pallet_delivery |
799 | +#: model:ir.model,name:pallet_delivery.model_stock_truck_line |
800 | +msgid "A single pallet shipped in an incoming truck" |
801 | +msgstr "" |
802 | + |
803 | +#. module: pallet_delivery |
804 | +#: view:stock.truck:0 |
805 | +#: field:stock.truck.line,crates:0 |
806 | +msgid "Crates" |
807 | +msgstr "" |
808 | + |
809 | +#. module: pallet_delivery |
810 | +#: field:stock.truck.line,pallet:0 |
811 | +msgid "Pallet" |
812 | +msgstr "" |
813 | + |
814 | +#. module: pallet_delivery |
815 | +#: field:stock.truck,state:0 |
816 | +msgid "State" |
817 | +msgstr "" |
818 | + |
819 | +#. module: pallet_delivery |
820 | +#: model:ir.model,name:pallet_delivery.model_stock_truck |
821 | +msgid "Incoming truck" |
822 | +msgstr "" |
823 | + |
824 | +#. module: pallet_delivery |
825 | +#: selection:stock.truck,state:0 |
826 | +msgid "Draft" |
827 | +msgstr "" |
828 | + |
829 | +#. module: pallet_delivery |
830 | +#: view:stock.truck:0 |
831 | +msgid "Details" |
832 | +msgstr "" |
833 | + |
834 | +#. module: pallet_delivery |
835 | +#: field:stock.truck,front_temperature:0 |
836 | +msgid "Front Temperature" |
837 | +msgstr "" |
838 | + |
839 | +#. module: pallet_delivery |
840 | +#: field:stock.truck,supplier:0 |
841 | +msgid "Supplier" |
842 | +msgstr "" |
843 | + |
844 | +#. module: pallet_delivery |
845 | +#: field:purchase.order,hidden:0 |
846 | +msgid "Hidden" |
847 | +msgstr "" |
848 | + |
849 | +#. module: pallet_delivery |
850 | +#: view:stock.truck:0 |
851 | +msgid "Truck Composition" |
852 | +msgstr "" |
853 | + |
854 | +#. module: pallet_delivery |
855 | +#: field:purchase.order,assigned:0 |
856 | +msgid "unknown" |
857 | +msgstr "" |
858 | + |
859 | +#. module: pallet_delivery |
860 | +#: view:stock.truck:0 |
861 | +msgid "Confirm" |
862 | +msgstr "" |
863 | + |
864 | +#. module: pallet_delivery |
865 | +#: view:stock.truck:0 |
866 | +msgid "Serial Number" |
867 | +msgstr "" |
868 | + |
869 | +#. module: pallet_delivery |
870 | +#: view:stock.truck:0 |
871 | +msgid "Right Pallets" |
872 | +msgstr "" |
873 | + |
874 | +#. module: pallet_delivery |
875 | +#: field:stock.truck,left_pallet_ids:0 |
876 | +#: field:stock.truck,right_pallet_ids:0 |
877 | +msgid "Pallets" |
878 | +msgstr "" |
879 | + |
880 | +#. module: pallet_delivery |
881 | +#: field:stock.truck,truck_sn:0 |
882 | +msgid "Truck S/N" |
883 | +msgstr "" |
884 | + |
885 | +#. module: pallet_delivery |
886 | +#: code:addons/pallet_delivery/stock.py:293 |
887 | +#, python-format |
888 | +msgid "Input Error !" |
889 | +msgstr "" |
890 | + |
891 | +#. module: pallet_delivery |
892 | +#: field:stock.truck,name:0 |
893 | +#: field:stock.truck.line,name:0 |
894 | +msgid "Name" |
895 | +msgstr "" |
896 | + |
897 | +#. module: pallet_delivery |
898 | +#: field:purchase.order,stock_truck_ids:0 |
899 | +msgid "Trucks" |
900 | +msgstr "" |
901 | + |
902 | +#. module: pallet_delivery |
903 | +#: view:stock.truck:0 |
904 | +msgid "Search Truck" |
905 | +msgstr "" |
906 | + |
907 | +#. module: pallet_delivery |
908 | +#: model:ir.model,name:pallet_delivery.model_purchase_order |
909 | +msgid "Purchase Order" |
910 | +msgstr "" |
911 | + |
912 | +#. module: pallet_delivery |
913 | +#: field:stock.truck,arrival:0 |
914 | +msgid "Date of Arrival" |
915 | +msgstr "" |
916 | + |
917 | +#. module: pallet_delivery |
918 | +#: view:stock.truck:0 |
919 | +#: field:stock.truck.line,left_id:0 |
920 | +#: field:stock.truck.line,right_id:0 |
921 | +msgid "Truck" |
922 | +msgstr "" |
923 | + |
924 | +#. module: pallet_delivery |
925 | +#: view:stock.truck:0 |
926 | +msgid "Left Pallets" |
927 | +msgstr "" |
928 | + |
929 | +#. module: pallet_delivery |
930 | +#: model:ir.actions.act_window,help:pallet_delivery.purchase_order_hidden |
931 | +msgid "<p class=\"oe_view_nocontent_create\">\n" |
932 | +" Click to create a quotation that will be converted into a purchase order. \n" |
933 | +" </p><p>\n" |
934 | +" Use this menu to search within your purchase orders by\n" |
935 | +" references, supplier, products, etc. For each purchase order,\n" |
936 | +" you can track the related discussion with the supplier, control\n" |
937 | +" the products received and control the supplier invoices.\n" |
938 | +" </p>\n" |
939 | +" " |
940 | +msgstr "" |
941 | + |
942 | +#. module: pallet_delivery |
943 | +#: model:ir.actions.act_window,name:pallet_delivery.action_truck_pending |
944 | +msgid "On Draft Truck" |
945 | +msgstr "" |
946 | + |
947 | +#. module: pallet_delivery |
948 | +#: code:addons/pallet_delivery/stock.py:294 |
949 | +#, python-format |
950 | +msgid "Please enter real numbers." |
951 | +msgstr "" |
952 | + |
953 | +#. module: pallet_delivery |
954 | +#: model:ir.model,name:pallet_delivery.model_stock_move |
955 | +msgid "Stock Move" |
956 | +msgstr "" |
957 | + |
958 | +#. module: pallet_delivery |
959 | +#: model:ir.ui.menu,name:pallet_delivery.menu_truck_purchase |
960 | +#: model:ir.ui.menu,name:pallet_delivery.menu_truck_stock |
961 | +msgid "Incoming Truck" |
962 | +msgstr "" |
963 | + |
964 | +#. module: pallet_delivery |
965 | +#: selection:stock.truck,state:0 |
966 | +msgid "Done" |
967 | +msgstr "" |
968 | + |
969 | +#. module: pallet_delivery |
970 | +#: model:ir.actions.act_window,name:pallet_delivery.purchase_order_hidden |
971 | +#: view:stock.truck:0 |
972 | +#: field:stock.truck,purchase_order_ids:0 |
973 | +msgid "Purchase Orders" |
974 | +msgstr "" |
975 | + |
976 | |
977 | === added file 'pallet_delivery/pallet_delivery_data.xml' |
978 | --- pallet_delivery/pallet_delivery_data.xml 1970-01-01 00:00:00 +0000 |
979 | +++ pallet_delivery/pallet_delivery_data.xml 2014-08-27 19:22:25 +0000 |
980 | @@ -0,0 +1,35 @@ |
981 | +<?xml version="1.0" encoding="utf-8"?> |
982 | +<openerp> |
983 | + <data noupdate="1"> |
984 | + <record id="pallet_delivery_external_po" model="purchase.order"> |
985 | + <field name="partner_id">1</field> |
986 | + <field name="location_id">8</field> |
987 | + <field name="state">cancel</field> |
988 | + <field name="pricelist_id" ref="purchase.list0"/> |
989 | + <field name="hidden">1</field> |
990 | + </record> |
991 | + |
992 | + <record id="pallet_delivery_external_line" model="purchase.order.line"> |
993 | + <field name="product_uom">1</field> |
994 | + <field name="order_id" ref="pallet_delivery_external_po" /> |
995 | + <field name="price_unit">1</field> |
996 | + <field name="name">Not ours</field> |
997 | + <field name="date_planned">2013-01-01</field> |
998 | + <field name="state">confirmed</field> |
999 | + <field name="nb_pallets">1</field> |
1000 | + <field name="nb_crates_per_pallet">1</field> |
1001 | + </record> |
1002 | + |
1003 | + <record id="seq_type_stock_truck" model="ir.sequence.type"> |
1004 | + <field name="name">Truck</field> |
1005 | + <field name="code">stock.truck</field> |
1006 | + </record> |
1007 | + |
1008 | + <record id="seq_stock_truck" model="ir.sequence"> |
1009 | + <field name="name">Truck</field> |
1010 | + <field name="code">stock.truck</field> |
1011 | + <field name="prefix">TRK</field> |
1012 | + <field name="padding">5</field> |
1013 | + </record> |
1014 | + </data> |
1015 | +</openerp> |
1016 | |
1017 | === added file 'pallet_delivery/pallet_delivery_view.xml' |
1018 | --- pallet_delivery/pallet_delivery_view.xml 1970-01-01 00:00:00 +0000 |
1019 | +++ pallet_delivery/pallet_delivery_view.xml 2014-08-27 19:22:25 +0000 |
1020 | @@ -0,0 +1,160 @@ |
1021 | +<?xml version="1.0" encoding="utf-8"?> |
1022 | +<openerp> |
1023 | + <data> |
1024 | + <!-- Purchase Order --> |
1025 | + <record id="purchase_order_hidden" model="ir.actions.act_window"> |
1026 | + <field name="name">Purchase Orders</field> |
1027 | + <field name="type">ir.actions.act_window</field> |
1028 | + <field name="res_model">purchase.order</field> |
1029 | + <field name="view_mode">tree,form,graph,calendar</field> |
1030 | + <field name="context">{}</field> |
1031 | + <field name="domain">['&', ('state','not in',('draft','sent','confirmed')), ('hidden', '!=', True)]</field> |
1032 | + <field name="search_view_id" ref="purchase.view_purchase_order_filter"/> |
1033 | + <field name="help" type="html"> |
1034 | + <p class="oe_view_nocontent_create"> |
1035 | + Click to create a quotation that will be converted into a purchase order. |
1036 | + </p><p> |
1037 | + Use this menu to search within your purchase orders by |
1038 | + references, supplier, products, etc. For each purchase order, |
1039 | + you can track the related discussion with the supplier, control |
1040 | + the products received and control the supplier invoices. |
1041 | + </p> |
1042 | + </field> |
1043 | + </record> |
1044 | + |
1045 | + <menuitem |
1046 | + id="purchase.menu_purchase_form_action" |
1047 | + action="purchase_order_hidden" |
1048 | + parent="purchase.menu_procurement_management" |
1049 | + sequence="6" /> |
1050 | + |
1051 | + <!-- Truck --> |
1052 | + <record id="truck_tree" model="ir.ui.view"> |
1053 | + <field name="name">stock.truck.tree</field> |
1054 | + <field name="model">stock.truck</field> |
1055 | + <field name="arch" type="xml"> |
1056 | + <tree string="Truck"> |
1057 | + <field name="name" /> |
1058 | + <field name="truck_sn" /> |
1059 | + <field name="supplier" /> |
1060 | + <field name="arrival" /> |
1061 | + </tree> |
1062 | + </field> |
1063 | + </record> |
1064 | + |
1065 | + <record id="truck_form" model="ir.ui.view"> |
1066 | + <field name="name">stock.truck.form</field> |
1067 | + <field name="model">stock.truck</field> |
1068 | + <field eval="1" name="priority" /> |
1069 | + <field name="arch" type="xml"> |
1070 | + <form string="Truck" version="7.0"> |
1071 | + <header> |
1072 | + <button |
1073 | + name="action_done" |
1074 | + type="object" |
1075 | + states="draft" |
1076 | + string="Confirm" |
1077 | + class="oe_highlight" /> |
1078 | + |
1079 | + <field |
1080 | + name="state" |
1081 | + widget="statusbar" |
1082 | + statusbar_visible="draft,done" |
1083 | + statusbar_colors='{"draft":"blue","done":"blue"}' /> |
1084 | + </header> |
1085 | + |
1086 | + <sheet> |
1087 | + <group> |
1088 | + <group name="pedigree" string="Details" colspan="4" col="4"> |
1089 | + <group> |
1090 | + <field name="truck_sn" /> |
1091 | + <field name="supplier" /> |
1092 | + <field name="arrival" on_change="onchange_arrival(arrival)" /> |
1093 | + </group> |
1094 | + |
1095 | + <group> |
1096 | + <field name="front_temperature" on_change="validate_temperature(front_temperature, 'front_temperature')" /> |
1097 | + <field name="back_temperature" on_change="validate_temperature(back_temperature, 'back_temperature')" /> |
1098 | + </group> |
1099 | + </group> |
1100 | + |
1101 | + <group name="purchase_orders" string="Purchase Orders" colspan="4"> |
1102 | + <field name="purchase_order_ids" nolabel="1" domain="[('state', 'not in', ['draft', 'done']), ('assigned', '=', True)]"> |
1103 | + <tree> |
1104 | + <field name="name" /> |
1105 | + </tree> |
1106 | + </field> |
1107 | + </group> |
1108 | + |
1109 | + <group name="pallets" string="Truck Composition" colspan="4"> |
1110 | + <group> |
1111 | + <field name="left_pallet_ids" nolabel="1"> |
1112 | + <tree editable="bottom"> |
1113 | + <field name="pallet" string="Left Pallets" context="{'nice':'nice','parent':parent}" /> |
1114 | + <field name="crates" string="Crates" /> |
1115 | + </tree> |
1116 | + </field> |
1117 | + </group> |
1118 | + |
1119 | + <group> |
1120 | + <field name="right_pallet_ids" nolabel="1"> |
1121 | + <tree editable="bottom"> |
1122 | + <field name="pallet" string="Right Pallets" context="{'nice':'nice','parent':parent}" /> |
1123 | + <field name="crates" string="Crates" /> |
1124 | + </tree> |
1125 | + </field> |
1126 | + </group> |
1127 | + </group> |
1128 | + </group> |
1129 | + </sheet> |
1130 | + </form> |
1131 | + </field> |
1132 | + </record> |
1133 | + |
1134 | + <record id="view_truck_filter" model="ir.ui.view"> |
1135 | + <field name="name">stock.truck.select</field> |
1136 | + <field name="model">stock.truck</field> |
1137 | + <field name="arch" type="xml"> |
1138 | + <search string="Search Truck"> |
1139 | + <field name="truck_sn" string="Serial Number" filter_domain="[('truck_sn', '=', self)]" /> |
1140 | + </search> |
1141 | + </field> |
1142 | + </record> |
1143 | + |
1144 | + <!-- Menu --> |
1145 | + <record id="action_truck_pending" model="ir.actions.act_window"> |
1146 | + <field name="name">On Draft Truck</field> |
1147 | + <field name="res_model">stock.truck</field> |
1148 | + <field name="view_type">form</field> |
1149 | + <field name="view_mode">tree,form</field> |
1150 | + <field eval="False" name="view_id" /> |
1151 | + <field name="search_view_id" ref="pallet_delivery.view_truck_filter" /> |
1152 | + <field name="help" type="html"> |
1153 | + <p class="oe_view_nocontent_create">Click to create a draft truck</p> |
1154 | + |
1155 | + <p>The truck contains an incoming, physical shipment. With it you can |
1156 | + register the truck's details, such as its serial number, sampled |
1157 | + temperatures, and other information. Also, the truck serves you as a |
1158 | + map of what your company received.</p> |
1159 | + |
1160 | + <p>When you confirm the truck, it will act as an “Incoming Shipment” |
1161 | + confirmation, and the products will be moved from your Suppliers (as |
1162 | + listed in Purchase Orders) to your Stock.</p> |
1163 | + </field> |
1164 | + </record> |
1165 | + |
1166 | + <menuitem |
1167 | + name="Incoming Truck" |
1168 | + id="menu_truck_purchase" |
1169 | + action="action_truck_pending" |
1170 | + parent="purchase.menu_procurement_management_inventory" |
1171 | + sequence="8" /> |
1172 | + |
1173 | + <menuitem |
1174 | + name="Incoming Truck" |
1175 | + id="menu_truck_stock" |
1176 | + action="action_truck_pending" |
1177 | + parent="stock.menu_stock_warehouse_mgmt" |
1178 | + sequence="0" /> |
1179 | + </data> |
1180 | +</openerp> |
1181 | |
1182 | === added directory 'pallet_delivery/security' |
1183 | === added file 'pallet_delivery/security/ir.model.access.csv' |
1184 | --- pallet_delivery/security/ir.model.access.csv 1970-01-01 00:00:00 +0000 |
1185 | +++ pallet_delivery/security/ir.model.access.csv 2014-08-27 19:22:25 +0000 |
1186 | @@ -0,0 +1,5 @@ |
1187 | +id,name,model_id:id,group_id:id,perm_read,perm_write,perm_create,perm_unlink |
1188 | +access_stock_truck_stock,stock.truck all,model_stock_truck,stock.group_stock_user,1,1,1,1 |
1189 | +access_stock_truck_purchase,stock.truck all,model_stock_truck,purchase.group_purchase_user,1,1,1,1 |
1190 | +access_stock_truck_line_stock,stock.truck.line all,model_stock_truck_line,stock.group_stock_user,1,1,1,1 |
1191 | +access_stock_truck_line_purchase,stock.truck.line all,model_stock_truck_line,purchase.group_purchase_user,1,1,1,1 |
1192 | |
1193 | === added file 'pallet_delivery/stock.py' |
1194 | --- pallet_delivery/stock.py 1970-01-01 00:00:00 +0000 |
1195 | +++ pallet_delivery/stock.py 2014-08-27 19:22:25 +0000 |
1196 | @@ -0,0 +1,310 @@ |
1197 | +# -*- coding: utf-8 -*- |
1198 | +############################################################################## |
1199 | +# |
1200 | +# OpenERP, Open Source Management Solution |
1201 | +# Copyright (C) 2013 Savoir-faire Linux (<http://www.savoirfairelinux.com>). |
1202 | +# |
1203 | +# This program is free software: you can redistribute it and/or modify |
1204 | +# it under the terms of the GNU Affero General Public License as |
1205 | +# published by the Free Software Foundation, either version 3 of the |
1206 | +# License, or (at your option) any later version. |
1207 | +# |
1208 | +# This program is distributed in the hope that it will be useful, |
1209 | +# but WITHOUT ANY WARRANTY; without even the implied warranty of |
1210 | +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
1211 | +# GNU Affero General Public License for more details. |
1212 | +# |
1213 | +# You should have received a copy of the GNU Affero General Public License |
1214 | +# along with this program. If not, see <http://www.gnu.org/licenses/>. |
1215 | +# |
1216 | +############################################################################## |
1217 | + |
1218 | +from collections import defaultdict |
1219 | +from openerp.tools.translate import _ |
1220 | +from openerp.osv import orm, fields |
1221 | + |
1222 | +def group(lst): |
1223 | + """Saner group function than the one found in itertools |
1224 | + |
1225 | + This one mimics Haskell's group from Data.List: |
1226 | + group :: Eq a => [a] -> [[a]] |
1227 | + """ |
1228 | + |
1229 | + if not lst: |
1230 | + return [] |
1231 | + |
1232 | + res = [] |
1233 | + current = lst[0] |
1234 | + |
1235 | + grp = [] |
1236 | + for x in lst: |
1237 | + if x != current: |
1238 | + res.append(grp) |
1239 | + grp = [] |
1240 | + grp.append(x) |
1241 | + current = x |
1242 | + |
1243 | + if grp: |
1244 | + res.append(grp) |
1245 | + |
1246 | + return res |
1247 | + |
1248 | + |
1249 | +class stock_move(orm.Model): |
1250 | + |
1251 | + _inherit = 'stock.move' |
1252 | + |
1253 | + def _find_hidden(self, cr, uid, ids, context=None): |
1254 | + po_pool = self.pool.get("purchase.order") |
1255 | + hidden_id = po_pool.search(cr, uid, [('hidden', '=', True)], context=context)[0] |
1256 | + return po_pool.browse(cr, uid, hidden_id, context) |
1257 | + |
1258 | + @staticmethod |
1259 | + def _unique_line(seq): |
1260 | + seen = set() |
1261 | + seen_add = seen.add |
1262 | + return [ x for x in seq if x not in seen and not seen_add(x)] |
1263 | + |
1264 | + @staticmethod |
1265 | + def _get_line_name(line, crates=None, force_total_qty=False): |
1266 | + available = None |
1267 | + nice = '%s' % line.product_id.name |
1268 | + incoming_crates = line.product_qty |
1269 | + if crates: |
1270 | + # Incoming crates |
1271 | + available = max(0, incoming_crates - crates[line.id]) |
1272 | + elif force_total_qty: |
1273 | + available = incoming_crates |
1274 | + |
1275 | + nice += " / %s" % line.prodlot_id.name |
1276 | + |
1277 | + if available is not None: |
1278 | + nice += " (%d)" % available |
1279 | + |
1280 | + return nice, available |
1281 | + |
1282 | + def name_get(self, cr, uid, ids, context=None): |
1283 | + if context is None: |
1284 | + context = {} |
1285 | + |
1286 | + if isinstance(ids, (int, long)): |
1287 | + ids = [ids] |
1288 | + |
1289 | + stl_pool = self.pool.get('stock.truck.line') |
1290 | + spi_pool = self.pool.get('stock.picking.in') |
1291 | + # Out from selection; display name |
1292 | + |
1293 | + #hidden = self._find_hidden(cr, uid, ids, context=context) |
1294 | + res = [] |
1295 | + if not context.has_key('nice'): |
1296 | + for line in self.browse(cr, uid, ids, context=context): |
1297 | + name, available = self._get_line_name(line) |
1298 | + res.append((line.id, name)) |
1299 | + |
1300 | + # Add special 'not ours' line |
1301 | + #res.append((hidden.id, hidden.name)) |
1302 | + return res |
1303 | + |
1304 | + # Doing a selection |
1305 | + # Add special 'not ours' line |
1306 | + #res.append((hidden.id, hidden.name)) |
1307 | + |
1308 | + # Retrieve entered form data |
1309 | + parent = context['parent'] |
1310 | + all_pallets = parent['left_pallet_ids'] + parent['right_pallet_ids'] |
1311 | + po_ids = parent['purchase_order_ids'][0][2] |
1312 | + |
1313 | + # find list of stock picking in |
1314 | + spi_ids = spi_pool.search(cr, uid, [('purchase_id', '=', po_ids)], |
1315 | + context=context) |
1316 | + |
1317 | + # Build crate structure |
1318 | + crates = defaultdict(lambda: 0) |
1319 | + for pallet_struct in all_pallets: |
1320 | + if pallet_struct[0] == 4: |
1321 | + st_line = stl_pool.browse(cr, uid, pallet_struct[1], |
1322 | + context=context) |
1323 | + crates[st_line.pallet.id] += st_line.crates |
1324 | + else: |
1325 | + fields = pallet_struct[2] |
1326 | + if fields and 'pallet' in fields: |
1327 | + crates[fields['pallet']] += fields['crates'] |
1328 | + |
1329 | + spi_lines = spi_pool.browse(cr, uid, spi_ids, context=context) |
1330 | + all_lines = [line for lines in spi_lines for line in lines.move_lines |
1331 | + if line.state == "assigned"] |
1332 | + move_line = self._unique_line(all_lines) |
1333 | + |
1334 | + # Prettify data to be displayed |
1335 | + for line in move_line: |
1336 | + force_total_qty = not crates |
1337 | + name, available = self._get_line_name(line, crates=crates, |
1338 | + force_total_qty=force_total_qty) |
1339 | + if available: |
1340 | + res.append((line.id, name)) |
1341 | + |
1342 | + return res |
1343 | + |
1344 | + |
1345 | +class purchase_order(orm.Model): |
1346 | + |
1347 | + _inherit = 'purchase.order' |
1348 | + |
1349 | + def _assigned(self, cr, uid, obj, name, args, context=None): |
1350 | + '''Domain filter on corresponding entries in stock.picking where state is assigned''' |
1351 | + |
1352 | + if context is None: |
1353 | + context = {} |
1354 | + |
1355 | + picking_pool = self.pool.get('stock.picking') |
1356 | + ids = picking_pool.search(cr, uid, [('state', '=', 'assigned')], context=context) |
1357 | + po_ids = [po.purchase_id.id for po in picking_pool.browse(cr, uid, ids, context=context)] |
1358 | + |
1359 | + return [('id', 'in', po_ids)] |
1360 | + |
1361 | + _columns = { |
1362 | + 'hidden': fields.boolean('Hidden'), |
1363 | + 'stock_truck_ids': fields.many2many( |
1364 | + 'stock.truck', 'truck_order_rel', 'order_id', 'truck_id', 'Trucks'), |
1365 | + 'assigned': fields.function(lambda **x: True, fnct_search=_assigned, type='boolean', method=True), |
1366 | + } |
1367 | + |
1368 | + |
1369 | +class stock_truck_line(orm.Model): |
1370 | + |
1371 | + _name = 'stock.truck.line' |
1372 | + _description = 'A single pallet shipped in an incoming truck' |
1373 | + |
1374 | + _columns = { |
1375 | + 'name': fields.char('Name', size=64), |
1376 | + 'left_id': fields.many2one('stock.truck', 'Truck'), |
1377 | + 'right_id': fields.many2one('stock.truck', 'Truck'), |
1378 | + 'pallet': fields.many2one('stock.move', 'Pallet', required=True), |
1379 | + 'crates': fields.integer('Crates', required=True), |
1380 | + } |
1381 | + |
1382 | + |
1383 | +class stock_truck(orm.Model): |
1384 | + |
1385 | + _name = 'stock.truck' |
1386 | + _description = 'Incoming truck' |
1387 | + |
1388 | + def onchange_arrival(self, cr, uid, ids, arrival, context=None): |
1389 | + '''Force seconds to zero''' |
1390 | + |
1391 | + arrival = arrival[:-2] + '00' |
1392 | + |
1393 | + return {'value': {'arrival': arrival}} |
1394 | + |
1395 | + def action_done(self, cr, uid, ids, context=None): |
1396 | + if context is None: |
1397 | + context = {} |
1398 | + |
1399 | + truck = self.browse(cr, uid, ids, context=context)[0] |
1400 | + |
1401 | + # Build a dictionary of: |
1402 | + # - key: Purchase Order |
1403 | + # - value: a dictionary of: |
1404 | + # - key: Lot Number |
1405 | + # - value: tuple of |
1406 | + # - Purchase Order Line |
1407 | + # - Crate count |
1408 | + products = defaultdict(dict) |
1409 | + |
1410 | + def _process_pallets(column): |
1411 | + for line in column: |
1412 | + pallet = line.pallet |
1413 | + pi = pallet.picking_id |
1414 | + po = pallet.purchase_line_id.order_id |
1415 | + lot = pallet.prodlot_id if pallet.prodlot_id else None |
1416 | + # Skip over fake 'not ours' line |
1417 | + if po and po.hidden: |
1418 | + continue |
1419 | + |
1420 | + if not products[pi.id].has_key(lot): |
1421 | + products[pi.id][lot] = (pallet, 0) |
1422 | + |
1423 | + lot_product = products[pi.id][lot] |
1424 | + count = lot_product[1] |
1425 | + products[pi.id][lot] = (lot_product[0], count + line.crates) |
1426 | + |
1427 | + _process_pallets(truck.left_pallet_ids) |
1428 | + _process_pallets(truck.right_pallet_ids) |
1429 | + |
1430 | + # Make the calls to the Pickings stock moves |
1431 | + |
1432 | + picking_pool = self.pool.get('stock.picking') |
1433 | + |
1434 | + for po in truck.purchase_order_ids: |
1435 | + pi = None |
1436 | + pi_ids = picking_pool.search( |
1437 | + cr, uid, |
1438 | + ['&', ('purchase_id', '=', po.id), ('state', '=', 'assigned')], |
1439 | + context=context) |
1440 | + if pi_ids: |
1441 | + # take the last one |
1442 | + pi = pi_ids[-1] |
1443 | + |
1444 | + if not pi or not products.has_key(pi): |
1445 | + # Purchase Order was added to the list, but there are not |
1446 | + # pallets pertaining to that PO. |
1447 | + continue |
1448 | + |
1449 | + partial_data = {'delivery_date': truck.arrival} |
1450 | + |
1451 | + |
1452 | + for move_line, count in products[pi].values(): |
1453 | + # Skip over the fake 'not ours' line |
1454 | + po_line = move_line.purchase_line_id |
1455 | + if po_line and po_line.order_id.hidden: |
1456 | + continue |
1457 | + |
1458 | + partial_data['move%s' % (move_line.id, )] = { |
1459 | + 'product_id': move_line.product_id.id, |
1460 | + 'product_qty': count, |
1461 | + 'product_uom': 1, |
1462 | + 'prodlot_id': move_line.prodlot_id.id, |
1463 | + } |
1464 | + |
1465 | + picking_pool.do_partial(cr, uid, [pi], partial_data, context=context) |
1466 | + |
1467 | + self.write(cr, uid, ids, {'state': 'done'}) |
1468 | + |
1469 | + return True |
1470 | + |
1471 | + @staticmethod |
1472 | + def validate_temperature(cr, uid, ids, temperature, field_name, |
1473 | + context=None): |
1474 | + try: |
1475 | + float(temperature) |
1476 | + except ValueError: |
1477 | + warning = {'title': _('Input Error !'), |
1478 | + 'message': _('Please enter real numbers.')} |
1479 | + return {'value': {field_name: ""}, 'warning': warning} |
1480 | + return True |
1481 | + |
1482 | + _columns = { |
1483 | + # Overhead |
1484 | + 'name': fields.char('Name', size=64), |
1485 | + 'state': fields.selection([ |
1486 | + ('draft', 'Draft'), |
1487 | + ('done', 'Done'), |
1488 | + ], 'State', readonly=True, select=True, track_visibility='onchange'), |
1489 | + |
1490 | + # Display |
1491 | + 'front_temperature': fields.char('Front Temperature', required=True), |
1492 | + 'back_temperature': fields.char('Back Temperature', required=True), |
1493 | + 'truck_sn': fields.char('Truck S/N', size=64), |
1494 | + 'supplier': fields.many2one('res.partner', 'Supplier', required=True), |
1495 | + 'arrival': fields.datetime('Date of Arrival', required=True), |
1496 | + 'purchase_order_ids': fields.many2many( |
1497 | + 'purchase.order', 'truck_order_rel', 'truck_id', 'order_id', 'Purchase Orders'), |
1498 | + 'left_pallet_ids': fields.one2many('stock.truck.line', 'left_id', 'Pallets'), |
1499 | + 'right_pallet_ids': fields.one2many('stock.truck.line', 'right_id', 'Pallets'), |
1500 | + } |
1501 | + |
1502 | + _defaults = { |
1503 | + 'name': lambda self, cr, uid, ctx={}: self.pool.get('ir.sequence').get(cr, uid, 'stock.truck'), |
1504 | + 'state': 'draft', |
1505 | + 'front_temperature': None, |
1506 | + } |
1507 | |
1508 | === added file 'pallet_delivery/stock_workflow.xml' |
1509 | --- pallet_delivery/stock_workflow.xml 1970-01-01 00:00:00 +0000 |
1510 | +++ pallet_delivery/stock_workflow.xml 2014-08-27 19:22:25 +0000 |
1511 | @@ -0,0 +1,30 @@ |
1512 | +<?xml version="1.0" encoding="utf-8"?> |
1513 | +<openerp> |
1514 | + <data> |
1515 | + <record id="wkf_stock_truck" model="workflow"> |
1516 | + <field name="name">stock.truck</field> |
1517 | + <field name="osv">stock.truck</field> |
1518 | + <field name="on_create">True</field> |
1519 | + </record> |
1520 | + |
1521 | + <record id="act_draft" model="workflow.activity"> |
1522 | + <field name="wkf_id" ref="wkf_stock_truck" /> |
1523 | + <field name="name">draft</field> |
1524 | + <field name="flow_start">True</field> |
1525 | + </record> |
1526 | + |
1527 | + <record id="act_done" model="workflow.activity"> |
1528 | + <field name="wkf_id" ref="wkf_stock_truck" /> |
1529 | + <field name="name">done</field> |
1530 | + <field name="flow_stop">True</field> |
1531 | + <field name="kind">function</field> |
1532 | + <field name="action">action_done()</field> |
1533 | + </record> |
1534 | + |
1535 | + <record id="trans_draft_done" model="workflow.transition"> |
1536 | + <field name="act_from" ref="act_draft" /> |
1537 | + <field name="act_to" ref="act_done" /> |
1538 | + <field name="signal">button_done</field> |
1539 | + </record> |
1540 | + </data> |
1541 | +</openerp> |
1542 | |
1543 | === added directory 'partner_discount' |
1544 | === added file 'partner_discount/__init__.py' |
1545 | --- partner_discount/__init__.py 1970-01-01 00:00:00 +0000 |
1546 | +++ partner_discount/__init__.py 2014-08-27 19:22:25 +0000 |
1547 | @@ -0,0 +1,25 @@ |
1548 | +# -*- encoding: utf-8 -*- |
1549 | +############################################################################### |
1550 | +# |
1551 | +# OpenERP, Open Source Management Solution |
1552 | +# This module copyright (C) 2013 Savoir-faire Linux |
1553 | +# (<http://www.savoirfairelinux.com>). |
1554 | +# |
1555 | +# This program is free software: you can redistribute it and/or modify |
1556 | +# it under the terms of the GNU Affero General Public License as |
1557 | +# published by the Free Software Foundation, either version 3 of the |
1558 | +# License, or (at your option) any later version. |
1559 | +# |
1560 | +# This program is distributed in the hope that it will be useful, |
1561 | +# but WITHOUT ANY WARRANTY; without even the implied warranty of |
1562 | +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
1563 | +# GNU Affero General Public License for more details. |
1564 | +# |
1565 | +# You should have received a copy of the GNU Affero General Public License |
1566 | +# along with this program. If not, see <http://www.gnu.org/licenses/>. |
1567 | +# |
1568 | +############################################################################### |
1569 | + |
1570 | +import res_partner |
1571 | + |
1572 | +# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4: |
1573 | |
1574 | === added file 'partner_discount/__openerp__.py' |
1575 | --- partner_discount/__openerp__.py 1970-01-01 00:00:00 +0000 |
1576 | +++ partner_discount/__openerp__.py 2014-08-27 19:22:25 +0000 |
1577 | @@ -0,0 +1,41 @@ |
1578 | +# -*- encoding: utf-8 -*- |
1579 | +############################################################################### |
1580 | +# |
1581 | +# OpenERP, Open Source Management Solution |
1582 | +# This module copyright (C) 2013 Savoir-faire Linux |
1583 | +# (<http://www.savoirfairelinux.com>). |
1584 | +# |
1585 | +# This program is free software: you can redistribute it and/or modify |
1586 | +# it under the terms of the GNU Affero General Public License as |
1587 | +# published by the Free Software Foundation, either version 3 of the |
1588 | +# License, or (at your option) any later version. |
1589 | +# |
1590 | +# This program is distributed in the hope that it will be useful, |
1591 | +# but WITHOUT ANY WARRANTY; without even the implied warranty of |
1592 | +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
1593 | +# GNU Affero General Public License for more details. |
1594 | +# |
1595 | +# You should have received a copy of the GNU Affero General Public License |
1596 | +# along with this program. If not, see <http://www.gnu.org/licenses/>. |
1597 | +# |
1598 | +############################################################################### |
1599 | + |
1600 | +{ |
1601 | + 'name': 'Partner Discount', |
1602 | + 'version': '1.0', |
1603 | + 'author': 'Savoir-faire Linux', |
1604 | + 'maintainer': 'Savoir-faire Linux', |
1605 | + 'website': 'http://www.savoirfairelinux.com', |
1606 | + 'category': 'sale', |
1607 | + 'description': """\ |
1608 | +Adds a discount percentage to the partner form. |
1609 | +""", |
1610 | + 'depends': [], |
1611 | + 'data': ['res_partner_view.xml'], |
1612 | + 'demo': [], |
1613 | + 'test': [], |
1614 | + 'installable': True, |
1615 | + 'active': False, |
1616 | +} |
1617 | + |
1618 | +# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4: |
1619 | |
1620 | === added directory 'partner_discount/i18n' |
1621 | === added file 'partner_discount/i18n/fr.po' |
1622 | --- partner_discount/i18n/fr.po 1970-01-01 00:00:00 +0000 |
1623 | +++ partner_discount/i18n/fr.po 2014-08-27 19:22:25 +0000 |
1624 | @@ -0,0 +1,36 @@ |
1625 | +# Translation of OpenERP Server. |
1626 | +# This file contains the translation of the following modules: |
1627 | +# * partner_discount |
1628 | +# |
1629 | +msgid "" |
1630 | +msgstr "" |
1631 | +"Project-Id-Version: OpenERP Server 7.0\n" |
1632 | +"Report-Msgid-Bugs-To: \n" |
1633 | +"POT-Creation-Date: 2013-11-01 15:41+0000\n" |
1634 | +"PO-Revision-Date: 2013-11-01 15:41+0000\n" |
1635 | +"Last-Translator: <>\n" |
1636 | +"Language-Team: \n" |
1637 | +"MIME-Version: 1.0\n" |
1638 | +"Content-Type: text/plain; charset=UTF-8\n" |
1639 | +"Content-Transfer-Encoding: \n" |
1640 | +"Plural-Forms: \n" |
1641 | + |
1642 | +#. module: partner_discount |
1643 | +#: field:res.partner,discount:0 |
1644 | +msgid "Discount" |
1645 | +msgstr "Ristourne" |
1646 | + |
1647 | +#. module: partner_discount |
1648 | +#: help:res.partner,discount:0 |
1649 | +msgid "For percent enter a ratio between 0-1." |
1650 | +msgstr "Pour être en pourcentage, saisir une valeur entre 0 et 1." |
1651 | + |
1652 | +#. module: partner_discount |
1653 | +#: view:res.partner:0 |
1654 | +msgid "Sales & Purchases" |
1655 | +msgstr "Achats-Ventes" |
1656 | + |
1657 | +#. module: partner_discount |
1658 | +#: model:ir.model,name:partner_discount.model_res_partner |
1659 | +msgid "Partner" |
1660 | +msgstr "Partenaire" |
1661 | |
1662 | === added file 'partner_discount/i18n/partner_discount.pot' |
1663 | --- partner_discount/i18n/partner_discount.pot 1970-01-01 00:00:00 +0000 |
1664 | +++ partner_discount/i18n/partner_discount.pot 2014-08-27 19:22:25 +0000 |
1665 | @@ -0,0 +1,36 @@ |
1666 | +# Translation of OpenERP Server. |
1667 | +# This file contains the translation of the following modules: |
1668 | +# * partner_discount |
1669 | +# |
1670 | +msgid "" |
1671 | +msgstr "" |
1672 | +"Project-Id-Version: OpenERP Server 7.0\n" |
1673 | +"Report-Msgid-Bugs-To: \n" |
1674 | +"POT-Creation-Date: 2013-11-01 15:41+0000\n" |
1675 | +"PO-Revision-Date: 2013-11-01 15:41+0000\n" |
1676 | +"Last-Translator: <>\n" |
1677 | +"Language-Team: \n" |
1678 | +"MIME-Version: 1.0\n" |
1679 | +"Content-Type: text/plain; charset=UTF-8\n" |
1680 | +"Content-Transfer-Encoding: \n" |
1681 | +"Plural-Forms: \n" |
1682 | + |
1683 | +#. module: partner_discount |
1684 | +#: field:res.partner,discount:0 |
1685 | +msgid "Discount" |
1686 | +msgstr "" |
1687 | + |
1688 | +#. module: partner_discount |
1689 | +#: help:res.partner,discount:0 |
1690 | +msgid "For percent enter a ratio between 0-1." |
1691 | +msgstr "" |
1692 | + |
1693 | +#. module: partner_discount |
1694 | +#: view:res.partner:0 |
1695 | +msgid "Sales & Purchases" |
1696 | +msgstr "" |
1697 | + |
1698 | +#. module: partner_discount |
1699 | +#: model:ir.model,name:partner_discount.model_res_partner |
1700 | +msgid "Partner" |
1701 | +msgstr "" |
1702 | |
1703 | === added file 'partner_discount/res_partner.py' |
1704 | --- partner_discount/res_partner.py 1970-01-01 00:00:00 +0000 |
1705 | +++ partner_discount/res_partner.py 2014-08-27 19:22:25 +0000 |
1706 | @@ -0,0 +1,36 @@ |
1707 | +# -*- encoding: utf-8 -*- |
1708 | +############################################################################### |
1709 | +# |
1710 | +# OpenERP, Open Source Management Solution |
1711 | +# This module copyright (C) 2013 Savoir-faire Linux |
1712 | +# (<http://www.savoirfairelinux.com>). |
1713 | +# |
1714 | +# This program is free software: you can redistribute it and/or modify |
1715 | +# it under the terms of the GNU Affero General Public License as |
1716 | +# published by the Free Software Foundation, either version 3 of the |
1717 | +# License, or (at your option) any later version. |
1718 | +# |
1719 | +# This program is distributed in the hope that it will be useful, |
1720 | +# but WITHOUT ANY WARRANTY; without even the implied warranty of |
1721 | +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
1722 | +# GNU Affero General Public License for more details. |
1723 | +# |
1724 | +# You should have received a copy of the GNU Affero General Public License |
1725 | +# along with this program. If not, see <http://www.gnu.org/licenses/>. |
1726 | +# |
1727 | +############################################################################### |
1728 | + |
1729 | +from openerp.osv import orm, fields |
1730 | + |
1731 | + |
1732 | +class res_partner(orm.Model): |
1733 | + """ Inherits partner and adds discount percentage """ |
1734 | + _inherit = 'res.partner' |
1735 | + _columns = { |
1736 | + 'discount': fields.float('Discount', digits=(1, 4), |
1737 | + help="For percent enter a ratio between 0-1."), |
1738 | + } |
1739 | + _defaults = {'discount': 0.0} |
1740 | + |
1741 | + |
1742 | +# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4: |
1743 | |
1744 | === added file 'partner_discount/res_partner_view.xml' |
1745 | --- partner_discount/res_partner_view.xml 1970-01-01 00:00:00 +0000 |
1746 | +++ partner_discount/res_partner_view.xml 2014-08-27 19:22:25 +0000 |
1747 | @@ -0,0 +1,19 @@ |
1748 | +<?xml version = "1.0" encoding="utf-8"?> |
1749 | +<openerp> |
1750 | + <data> |
1751 | + <record id="view_partner_discount_form" model="ir.ui.view"> |
1752 | + <field name="name">res.partner.discount.form.inherit</field> |
1753 | + <field name="model">res.partner</field> |
1754 | + <field name="inherit_id" ref="base.view_partner_form"/> |
1755 | + <field name="arch" type="xml"> |
1756 | + <page string="Sales & Purchases"> |
1757 | + <group> |
1758 | + <group> |
1759 | + <field name="discount"/> |
1760 | + </group> |
1761 | + </group> |
1762 | + </page> |
1763 | + </field> |
1764 | + </record> |
1765 | + </data> |
1766 | +</openerp> |
1767 | |
1768 | === added directory 'produce_details' |
1769 | === added file 'produce_details/__init__.py' |
1770 | --- produce_details/__init__.py 1970-01-01 00:00:00 +0000 |
1771 | +++ produce_details/__init__.py 2014-08-27 19:22:25 +0000 |
1772 | @@ -0,0 +1,22 @@ |
1773 | +# -*- coding: utf-8 -*- |
1774 | +############################################################################## |
1775 | +# |
1776 | +# OpenERP, Open Source Management Solution |
1777 | +# Copyright (C) 2013 Savoir-faire Linux (<http://www.savoirfairelinux.com>). |
1778 | +# |
1779 | +# This program is free software: you can redistribute it and/or modify |
1780 | +# it under the terms of the GNU Affero General Public License as |
1781 | +# published by the Free Software Foundation, either version 3 of the |
1782 | +# License, or (at your option) any later version. |
1783 | +# |
1784 | +# This program is distributed in the hope that it will be useful, |
1785 | +# but WITHOUT ANY WARRANTY; without even the implied warranty of |
1786 | +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
1787 | +# GNU Affero General Public License for more details. |
1788 | +# |
1789 | +# You should have received a copy of the GNU Affero General Public License |
1790 | +# along with this program. If not, see <http://www.gnu.org/licenses/>. |
1791 | +# |
1792 | +############################################################################## |
1793 | + |
1794 | +import product |
1795 | |
1796 | === added file 'produce_details/__openerp__.py' |
1797 | --- produce_details/__openerp__.py 1970-01-01 00:00:00 +0000 |
1798 | +++ produce_details/__openerp__.py 2014-08-27 19:22:25 +0000 |
1799 | @@ -0,0 +1,49 @@ |
1800 | +# -*- coding: utf-8 -*- |
1801 | +############################################################################## |
1802 | +# |
1803 | +# OpenERP, Open Source Management Solution |
1804 | +# Copyright (C) 2013 Savoir-faire Linux (<http://www.savoirfairelinux.com>). |
1805 | +# |
1806 | +# This program is free software: you can redistribute it and/or modify |
1807 | +# it under the terms of the GNU Affero General Public License as |
1808 | +# published by the Free Software Foundation, either version 3 of the |
1809 | +# License, or (at your option) any later version. |
1810 | +# |
1811 | +# This program is distributed in the hope that it will be useful, |
1812 | +# but WITHOUT ANY WARRANTY; without even the implied warranty of |
1813 | +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
1814 | +# GNU Affero General Public License for more details. |
1815 | +# |
1816 | +# You should have received a copy of the GNU Affero General Public License |
1817 | +# along with this program. If not, see <http://www.gnu.org/licenses/>. |
1818 | +# |
1819 | +############################################################################## |
1820 | + |
1821 | +{ |
1822 | + 'name': 'Produce Details', |
1823 | + 'version': '0.1', |
1824 | + 'author': 'Savoir-faire Linux', |
1825 | + 'maintainer': 'Savoir-faire Linux', |
1826 | + 'website': 'http://www.savoirfairelinux.com', |
1827 | + 'category': 'product', |
1828 | + 'description': """ |
1829 | +Agricultural produce details |
1830 | +============================ |
1831 | + |
1832 | +This module adds four descriptive fields for produce-related products, namely: |
1833 | + |
1834 | +* A variety (e.g. Haden) |
1835 | +* An origin (Brazil) |
1836 | +* Conditioning weight (10 kg) |
1837 | +* A size category (#12) |
1838 | +* PLU code (4216) |
1839 | +""", |
1840 | + 'depends': ['base', 'purchase'], |
1841 | + 'data': [ |
1842 | + 'produce_details_view.xml', |
1843 | + ], |
1844 | + 'demo': [], |
1845 | + 'test': [], |
1846 | + 'installable': True, |
1847 | + 'active': False, |
1848 | +} |
1849 | |
1850 | === added directory 'produce_details/i18n' |
1851 | === added file 'produce_details/i18n/fr.po' |
1852 | --- produce_details/i18n/fr.po 1970-01-01 00:00:00 +0000 |
1853 | +++ produce_details/i18n/fr.po 2014-08-27 19:22:25 +0000 |
1854 | @@ -0,0 +1,41 @@ |
1855 | +# Translation of OpenERP Server. |
1856 | +# This file contains the translation of the following modules: |
1857 | +# * produce_details |
1858 | +# |
1859 | +msgid "" |
1860 | +msgstr "" |
1861 | +"Project-Id-Version: OpenERP Server 7.0-20130811-231021\n" |
1862 | +"Report-Msgid-Bugs-To: \n" |
1863 | +"POT-Creation-Date: 2013-09-18 14:22+0000\n" |
1864 | +"PO-Revision-Date: 2013-09-18 14:22+0000\n" |
1865 | +"Last-Translator: Alexandre Boily <alexandre.boily@savoirfairelinux.com>\n" |
1866 | +"Language-Team: Savoir-faire Linux\n" |
1867 | +"MIME-Version: 1.0\n" |
1868 | +"Content-Type: text/plain; charset=UTF-8\n" |
1869 | +"Content-Transfer-Encoding: \n" |
1870 | +"Plural-Forms: \n" |
1871 | + |
1872 | +#. module: produce_details |
1873 | +#: field:product.product,origin:0 |
1874 | +msgid "Origin" |
1875 | +msgstr "Origine" |
1876 | + |
1877 | +#. module: produce_details |
1878 | +#: model:ir.model,name:produce_details.model_product_product |
1879 | +msgid "Product" |
1880 | +msgstr "Produit" |
1881 | + |
1882 | +#. module: produce_details |
1883 | +#: field:product.product,variety:0 |
1884 | +msgid "Variety" |
1885 | +msgstr "Variété" |
1886 | + |
1887 | +#. module: produce_details |
1888 | +#: field:product.product,cond_weight:0 |
1889 | +msgid "Conditioning weight" |
1890 | +msgstr "Poids de conditionnement" |
1891 | + |
1892 | +#. module: produce_details |
1893 | +#: field:product.product,size_category:0 |
1894 | +msgid "Size" |
1895 | +msgstr "Taille" |
1896 | |
1897 | === added file 'produce_details/i18n/produce_details.pot' |
1898 | --- produce_details/i18n/produce_details.pot 1970-01-01 00:00:00 +0000 |
1899 | +++ produce_details/i18n/produce_details.pot 2014-08-27 19:22:25 +0000 |
1900 | @@ -0,0 +1,42 @@ |
1901 | +# Translation of OpenERP Server. |
1902 | +# This file contains the translation of the following modules: |
1903 | +# * produce_details |
1904 | +# |
1905 | +msgid "" |
1906 | +msgstr "" |
1907 | +"Project-Id-Version: OpenERP Server 7.0-20130811-231021\n" |
1908 | +"Report-Msgid-Bugs-To: \n" |
1909 | +"POT-Creation-Date: 2013-09-18 14:22+0000\n" |
1910 | +"PO-Revision-Date: 2013-09-18 14:22+0000\n" |
1911 | +"Last-Translator: <>\n" |
1912 | +"Language-Team: \n" |
1913 | +"MIME-Version: 1.0\n" |
1914 | +"Content-Type: text/plain; charset=UTF-8\n" |
1915 | +"Content-Transfer-Encoding: \n" |
1916 | +"Plural-Forms: \n" |
1917 | + |
1918 | +#. module: produce_details |
1919 | +#: field:product.product,origin:0 |
1920 | +msgid "Origin" |
1921 | +msgstr "" |
1922 | + |
1923 | +#. module: produce_details |
1924 | +#: model:ir.model,name:produce_details.model_product_product |
1925 | +msgid "Product" |
1926 | +msgstr "" |
1927 | + |
1928 | +#. module: produce_details |
1929 | +#: field:product.product,variety:0 |
1930 | +msgid "Variety" |
1931 | +msgstr "" |
1932 | + |
1933 | +#. module: produce_details |
1934 | +#: field:product.product,cond_weight:0 |
1935 | +msgid "Conditioning weight" |
1936 | +msgstr "" |
1937 | + |
1938 | +#. module: produce_details |
1939 | +#: field:product.product,size_category:0 |
1940 | +msgid "Size" |
1941 | +msgstr "" |
1942 | + |
1943 | |
1944 | === added file 'produce_details/produce_details_view.xml' |
1945 | --- produce_details/produce_details_view.xml 1970-01-01 00:00:00 +0000 |
1946 | +++ produce_details/produce_details_view.xml 2014-08-27 19:22:25 +0000 |
1947 | @@ -0,0 +1,34 @@ |
1948 | +<?xml version="1.0" encoding="utf-8" ?> |
1949 | +<openerp> |
1950 | + <data> |
1951 | + <record id="produce_details_form" model="ir.ui.view"> |
1952 | + <field name="name">product.product.produce.details.form</field> |
1953 | + <field name="model">product.product</field> |
1954 | + <field name="inherit_id" ref="product.product_normal_form_view" /> |
1955 | + <field name="arch" type="xml"> |
1956 | + <field name="description" position="before"> |
1957 | + <group> |
1958 | + <group> |
1959 | + <field name="variety" /> |
1960 | + <field name="origin" /> |
1961 | + </group> |
1962 | + |
1963 | + <group> |
1964 | + <field name="cond_weight" /> |
1965 | + <field name="size_category" /> |
1966 | + </group> |
1967 | + </group> |
1968 | + <group> |
1969 | + <group> |
1970 | + <label for="plu1"/> |
1971 | + <field name="plu1" nolabel="1" /> |
1972 | + <div /> |
1973 | + <field name="plu2" nolabel="1" /> |
1974 | + </group> |
1975 | + <group/> |
1976 | + </group> |
1977 | + </field> |
1978 | + </field> |
1979 | + </record> |
1980 | + </data> |
1981 | +</openerp> |
1982 | |
1983 | === added file 'produce_details/product.py' |
1984 | --- produce_details/product.py 1970-01-01 00:00:00 +0000 |
1985 | +++ produce_details/product.py 2014-08-27 19:22:25 +0000 |
1986 | @@ -0,0 +1,36 @@ |
1987 | +# -*- coding: utf-8 -*- |
1988 | +############################################################################## |
1989 | +# |
1990 | +# OpenERP, Open Source Management Solution |
1991 | +# Copyright (C) 2013 Savoir-faire Linux (<http://www.savoirfairelinux.com>). |
1992 | +# |
1993 | +# This program is free software: you can redistribute it and/or modify |
1994 | +# it under the terms of the GNU Affero General Public License as |
1995 | +# published by the Free Software Foundation, either version 3 of the |
1996 | +# License, or (at your option) any later version. |
1997 | +# |
1998 | +# This program is distributed in the hope that it will be useful, |
1999 | +# but WITHOUT ANY WARRANTY; without even the implied warranty of |
2000 | +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
2001 | +# GNU Affero General Public License for more details. |
2002 | +# |
2003 | +# You should have received a copy of the GNU Affero General Public License |
2004 | +# along with this program. If not, see <http://www.gnu.org/licenses/>. |
2005 | +# |
2006 | +############################################################################## |
2007 | + |
2008 | +import openerp.addons.decimal_precision as dp |
2009 | +from openerp.osv import orm, fields |
2010 | + |
2011 | +class product_product(orm.Model): |
2012 | + |
2013 | + _inherit = 'product.product' |
2014 | + |
2015 | + _columns = { |
2016 | + 'variety': fields.char('Variety', size=64), |
2017 | + 'origin': fields.many2one('res.country', 'Origin'), |
2018 | + 'cond_weight': fields.float('Conditioning weight', digits_compute=dp.get_precision('Stock Weight'), help='Conditioning weight in kg.'), |
2019 | + 'size_category': fields.char('Size', size=16), |
2020 | + 'plu1': fields.char('PLU', size=8), |
2021 | + 'plu2': fields.char('PLU2', size=8), |
2022 | + } |
2023 | |
2024 | === added directory 'product_reserve_forecast' |
2025 | === added file 'product_reserve_forecast/__init__.py' |
2026 | --- product_reserve_forecast/__init__.py 1970-01-01 00:00:00 +0000 |
2027 | +++ product_reserve_forecast/__init__.py 2014-08-27 19:22:25 +0000 |
2028 | @@ -0,0 +1,23 @@ |
2029 | +# -*- coding: utf-8 -*- |
2030 | +############################################################################## |
2031 | +# |
2032 | +# OpenERP, Open Source Management Solution |
2033 | +# Copyright (C) 2013 Savoir-faire Linux (<http://www.savoirfairelinux.com>). |
2034 | +# |
2035 | +# This program is free software: you can redistribute it and/or modify |
2036 | +# it under the terms of the GNU Affero General Public License as |
2037 | +# published by the Free Software Foundation, either version 3 of the |
2038 | +# License, or (at your option) any later version. |
2039 | +# |
2040 | +# This program is distributed in the hope that it will be useful, |
2041 | +# but WITHOUT ANY WARRANTY; without even the implied warranty of |
2042 | +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
2043 | +# GNU Affero General Public License for more details. |
2044 | +# |
2045 | +# You should have received a copy of the GNU Affero General Public License |
2046 | +# along with this program. If not, see <http://www.gnu.org/licenses/>. |
2047 | +# |
2048 | +############################################################################## |
2049 | + |
2050 | +import product |
2051 | +import sale_stock |
2052 | |
2053 | === added file 'product_reserve_forecast/__openerp__.py' |
2054 | --- product_reserve_forecast/__openerp__.py 1970-01-01 00:00:00 +0000 |
2055 | +++ product_reserve_forecast/__openerp__.py 2014-08-27 19:22:25 +0000 |
2056 | @@ -0,0 +1,44 @@ |
2057 | +# -*- coding: utf-8 -*- |
2058 | +############################################################################## |
2059 | +# |
2060 | +# OpenERP, Open Source Management Solution |
2061 | +# Copyright (C) 2013 Savoir-faire Linux (<http://www.savoirfairelinux.com>). |
2062 | +# |
2063 | +# This program is free software: you can redistribute it and/or modify |
2064 | +# it under the terms of the GNU Affero General Public License as |
2065 | +# published by the Free Software Foundation, either version 3 of the |
2066 | +# License, or (at your option) any later version. |
2067 | +# |
2068 | +# This program is distributed in the hope that it will be useful, |
2069 | +# but WITHOUT ANY WARRANTY; without even the implied warranty of |
2070 | +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
2071 | +# GNU Affero General Public License for more details. |
2072 | +# |
2073 | +# You should have received a copy of the GNU Affero General Public License |
2074 | +# along with this program. If not, see <http://www.gnu.org/licenses/>. |
2075 | +# |
2076 | +############################################################################## |
2077 | + |
2078 | +{ |
2079 | + 'name': 'Reserve Product Quantity on Forecast', |
2080 | + 'version': '0.1', |
2081 | + 'author': 'Savoir-faire Linux', |
2082 | + 'maintainer': 'Savoir-faire Linux', |
2083 | + 'website': 'http://www.savoirfairelinux.com', |
2084 | + 'category': 'product', |
2085 | + 'description': """ |
2086 | +Put aside an unsaleable quantity for a product |
2087 | +============================================== |
2088 | + |
2089 | +This reduces the forecasted quantity by a given amount. |
2090 | +""", |
2091 | + 'depends': ['base', 'product', 'sale', 'sale_stock', 'stock'], |
2092 | + 'data': [ |
2093 | + 'security/product_reserve_forecast_security.xml', |
2094 | + 'product_reserve_forecast_view.xml', |
2095 | + ], |
2096 | + 'demo': [], |
2097 | + 'test': [], |
2098 | + 'installable': True, |
2099 | + 'active': False, |
2100 | +} |
2101 | |
2102 | === added directory 'product_reserve_forecast/i18n' |
2103 | === added file 'product_reserve_forecast/i18n/fr.po' |
2104 | --- product_reserve_forecast/i18n/fr.po 1970-01-01 00:00:00 +0000 |
2105 | +++ product_reserve_forecast/i18n/fr.po 2014-08-27 19:22:25 +0000 |
2106 | @@ -0,0 +1,67 @@ |
2107 | +# Translation of OpenERP Server. |
2108 | +# This file contains the translation of the following modules: |
2109 | +# * product_reserve_forecast |
2110 | +# |
2111 | +msgid "" |
2112 | +msgstr "" |
2113 | +"Project-Id-Version: OpenERP Server 7.0-20130811-231021\n" |
2114 | +"Report-Msgid-Bugs-To: \n" |
2115 | +"POT-Creation-Date: 2013-09-26 11:42+0000\n" |
2116 | +"PO-Revision-Date: 2013-09-26 11:42+0000\n" |
2117 | +"Last-Translator: Alexandre Boily <alexandre.boily@savoirfairelinux.com>\n" |
2118 | +"Language-Team: Savoir-faire Linux\n" |
2119 | +"MIME-Version: 1.0\n" |
2120 | +"Content-Type: text/plain; charset=UTF-8\n" |
2121 | +"Content-Transfer-Encoding: \n" |
2122 | +"Plural-Forms: \n" |
2123 | + |
2124 | +#. module: product_reserve_forecast |
2125 | +#: field:product.product,virtual_clone:0 |
2126 | +msgid "Forecasted Quantity" |
2127 | +msgstr "Quantité prévue" |
2128 | + |
2129 | +#. module: product_reserve_forecast |
2130 | +#: model:ir.model,name:product_reserve_forecast.model_product_product |
2131 | +msgid "Product" |
2132 | +msgstr "Produit" |
2133 | + |
2134 | +#. module: product_reserve_forecast |
2135 | +#: code:addons/product_reserve_forecast/sale_stock.py:85 |
2136 | +#, python-format |
2137 | +msgid "Not enough stock ! : " |
2138 | +msgstr "Pas assez de stock: " |
2139 | + |
2140 | +#. module: product_reserve_forecast |
2141 | +#: code:addons/product_reserve_forecast/sale_stock.py:81 |
2142 | +#, python-format |
2143 | +msgid "You plan to sell %.2f %s but you only have %.2f %s available !\n" |
2144 | +"The real stock is %.2f %s. (without reservations)" |
2145 | +msgstr "Vous planifiez vendre %.2f %s, mais seulement %.2f %s sont disponibles. |
2146 | +La vraie quantité en stock est %.2f %s (sans réservations)." |
2147 | + |
2148 | +#. module: product_reserve_forecast |
2149 | +#: model:res.groups,name:product_reserve_forecast.group_product_reserve |
2150 | +msgid "Define product reserve quantity" |
2151 | +msgstr "Définir la quantié réservée sur un produit" |
2152 | + |
2153 | +#. module: product_reserve_forecast |
2154 | +#: code:addons/product_reserve_forecast/sale_stock.py:90 |
2155 | +#, python-format |
2156 | +msgid "Configuration Error!" |
2157 | +msgstr "Erreur de configuration!" |
2158 | + |
2159 | +#. module: product_reserve_forecast |
2160 | +#: field:product.product,reserved:0 |
2161 | +msgid "Reserved Quantity" |
2162 | +msgstr "Quantité réservée" |
2163 | + |
2164 | +#. module: product_reserve_forecast |
2165 | +#: model:ir.model,name:product_reserve_forecast.model_sale_order_line |
2166 | +msgid "Sales Order Line" |
2167 | +msgstr "Ligne de vente" |
2168 | + |
2169 | +#. module: product_reserve_forecast |
2170 | +#: model:res.groups,comment:product_reserve_forecast.group_product_reserve |
2171 | +msgid "Can see and set the per product reserve quantity." |
2172 | +msgstr "Peut voir et modifier la quantité réservée d'un produit." |
2173 | + |
2174 | |
2175 | === added file 'product_reserve_forecast/i18n/product_reserve_forecast.pot' |
2176 | --- product_reserve_forecast/i18n/product_reserve_forecast.pot 1970-01-01 00:00:00 +0000 |
2177 | +++ product_reserve_forecast/i18n/product_reserve_forecast.pot 2014-08-27 19:22:25 +0000 |
2178 | @@ -0,0 +1,66 @@ |
2179 | +# Translation of OpenERP Server. |
2180 | +# This file contains the translation of the following modules: |
2181 | +# * product_reserve_forecast |
2182 | +# |
2183 | +msgid "" |
2184 | +msgstr "" |
2185 | +"Project-Id-Version: OpenERP Server 7.0-20130811-231021\n" |
2186 | +"Report-Msgid-Bugs-To: \n" |
2187 | +"POT-Creation-Date: 2013-09-26 11:42+0000\n" |
2188 | +"PO-Revision-Date: 2013-09-26 11:42+0000\n" |
2189 | +"Last-Translator: <>\n" |
2190 | +"Language-Team: \n" |
2191 | +"MIME-Version: 1.0\n" |
2192 | +"Content-Type: text/plain; charset=UTF-8\n" |
2193 | +"Content-Transfer-Encoding: \n" |
2194 | +"Plural-Forms: \n" |
2195 | + |
2196 | +#. module: product_reserve_forecast |
2197 | +#: field:product.product,virtual_clone:0 |
2198 | +msgid "Forecasted Quantity" |
2199 | +msgstr "" |
2200 | + |
2201 | +#. module: product_reserve_forecast |
2202 | +#: model:ir.model,name:product_reserve_forecast.model_product_product |
2203 | +msgid "Product" |
2204 | +msgstr "" |
2205 | + |
2206 | +#. module: product_reserve_forecast |
2207 | +#: code:addons/product_reserve_forecast/sale_stock.py:85 |
2208 | +#, python-format |
2209 | +msgid "Not enough stock ! : " |
2210 | +msgstr "" |
2211 | + |
2212 | +#. module: product_reserve_forecast |
2213 | +#: code:addons/product_reserve_forecast/sale_stock.py:81 |
2214 | +#, python-format |
2215 | +msgid "You plan to sell %.2f %s but you only have %.2f %s available !\n" |
2216 | +"The real stock is %.2f %s. (without reservations)" |
2217 | +msgstr "" |
2218 | + |
2219 | +#. module: product_reserve_forecast |
2220 | +#: model:res.groups,name:product_reserve_forecast.group_product_reserve |
2221 | +msgid "Define product reserve quantity" |
2222 | +msgstr "" |
2223 | + |
2224 | +#. module: product_reserve_forecast |
2225 | +#: code:addons/product_reserve_forecast/sale_stock.py:90 |
2226 | +#, python-format |
2227 | +msgid "Configuration Error!" |
2228 | +msgstr "" |
2229 | + |
2230 | +#. module: product_reserve_forecast |
2231 | +#: field:product.product,reserved:0 |
2232 | +msgid "Reserved Quantity" |
2233 | +msgstr "" |
2234 | + |
2235 | +#. module: product_reserve_forecast |
2236 | +#: model:ir.model,name:product_reserve_forecast.model_sale_order_line |
2237 | +msgid "Sales Order Line" |
2238 | +msgstr "" |
2239 | + |
2240 | +#. module: product_reserve_forecast |
2241 | +#: model:res.groups,comment:product_reserve_forecast.group_product_reserve |
2242 | +msgid "Can see and set the per product reserve quantity." |
2243 | +msgstr "" |
2244 | + |
2245 | |
2246 | === added file 'product_reserve_forecast/product.py' |
2247 | --- product_reserve_forecast/product.py 1970-01-01 00:00:00 +0000 |
2248 | +++ product_reserve_forecast/product.py 2014-08-27 19:22:25 +0000 |
2249 | @@ -0,0 +1,70 @@ |
2250 | +# -*- coding: utf-8 -*- |
2251 | +############################################################################## |
2252 | +# |
2253 | +# OpenERP, Open Source Management Solution |
2254 | +# Copyright (C) 2013 Savoir-faire Linux (<http://www.savoirfairelinux.com>). |
2255 | +# |
2256 | +# This program is free software: you can redistribute it and/or modify |
2257 | +# it under the terms of the GNU Affero General Public License as |
2258 | +# published by the Free Software Foundation, either version 3 of the |
2259 | +# License, or (at your option) any later version. |
2260 | +# |
2261 | +# This program is distributed in the hope that it will be useful, |
2262 | +# but WITHOUT ANY WARRANTY; without even the implied warranty of |
2263 | +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
2264 | +# GNU Affero General Public License for more details. |
2265 | +# |
2266 | +# You should have received a copy of the GNU Affero General Public License |
2267 | +# along with this program. If not, see <http://www.gnu.org/licenses/>. |
2268 | +# |
2269 | +############################################################################## |
2270 | + |
2271 | +import openerp.addons.decimal_precision as dp |
2272 | +from openerp.osv import orm, fields |
2273 | + |
2274 | +class product_product(orm.Model): |
2275 | + |
2276 | + _inherit = 'product.product' |
2277 | + |
2278 | + def _virtual_available(self, cr, uid, ids, names, arg, context=None): |
2279 | + orig = self._product_available(cr, uid, ids, names, arg, context=context) |
2280 | + product_pool = self.pool.get('product.product') |
2281 | + for product_id in orig.keys(): |
2282 | + reserved = product_pool.browse(cr, uid, product_id, context=context).reserved |
2283 | + orig[product_id]['virtual_available'] -= reserved |
2284 | + |
2285 | + return orig |
2286 | + |
2287 | + def _virtual_clone(self, cr, uid, ids, names, arg, context=None): |
2288 | + '''Small hack to get priority over the Stock module's virtual_available''' |
2289 | + |
2290 | + res = {} |
2291 | + |
2292 | + for line in self.browse(cr, uid, ids, context=context): |
2293 | + res[line.id] = line.virtual_available |
2294 | + |
2295 | + return res |
2296 | + |
2297 | + _columns = { |
2298 | + 'reserved': fields.integer('Reserved Quantity'), |
2299 | + |
2300 | + 'virtual_clone': |
2301 | + fields.function(_virtual_clone, type='float', |
2302 | + digits_compute=dp.get_precision('Product Unit of Measure'), string='Forecasted Quantity'), |
2303 | + |
2304 | + 'virtual_available': fields.function(_virtual_available, multi='qty_available', |
2305 | + type='float', digits_compute=dp.get_precision('Product Unit of Measure'), |
2306 | + string='Forecasted Quantity', |
2307 | + help="Forecast quantity (computed as Quantity On Hand " |
2308 | + "- Outgoing - Reserved + Incoming)\n" |
2309 | + "In a context with a single Stock Location, this includes " |
2310 | + "goods stored in this location, or any of its children.\n" |
2311 | + "In a context with a single Warehouse, this includes " |
2312 | + "goods stored in the Stock Location of this Warehouse, or any " |
2313 | + "of its children.\n" |
2314 | + "In a context with a single Shop, this includes goods " |
2315 | + "stored in the Stock Location of the Warehouse of this Shop, " |
2316 | + "or any of its children.\n" |
2317 | + "Otherwise, this includes goods stored in any Stock Location " |
2318 | + "with 'internal' type."), |
2319 | + } |
2320 | |
2321 | === added file 'product_reserve_forecast/product_reserve_forecast_view.xml' |
2322 | --- product_reserve_forecast/product_reserve_forecast_view.xml 1970-01-01 00:00:00 +0000 |
2323 | +++ product_reserve_forecast/product_reserve_forecast_view.xml 2014-08-27 19:22:25 +0000 |
2324 | @@ -0,0 +1,28 @@ |
2325 | +<?xml version="1.0" encoding="utf8" ?> |
2326 | +<openerp> |
2327 | + <data> |
2328 | + <record id="product_reserve_forecast_form" model="ir.ui.view"> |
2329 | + <field name="name">product.product.reserve.form</field> |
2330 | + <field name="model">product.product</field> |
2331 | + <field name="inherit_id" ref="stock.view_normal_procurement_locations_form" /> |
2332 | + <field name="arch" type="xml"> |
2333 | + <field name="virtual_available" position="replace"> |
2334 | + <field name="virtual_clone" /> |
2335 | + <field name="reserved" groups="product_reserve_forecast.group_product_reserve" /> |
2336 | + </field> |
2337 | + </field> |
2338 | + </record> |
2339 | + |
2340 | + <record id="product_reserve_forecast_tree" model="ir.ui.view"> |
2341 | + <field name="name">product.product.reserve.tree</field> |
2342 | + <field name="model">product.product</field> |
2343 | + <field name="inherit_id" ref="product.product_product_tree_view" /> |
2344 | + <field name="arch" type="xml"> |
2345 | + <field name="virtual_available" position="replace"> |
2346 | + <field name="virtual_available" invisible="1" /> |
2347 | + <field name="virtual_clone" /> |
2348 | + </field> |
2349 | + </field> |
2350 | + </record> |
2351 | + </data> |
2352 | +</openerp> |
2353 | |
2354 | === added file 'product_reserve_forecast/sale_stock.py' |
2355 | --- product_reserve_forecast/sale_stock.py 1970-01-01 00:00:00 +0000 |
2356 | +++ product_reserve_forecast/sale_stock.py 2014-08-27 19:22:25 +0000 |
2357 | @@ -0,0 +1,94 @@ |
2358 | +# -*- coding: utf-8 -*- |
2359 | +############################################################################## |
2360 | +# |
2361 | +# OpenERP, Open Source Management Solution |
2362 | +# Copyright (C) 2013 Savoir-faire Linux (<http://www.savoirfairelinux.com>). |
2363 | +# |
2364 | +# This program is free software: you can redistribute it and/or modify |
2365 | +# it under the terms of the GNU Affero General Public License as |
2366 | +# published by the Free Software Foundation, either version 3 of the |
2367 | +# License, or (at your option) any later version. |
2368 | +# |
2369 | +# This program is distributed in the hope that it will be useful, |
2370 | +# but WITHOUT ANY WARRANTY; without even the implied warranty of |
2371 | +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
2372 | +# GNU Affero General Public License for more details. |
2373 | +# |
2374 | +# You should have received a copy of the GNU Affero General Public License |
2375 | +# along with this program. If not, see <http://www.gnu.org/licenses/>. |
2376 | +# |
2377 | +############################################################################## |
2378 | + |
2379 | +from openerp.osv import fields, orm |
2380 | +from openerp.tools import float_compare |
2381 | +from openerp.tools.translate import _ |
2382 | + |
2383 | +class sale_order_line(orm.Model): |
2384 | + |
2385 | + _inherit = 'sale.order.line' |
2386 | + |
2387 | + def product_id_change(self, cr, uid, ids, pricelist, product, qty=0, |
2388 | + uom=False, qty_uos=0, uos=False, name='', partner_id=False, |
2389 | + lang=False, update_tax=True, date_order=False, packaging=False, |
2390 | + fiscal_position=False, flag=False, context=None): |
2391 | + '''Slightly tweaked copy from sale_stock |
2392 | + |
2393 | + The only difference resides in the way the compare_qty is computed: in |
2394 | + this implementation, take into account the product's reserved quantity. |
2395 | + ''' |
2396 | + |
2397 | + context = context or {} |
2398 | + product_uom_obj = self.pool.get('product.uom') |
2399 | + partner_obj = self.pool.get('res.partner') |
2400 | + product_obj = self.pool.get('product.product') |
2401 | + warning = {} |
2402 | + res = super(sale_order_line, self).product_id_change(cr, uid, ids, pricelist, product, qty=qty, |
2403 | + uom=uom, qty_uos=qty_uos, uos=uos, name=name, partner_id=partner_id, |
2404 | + lang=lang, update_tax=update_tax, date_order=date_order, packaging=packaging, fiscal_position=fiscal_position, flag=flag, context=context) |
2405 | + |
2406 | + if not product: |
2407 | + res['value'].update({'product_packaging': False}) |
2408 | + return res |
2409 | + |
2410 | + #update of result obtained in super function |
2411 | + product_obj = product_obj.browse(cr, uid, product, context=context) |
2412 | + res['value']['delay'] = (product_obj.sale_delay or 0.0) |
2413 | + res['value']['type'] = product_obj.procure_method |
2414 | + |
2415 | + #check if product is available, and if not: raise an error |
2416 | + uom2 = False |
2417 | + if uom: |
2418 | + uom2 = product_uom_obj.browse(cr, uid, uom) |
2419 | + if product_obj.uom_id.category_id.id != uom2.category_id.id: |
2420 | + uom = False |
2421 | + if not uom2: |
2422 | + uom2 = product_obj.uom_id |
2423 | + |
2424 | + # Calling product_packaging_change function after updating UoM |
2425 | + res_packing = self.product_packaging_change(cr, uid, ids, pricelist, product, qty, uom, partner_id, packaging, context=context) |
2426 | + res['value'].update(res_packing.get('value', {})) |
2427 | + warning_msgs = res_packing.get('warning') and res_packing['warning']['message'] or '' |
2428 | + |
2429 | + # Original comparison did not substract reserved quantity |
2430 | + avail = product_obj.virtual_available - product_obj.reserved |
2431 | + compare_qty = float_compare( |
2432 | + avail * uom2.factor, |
2433 | + qty * product_obj.uom_id.factor, |
2434 | + precision_rounding=product_obj.uom_id.rounding) |
2435 | + |
2436 | + if (product_obj.type=='product') and int(compare_qty) == -1 \ |
2437 | + and (product_obj.procure_method=='make_to_stock'): |
2438 | + warn_msg = _('You plan to sell %.2f %s but you only have %.2f %s available !\nThe real stock is %.2f %s. (without reservations)') % \ |
2439 | + (qty, uom2 and uom2.name or product_obj.uom_id.name, |
2440 | + max(0,product_obj.virtual_available), product_obj.uom_id.name, |
2441 | + max(0,product_obj.qty_available), product_obj.uom_id.name) |
2442 | + warning_msgs += _("Not enough stock ! : ") + warn_msg + "\n\n" |
2443 | + |
2444 | + #update of warning messages |
2445 | + if warning_msgs: |
2446 | + warning = { |
2447 | + 'title': _('Configuration Error!'), |
2448 | + 'message' : warning_msgs |
2449 | + } |
2450 | + res.update({'warning': warning}) |
2451 | + return res |
2452 | |
2453 | === added directory 'product_reserve_forecast/security' |
2454 | === added file 'product_reserve_forecast/security/ir.model.access.csv' |
2455 | --- product_reserve_forecast/security/ir.model.access.csv 1970-01-01 00:00:00 +0000 |
2456 | +++ product_reserve_forecast/security/ir.model.access.csv 2014-08-27 19:22:25 +0000 |
2457 | @@ -0,0 +1,1 @@ |
2458 | +access_sale_order_warn,access_sale_order_warn,model_sale_order_warn,,1,1,1,1 |
2459 | |
2460 | === added file 'product_reserve_forecast/security/product_reserve_forecast_security.xml' |
2461 | --- product_reserve_forecast/security/product_reserve_forecast_security.xml 1970-01-01 00:00:00 +0000 |
2462 | +++ product_reserve_forecast/security/product_reserve_forecast_security.xml 2014-08-27 19:22:25 +0000 |
2463 | @@ -0,0 +1,11 @@ |
2464 | +<?xml version="1.0" encoding="utf-8" ?> |
2465 | +<openerp> |
2466 | + <data> |
2467 | + <record id="group_product_reserve" model="res.groups"> |
2468 | + <field name="name">Define product reserve quantity</field> |
2469 | + <field name="category_id" ref="base.module_category_hidden" /> |
2470 | + <field name="comment">Can see and set the per product reserve quantity.</field> |
2471 | + <field name="implied_ids" eval="[(4, ref('base.group_user'))]" /> |
2472 | + </record> |
2473 | + </data> |
2474 | +</openerp> |
2475 | |
2476 | === added directory 'purchase_gains' |
2477 | === added file 'purchase_gains/__init__.py' |
2478 | --- purchase_gains/__init__.py 1970-01-01 00:00:00 +0000 |
2479 | +++ purchase_gains/__init__.py 2014-08-27 19:22:25 +0000 |
2480 | @@ -0,0 +1,23 @@ |
2481 | +# -*- coding: utf-8 -*- |
2482 | +############################################################################## |
2483 | +# |
2484 | +# OpenERP, Open Source Management Solution |
2485 | +# Copyright (C) 2013 Savoir-faire Linux (<http://www.savoirfairelinux.com>). |
2486 | +# |
2487 | +# This program is free software: you can redistribute it and/or modify |
2488 | +# it under the terms of the GNU Affero General Public License as |
2489 | +# published by the Free Software Foundation, either version 3 of the |
2490 | +# License, or (at your option) any later version. |
2491 | +# |
2492 | +# This program is distributed in the hope that it will be useful, |
2493 | +# but WITHOUT ANY WARRANTY; without even the implied warranty of |
2494 | +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
2495 | +# GNU Affero General Public License for more details. |
2496 | +# |
2497 | +# You should have received a copy of the GNU Affero General Public License |
2498 | +# along with this program. If not, see <http://www.gnu.org/licenses/>. |
2499 | +# |
2500 | +############################################################################## |
2501 | + |
2502 | +import report |
2503 | +import purchase |
2504 | |
2505 | === added file 'purchase_gains/__init__.pyc' |
2506 | Binary files purchase_gains/__init__.pyc 1970-01-01 00:00:00 +0000 and purchase_gains/__init__.pyc 2014-08-27 19:22:25 +0000 differ |
2507 | === added file 'purchase_gains/__openerp__.py' |
2508 | --- purchase_gains/__openerp__.py 1970-01-01 00:00:00 +0000 |
2509 | +++ purchase_gains/__openerp__.py 2014-08-27 19:22:25 +0000 |
2510 | @@ -0,0 +1,45 @@ |
2511 | +# -*- coding: utf-8 -*- |
2512 | +############################################################################## |
2513 | +# |
2514 | +# OpenERP, Open Source Management Solution |
2515 | +# Copyright (C) 2013 Savoir-faire Linux (<http://www.savoirfairelinux.com>). |
2516 | +# |
2517 | +# This program is free software: you can redistribute it and/or modify |
2518 | +# it under the terms of the GNU Affero General Public License as |
2519 | +# published by the Free Software Foundation, either version 3 of the |
2520 | +# License, or (at your option) any later version. |
2521 | +# |
2522 | +# This program is distributed in the hope that it will be useful, |
2523 | +# but WITHOUT ANY WARRANTY; without even the implied warranty of |
2524 | +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
2525 | +# GNU Affero General Public License for more details. |
2526 | +# |
2527 | +# You should have received a copy of the GNU Affero General Public License |
2528 | +# along with this program. If not, see <http://www.gnu.org/licenses/>. |
2529 | +# |
2530 | +############################################################################## |
2531 | + |
2532 | +# NOTE: The name of the supplied field was initially "display_name", but it seems that OpenERP, |
2533 | +# whenever it seems "name" in the field, returns the value for "name". Well... |
2534 | + |
2535 | +{ |
2536 | + 'name': 'Purchase gain', |
2537 | + 'version': '1.1', |
2538 | + 'author': 'Savoir-faire Linux', |
2539 | + 'maintainer': 'Savoir-faire Linux', |
2540 | + 'website': 'http://www.savoirfairelinux.com', |
2541 | + 'category': 'Generic Modules/Purchases', |
2542 | + 'description': """ |
2543 | +Create a menu in reporting for Purchase gains |
2544 | +==================================================== |
2545 | +""", |
2546 | + 'depends': ['base', 'purchase'], |
2547 | + 'data': [ |
2548 | + 'purchase_report.xml', |
2549 | + 'purchase_view.xml', |
2550 | + ], |
2551 | + 'demo': [], |
2552 | + 'test': [], |
2553 | + 'installable': True, |
2554 | + 'active': False, |
2555 | +} |
2556 | |
2557 | === added file 'purchase_gains/purchase.py' |
2558 | --- purchase_gains/purchase.py 1970-01-01 00:00:00 +0000 |
2559 | +++ purchase_gains/purchase.py 2014-08-27 19:22:25 +0000 |
2560 | @@ -0,0 +1,106 @@ |
2561 | +# -*- coding: utf-8 -*- |
2562 | +############################################################################## |
2563 | +# |
2564 | +# OpenERP, Open Source Management Solution |
2565 | +# Copyright (C) 2013 Savoir-faire Linux (<http://www.savoirfairelinux.com>). |
2566 | +# |
2567 | +# This program is free software: you can redistribute it and/or modify |
2568 | +# it under the terms of the GNU Affero General Public License as |
2569 | +# published by the Free Software Foundation, either version 3 of the |
2570 | +# License, or (at your option) any later version. |
2571 | +# |
2572 | +# This program is distributed in the hope that it will be useful, |
2573 | +# but WITHOUT ANY WARRANTY; without even the implied warranty of |
2574 | +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
2575 | +# GNU Affero General Public License for more details. |
2576 | +# |
2577 | +# You should have received a copy of the GNU Affero General Public License |
2578 | +# along with this program. If not, see <http://www.gnu.org/licenses/>. |
2579 | +# |
2580 | +############################################################################## |
2581 | + |
2582 | +from openerp.osv import orm, fields |
2583 | +import openerp.addons.decimal_precision as dp |
2584 | + |
2585 | +class purchase_order(orm.Model): |
2586 | + |
2587 | + _inherit = 'purchase.order' |
2588 | + |
2589 | + def get_profit_all(self, cr, uid, ids, name, args, context): |
2590 | + if not ids: |
2591 | + return {} |
2592 | + res = {} |
2593 | + for line in self.browse(cr, uid, ids): |
2594 | + res[line.id] = { |
2595 | + 'profit_po': 0.0, |
2596 | + 'amount_total_discount': 0.0, |
2597 | + 'amount_landing_cost': 0.0, |
2598 | + 'amount_total_price_unit': 0.0, |
2599 | + 'amount_total_sale_order': 0.0 |
2600 | + } |
2601 | + total_landed_cost_po = 0.0 |
2602 | + if line.landed_cost_line_ids: |
2603 | + for costs in line.landed_cost_line_ids: |
2604 | + total_landed_cost_po += costs.amount |
2605 | + res[line.id]['amount_landing_cost'] = total_landed_cost_po |
2606 | + total_price_unit = 0.0 |
2607 | + |
2608 | + amount_total_sale_order = 0.0 |
2609 | + amount_total_discounts = 0.0 |
2610 | + total_landed_cost_so = 0.0 |
2611 | + if line.order_line: |
2612 | + for one_line in line.order_line: |
2613 | + acc_id = one_line.account_analytic_id.id |
2614 | + total_price_unit += one_line.price_unit |
2615 | + ids_stock_prod_lot = self.pool.get('stock.production.lot').search(cr, uid, [('account_analytic_id', '=', acc_id)], context=context)[0] |
2616 | + id_stock_prod_lot = self.pool.get('stock.production.lot').browse(cr, uid, ids_stock_prod_lot).id |
2617 | + stock_move_ids = self.pool.get('stock.move').search(cr, uid, [('prodlot_id', '=', id_stock_prod_lot)], context=context) |
2618 | + |
2619 | + list_stock_move = self.pool.get('stock.move').browse(cr, uid, stock_move_ids, context) |
2620 | + amount_total_sale_order = 0.0 |
2621 | + amount_total_discounts = 0.0 |
2622 | + if list_stock_move: |
2623 | + for one_move_line in list_stock_move: |
2624 | + if one_move_line.picking_id.sale_id: |
2625 | + amount_total_sale_order += one_move_line.picking_id.sale_id.amount_total |
2626 | + amount_total_discounts += one_move_line.picking_id.sale_id.amount_total * (1-(one_move_line.picking_id.sale_id.partner_id.discount or 0.0)) |
2627 | + total_landed_cost_so = 0.0 |
2628 | + if one_move_line.picking_id.sale_id.landed_cost_line_ids: |
2629 | + for costs_so in one_move_line.picking_id.sale_id.landed_cost_line_ids: |
2630 | + total_landed_cost_so += costs_so.amount |
2631 | + res[line.id]['total_landed_cost_so'] = total_landed_cost_so |
2632 | + res[line.id]['amount_total_price_unit'] = total_price_unit |
2633 | + res[line.id]['amount_total_discount'] = amount_total_discounts |
2634 | + res[line.id]['amount_total_sale_order'] = amount_total_sale_order |
2635 | + res[line.id]['profit_po'] = res[line.id]['amount_total_sale_order'] - (res[line.id]['total_landed_cost_so'] + res[line.id]['amount_total_price_unit'] + res[line.id]['amount_total_discount'] + res[line.id]['amount_landing_cost']) |
2636 | + return res |
2637 | + |
2638 | + |
2639 | + _columns = { |
2640 | + 'profit_po': fields.function( |
2641 | + get_profit_all, |
2642 | + digits_compute=dp.get_precision('Account'), |
2643 | + string='Profit', multi='all'), |
2644 | + 'amount_total_discount': fields.function( |
2645 | + get_profit_all, |
2646 | + digits_compute=dp.get_precision('Account'), |
2647 | + string='Total amount discount', multi='all'), |
2648 | + 'amount_landing_cost': fields.function( |
2649 | + get_profit_all, |
2650 | + digits_compute=dp.get_precision('Account'), |
2651 | + string='Total amount landing cost', multi='all'), |
2652 | + 'amount_total_price_unit': fields.function( |
2653 | + get_profit_all, |
2654 | + digits_compute=dp.get_precision('Account'), |
2655 | + string='Total amount price unit', multi='all'), |
2656 | + 'amount_total_sale_order': fields.function( |
2657 | + get_profit_all, |
2658 | + digits_compute=dp.get_precision('Account'), |
2659 | + string='Total amount sale order', multi='all'), |
2660 | + 'total_landed_cost_so': fields.function( |
2661 | + get_profit_all, |
2662 | + digits_compute=dp.get_precision('Account'), |
2663 | + string='Total amount landing cost sale order', multi='all'), |
2664 | + } |
2665 | + |
2666 | + |
2667 | |
2668 | === added file 'purchase_gains/purchase.pyc' |
2669 | Binary files purchase_gains/purchase.pyc 1970-01-01 00:00:00 +0000 and purchase_gains/purchase.pyc 2014-08-27 19:22:25 +0000 differ |
2670 | === added file 'purchase_gains/purchase_report.xml' |
2671 | --- purchase_gains/purchase_report.xml 1970-01-01 00:00:00 +0000 |
2672 | +++ purchase_gains/purchase_report.xml 2014-08-27 19:22:25 +0000 |
2673 | @@ -0,0 +1,9 @@ |
2674 | +<?xml version="1.0" encoding="utf-8"?> |
2675 | +<openerp> |
2676 | + <data> |
2677 | + <report auto="False" id="report_purchase_order_gains" model="purchase.order" |
2678 | + name="purchase.order.gains" rml="purchase_gains/report/order.rml" |
2679 | + usage="default" string="Purchase Order gains"/> |
2680 | + |
2681 | + </data> |
2682 | +</openerp> |
2683 | \ No newline at end of file |
2684 | |
2685 | === added file 'purchase_gains/purchase_view.xml' |
2686 | --- purchase_gains/purchase_view.xml 1970-01-01 00:00:00 +0000 |
2687 | +++ purchase_gains/purchase_view.xml 2014-08-27 19:22:25 +0000 |
2688 | @@ -0,0 +1,14 @@ |
2689 | +<openerp> |
2690 | + <data> |
2691 | + <record id="purchase_order_tree_inherit44" model="ir.ui.view"> |
2692 | + <field name="name">purchase.order.tree.inherit44</field> |
2693 | + <field name="model">purchase.order</field> |
2694 | + <field name="inherit_id" ref="purchase.purchase_order_tree"></field> |
2695 | + <field name="arch" type="xml"> |
2696 | + <field name="state" position="after"> |
2697 | + <field name="profit_po"></field> |
2698 | + </field> |
2699 | + </field> |
2700 | + </record> |
2701 | + </data> |
2702 | +</openerp> |
2703 | |
2704 | === added directory 'purchase_gains/report' |
2705 | === added file 'purchase_gains/report/__init__.py' |
2706 | --- purchase_gains/report/__init__.py 1970-01-01 00:00:00 +0000 |
2707 | +++ purchase_gains/report/__init__.py 2014-08-27 19:22:25 +0000 |
2708 | @@ -0,0 +1,24 @@ |
2709 | +# -*- coding: utf-8 -*- |
2710 | +############################################################################## |
2711 | +# |
2712 | +# OpenERP, Open Source Management Solution |
2713 | +# Copyright (C) 2013 Savoir-faire Linux (<http://www.savoirfairelinux.com>). |
2714 | +# |
2715 | +# This program is free software: you can redistribute it and/or modify |
2716 | +# it under the terms of the GNU Affero General Public License as |
2717 | +# published by the Free Software Foundation, either version 3 of the |
2718 | +# License, or (at your option) any later version. |
2719 | +# |
2720 | +# This program is distributed in the hope that it will be useful, |
2721 | +# but WITHOUT ANY WARRANTY; without even the implied warranty of |
2722 | +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
2723 | +# GNU Affero General Public License for more details. |
2724 | +# |
2725 | +# You should have received a copy of the GNU Affero General Public License |
2726 | +# along with this program. If not, see <http://www.gnu.org/licenses/>. |
2727 | +# |
2728 | +############################################################################## |
2729 | + |
2730 | +import order |
2731 | + |
2732 | +# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4: |
2733 | \ No newline at end of file |
2734 | |
2735 | === added file 'purchase_gains/report/order.py' |
2736 | --- purchase_gains/report/order.py 1970-01-01 00:00:00 +0000 |
2737 | +++ purchase_gains/report/order.py 2014-08-27 19:22:25 +0000 |
2738 | @@ -0,0 +1,35 @@ |
2739 | +# -*- coding: utf-8 -*- |
2740 | +############################################################################## |
2741 | +# |
2742 | +# OpenERP, Open Source Management Solution |
2743 | +# Copyright (C) 2013 Savoir-faire Linux (<http://www.savoirfairelinux.com>). |
2744 | +# |
2745 | +# This program is free software: you can redistribute it and/or modify |
2746 | +# it under the terms of the GNU Affero General Public License as |
2747 | +# published by the Free Software Foundation, either version 3 of the |
2748 | +# License, or (at your option) any later version. |
2749 | +# |
2750 | +# This program is distributed in the hope that it will be useful, |
2751 | +# but WITHOUT ANY WARRANTY; without even the implied warranty of |
2752 | +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
2753 | +# GNU Affero General Public License for more details. |
2754 | +# |
2755 | +# You should have received a copy of the GNU Affero General Public License |
2756 | +# along with this program. If not, see <http://www.gnu.org/licenses/>. |
2757 | +# |
2758 | +############################################################################## |
2759 | + |
2760 | +import time |
2761 | +from openerp.report import report_sxw |
2762 | +from openerp.osv import osv |
2763 | +from openerp import pooler |
2764 | + |
2765 | +class order(report_sxw.rml_parse): |
2766 | + def __init__(self, cr, uid, name, context): |
2767 | + super(order, self).__init__(cr, uid, name, context=context) |
2768 | + self.localcontext.update({'time': time}) |
2769 | + |
2770 | +report_sxw.report_sxw('report.purchase.order.gains','purchase.order','addons/purchase_gains/report/order.rml',parser=order) |
2771 | + |
2772 | +# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4: |
2773 | + |
2774 | |
2775 | === added file 'purchase_gains/report/order.rml' |
2776 | --- purchase_gains/report/order.rml 1970-01-01 00:00:00 +0000 |
2777 | +++ purchase_gains/report/order.rml 2014-08-27 19:22:25 +0000 |
2778 | @@ -0,0 +1,172 @@ |
2779 | +<?xml version="1.0"?> |
2780 | +<document filename="Purchase Order.pdf"> |
2781 | + <template title="Purchase Order" author="OpenERP S.A.(sales@openerp.com)" allowSplitting="20"> |
2782 | + <pageTemplate id="first"> |
2783 | + <frame id="first" x1="18.0" y1="42.0" width="535" height="758"/> |
2784 | + </pageTemplate> |
2785 | + </template> |
2786 | + <stylesheet> |
2787 | + <blockTableStyle id="Standard_Outline"> |
2788 | + <blockAlignment value="LEFT"/> |
2789 | + <blockValign value="TOP"/> |
2790 | + </blockTableStyle> |
2791 | + <blockTableStyle id="Tableau1"> |
2792 | + <blockAlignment value="LEFT"/> |
2793 | + <blockValign value="TOP"/> |
2794 | + </blockTableStyle> |
2795 | + <blockTableStyle id="Tableau2"> |
2796 | + <blockAlignment value="LEFT"/> |
2797 | + <blockValign value="TOP"/> |
2798 | + </blockTableStyle> |
2799 | + <blockTableStyle id="Header_Order_Reference_Tbl"> |
2800 | + <blockAlignment value="LEFT"/> |
2801 | + <blockValign value="TOP"/> |
2802 | + <lineStyle kind="LINEBEFORE" colorName="#e6e6e6" start="0,0" stop="0,-1"/> |
2803 | + <lineStyle kind="LINEABOVE" colorName="#e6e6e6" start="0,0" stop="0,0"/> |
2804 | + <lineStyle kind="LINEBELOW" colorName="#e6e6e6" start="0,-1" stop="0,-1"/> |
2805 | + <lineStyle kind="LINEBEFORE" colorName="#e6e6e6" start="1,0" stop="1,-1"/> |
2806 | + <lineStyle kind="LINEABOVE" colorName="#e6e6e6" start="1,0" stop="1,0"/> |
2807 | + <lineStyle kind="LINEBELOW" colorName="#e6e6e6" start="1,-1" stop="1,-1"/> |
2808 | + <lineStyle kind="LINEBEFORE" colorName="#e6e6e6" start="2,0" stop="2,-1"/> |
2809 | + <lineStyle kind="LINEABOVE" colorName="#e6e6e6" start="2,0" stop="2,0"/> |
2810 | + <lineStyle kind="LINEBELOW" colorName="#e6e6e6" start="2,-1" stop="2,-1"/> |
2811 | + <lineStyle kind="LINEBEFORE" colorName="#e6e6e6" start="3,0" stop="3,-1"/> |
2812 | + <lineStyle kind="LINEAFTER" colorName="#e6e6e6" start="3,0" stop="3,-1"/> |
2813 | + <lineStyle kind="LINEABOVE" colorName="#e6e6e6" start="3,0" stop="3,0"/> |
2814 | + <lineStyle kind="LINEBELOW" colorName="#e6e6e6" start="3,-1" stop="3,-1"/> |
2815 | + <lineStyle kind="LINEAFTER" colorName="#e6e6e6" start="4,0" stop="4,-1"/> |
2816 | + <lineStyle kind="LINEABOVE" colorName="#e6e6e6" start="4,0" stop="4,0"/> |
2817 | + <lineStyle kind="LINEBELOW" colorName="#e6e6e6" start="4,-1" stop="4,-1"/> |
2818 | + </blockTableStyle> |
2819 | + <blockTableStyle id="Content_Order_Reference_Table"> |
2820 | + <blockAlignment value="LEFT"/> |
2821 | + <blockValign value="TOP"/> |
2822 | + <lineStyle kind="LINEBEFORE" colorName="#e6e6e6" start="0,0" stop="0,-1"/> |
2823 | + <lineStyle kind="LINEABOVE" colorName="#e6e6e6" start="0,0" stop="0,0"/> |
2824 | + <lineStyle kind="LINEBELOW" colorName="#e6e6e6" start="0,-1" stop="0,-1"/> |
2825 | + <lineStyle kind="LINEBEFORE" colorName="#e6e6e6" start="1,0" stop="1,-1"/> |
2826 | + <lineStyle kind="LINEABOVE" colorName="#e6e6e6" start="1,0" stop="1,0"/> |
2827 | + <lineStyle kind="LINEBELOW" colorName="#e6e6e6" start="1,-1" stop="1,-1"/> |
2828 | + <lineStyle kind="LINEBEFORE" colorName="#e6e6e6" start="2,0" stop="2,-1"/> |
2829 | + <lineStyle kind="LINEABOVE" colorName="#e6e6e6" start="2,0" stop="2,0"/> |
2830 | + <lineStyle kind="LINEBELOW" colorName="#e6e6e6" start="2,-1" stop="2,-1"/> |
2831 | + <lineStyle kind="LINEBEFORE" colorName="#e6e6e6" start="3,0" stop="3,-1"/> |
2832 | + <lineStyle kind="LINEAFTER" colorName="#e6e6e6" start="3,0" stop="3,-1"/> |
2833 | + <lineStyle kind="LINEABOVE" colorName="#e6e6e6" start="3,0" stop="3,0"/> |
2834 | + <lineStyle kind="LINEBELOW" colorName="#e6e6e6" start="3,-1" stop="3,-1"/> |
2835 | + <lineStyle kind="LINEAFTER" colorName="#e6e6e6" start="4,0" stop="4,-1"/> |
2836 | + <lineStyle kind="LINEABOVE" colorName="#e6e6e6" start="4,0" stop="4,0"/> |
2837 | + <lineStyle kind="LINEBELOW" colorName="#e6e6e6" start="4,-1" stop="4,-1"/> |
2838 | + </blockTableStyle> |
2839 | + <blockTableStyle id="Table_Header_Pur_ord_Line"> |
2840 | + <blockAlignment value="LEFT"/> |
2841 | + <blockValign value="TOP"/> |
2842 | + <lineStyle kind="LINEBELOW" colorName="#000000" start="0,-1" stop="0,-1"/> |
2843 | + <lineStyle kind="LINEBELOW" colorName="#000000" start="1,-1" stop="1,-1"/> |
2844 | + <lineStyle kind="LINEBELOW" colorName="#000000" start="2,-1" stop="2,-1"/> |
2845 | + <lineStyle kind="LINEBELOW" colorName="#000000" start="3,-1" stop="3,-1"/> |
2846 | + <lineStyle kind="LINEBELOW" colorName="#000000" start="4,-1" stop="4,-1"/> |
2847 | + <lineStyle kind="LINEBELOW" colorName="#000000" start="5,-1" stop="5,-1"/> |
2848 | + </blockTableStyle> |
2849 | + <blockTableStyle id="Table_Order_Pur_line_Content"> |
2850 | + <blockAlignment value="LEFT"/> |
2851 | + <blockValign value="TOP"/> |
2852 | + <lineStyle kind="LINEBELOW" colorName="#e6e6e6" start="0,-1" stop="0,-1"/> |
2853 | + <lineStyle kind="LINEBELOW" colorName="#e6e6e6" start="1,-1" stop="1,-1"/> |
2854 | + <lineStyle kind="LINEBELOW" colorName="#e6e6e6" start="2,-1" stop="2,-1"/> |
2855 | + <lineStyle kind="LINEBELOW" colorName="#e6e6e6" start="3,-1" stop="3,-1"/> |
2856 | + <lineStyle kind="LINEBELOW" colorName="#e6e6e6" start="4,-1" stop="4,-1"/> |
2857 | + <lineStyle kind="LINEBELOW" colorName="#e6e6e6" start="5,-1" stop="5,-1"/> |
2858 | + <lineStyle kind="LINEBELOW" colorName="#e6e6e6" start="0,-1" stop="0,-1"/> |
2859 | + <lineStyle kind="LINEBELOW" colorName="#e6e6e6" start="1,-1" stop="1,-1"/> |
2860 | + <lineStyle kind="LINEBELOW" colorName="#e6e6e6" start="2,-1" stop="2,-1"/> |
2861 | + <lineStyle kind="LINEBELOW" colorName="#e6e6e6" start="3,-1" stop="3,-1"/> |
2862 | + <lineStyle kind="LINEBELOW" colorName="#e6e6e6" start="4,-1" stop="4,-1"/> |
2863 | + <lineStyle kind="LINEBELOW" colorName="#e6e6e6" start="5,-1" stop="5,-1"/> |
2864 | + </blockTableStyle> |
2865 | + <blockTableStyle id="Table_All_Total_Detail"> |
2866 | + <blockAlignment value="LEFT"/> |
2867 | + <blockValign value="TOP"/> |
2868 | + <lineStyle kind="LINEABOVE" colorName="#ffffff" start="0,0" stop="0,0"/> |
2869 | + <lineStyle kind="LINEABOVE" colorName="#000000" start="1,0" stop="1,0"/> |
2870 | + <lineStyle kind="LINEABOVE" colorName="#000000" start="2,0" stop="2,0"/> |
2871 | + <lineStyle kind="LINEABOVE" colorName="#000000" start="1,2" stop="1,2"/> |
2872 | + <lineStyle kind="LINEABOVE" colorName="#000000" start="2,2" stop="2,2"/> |
2873 | + </blockTableStyle> |
2874 | + <blockTableStyle id="Table_Outer_Notes"> |
2875 | + <blockAlignment value="LEFT"/> |
2876 | + <blockValign value="TOP"/> |
2877 | + </blockTableStyle> |
2878 | + <initialize> |
2879 | + <paraStyle name="all" alignment="justify"/> |
2880 | + </initialize> |
2881 | + <paraStyle name="terp_header" fontSize="12.0" leading="15" alignment="LEFT" spaceBefore="12.0" spaceAfter="6.0"/> |
2882 | + <paraStyle name="terp_tblheader_General" fontSize="8.0" leading="10" alignment="LEFT" spaceBefore="6.0" spaceAfter="6.0"/> |
2883 | + <paraStyle name="terp_default_8" fontSize="8.0" leading="10" alignment="LEFT" spaceBefore="0.0" spaceAfter="0.0"/> |
2884 | + <paraStyle name="terp_tblheader_General_Centre" fontSize="8.0" leading="10" alignment="CENTER" spaceBefore="6.0" spaceAfter="6.0"/> |
2885 | + <paraStyle name="terp_tblheader_General_Right" fontSize="8.0" leading="10" alignment="RIGHT" spaceBefore="6.0" spaceAfter="6.0"/> |
2886 | + <paraStyle name="terp_default_Centre_8" fontSize="8.0" leading="10" alignment="CENTER" spaceBefore="0.0" spaceAfter="0.0"/> |
2887 | + <paraStyle name="terp_default_9" fontSize="9.0" leading="11" alignment="LEFT" spaceBefore="0.0" spaceAfter="0.0"/> |
2888 | + <paraStyle name="terp_default_Bold_9" fontSize="9.0" leading="11" alignment="LEFT" spaceBefore="0.0" spaceAfter="0.0"/> |
2889 | + <paraStyle name="terp_default_Right_9" fontSize="9.0" leading="11" alignment="RIGHT" spaceBefore="0.0" spaceAfter="0.0"/> |
2890 | + <paraStyle name="terp_default_Bold_9_Right" fontSize="9.0" leading="11" alignment="RIGHT" spaceBefore="0.0" spaceAfter="0.0"/> |
2891 | + <images/> |
2892 | + </stylesheet> |
2893 | + <story> |
2894 | + <pto> |
2895 | + <!--<para style="terp_default_8">[[ setLang(o.partner_id.lang) ]]</para>--> |
2896 | + <para style="terp_default_9"> |
2897 | + <font color="white"> </font> |
2898 | + </para> |
2899 | + <para style="terp_default_9"> |
2900 | + <font color="white"> </font> |
2901 | + </para> |
2902 | + <para style="terp_header"><b>Purchase Order gains </b></para> |
2903 | + <para style="terp_default_8"> |
2904 | + <font color="white"> </font> |
2905 | + </para> |
2906 | + <blockTable colWidths="136.0,132.0,96.0,100.0,70.0" style="Header_Order_Reference_Tbl"> |
2907 | + <tr> |
2908 | + <td> |
2909 | + <para style="terp_tblheader_General_Centre"><b>Our Order Reference</b></para> |
2910 | + </td> |
2911 | + <td> |
2912 | + <para style="terp_tblheader_General_Centre"><b>Your Order Reference</b></para> |
2913 | + </td> |
2914 | + <td> |
2915 | + <para style="terp_tblheader_General_Centre"><b>Order Date</b></para> |
2916 | + </td> |
2917 | + <td> |
2918 | + <para style="terp_tblheader_General_Centre"><b>Validated By</b></para> |
2919 | + </td> |
2920 | + <td> |
2921 | + <para style="terp_tblheader_General_Centre"><b>Profit</b></para> |
2922 | + </td> |
2923 | + </tr> |
2924 | + </blockTable> |
2925 | + <section> |
2926 | + <para style="terp_default_8">[[repeatIn(objects,'o')]]</para> |
2927 | + <blockTable colWidths="136.0,132.0,96.0,100.0,70.0" style="Content_Order_Reference_Table"> |
2928 | + <tr> |
2929 | + <td> |
2930 | + <para style="terp_default_Centre_8">[[ o.name or '' ]]</para> |
2931 | + </td> |
2932 | + <td> |
2933 | + <para style="terp_default_Centre_8">[[ o.partner_ref or '' ]]</para> |
2934 | + </td> |
2935 | + <td> |
2936 | + <para style="terp_default_Centre_8">[[formatLang(o.date_order,date=True) ]]</para> |
2937 | + </td> |
2938 | + <td> |
2939 | + <para style="terp_default_Centre_8">[[ (o.validator and o.validator.name) or '' ]]</para> |
2940 | + </td> |
2941 | + <td> |
2942 | + <para style="terp_default_Centre_8">[[ formatLang(o.profit_po, digits=get_digits(dp='Account'), currency_obj=o.pricelist_id.currency_id ) ]]</para> |
2943 | + <para style="terp_default_Centre_8"></para> |
2944 | + </td> |
2945 | + </tr> |
2946 | + </blockTable> |
2947 | + </section> |
2948 | + </pto> |
2949 | + </story> |
2950 | +</document> |
2951 | |
2952 | === added directory 'purchase_lot_tracking' |
2953 | === added file 'purchase_lot_tracking/README' |
2954 | === added file 'purchase_lot_tracking/__init__.py' |
2955 | --- purchase_lot_tracking/__init__.py 1970-01-01 00:00:00 +0000 |
2956 | +++ purchase_lot_tracking/__init__.py 2014-08-27 19:22:25 +0000 |
2957 | @@ -0,0 +1,28 @@ |
2958 | +# -*- coding: utf-8 -*- |
2959 | +############################################################################## |
2960 | +# |
2961 | +# OpenERP, Open Source Management Solution |
2962 | +# Copyright (C) 2013 Savoir-faire Linux (<http://www.savoirfairelinux.com>). |
2963 | +# |
2964 | +# This program is free software: you can redistribute it and/or modify |
2965 | +# it under the terms of the GNU Affero General Public License as |
2966 | +# published by the Free Software Foundation, either version 3 of the |
2967 | +# License, or (at your option) any later version. |
2968 | +# |
2969 | +# This program is distributed in the hope that it will be useful, |
2970 | +# but WITHOUT ANY WARRANTY; without even the implied warranty of |
2971 | +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
2972 | +# GNU Affero General Public License for more details. |
2973 | +# |
2974 | +# You should have received a copy of the GNU Affero General Public License |
2975 | +# along with this program. If not, see <http://www.gnu.org/licenses/>. |
2976 | +# |
2977 | +############################################################################## |
2978 | + |
2979 | +import purchase_lot_tracking |
2980 | +import product |
2981 | +import purchase |
2982 | +import stock |
2983 | +import wizard |
2984 | +import account |
2985 | +import sale |
2986 | |
2987 | === added file 'purchase_lot_tracking/__openerp__.py' |
2988 | --- purchase_lot_tracking/__openerp__.py 1970-01-01 00:00:00 +0000 |
2989 | +++ purchase_lot_tracking/__openerp__.py 2014-08-27 19:22:25 +0000 |
2990 | @@ -0,0 +1,52 @@ |
2991 | +# -*- coding: utf-8 -*- |
2992 | +############################################################################## |
2993 | +# |
2994 | +# OpenERP, Open Source Management Solution |
2995 | +# Copyright (C) 2013 Savoir-faire Linux (<http://www.savoirfairelinux.com>). |
2996 | +# |
2997 | +# This program is free software: you can redistribute it and/or modify |
2998 | +# it under the terms of the GNU Affero General Public License as |
2999 | +# published by the Free Software Foundation, either version 3 of the |
3000 | +# License, or (at your option) any later version. |
3001 | +# |
3002 | +# This program is distributed in the hope that it will be useful, |
3003 | +# but WITHOUT ANY WARRANTY; without even the implied warranty of |
3004 | +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
3005 | +# GNU Affero General Public License for more details. |
3006 | +# |
3007 | +# You should have received a copy of the GNU Affero General Public License |
3008 | +# along with this program. If not, see <http://www.gnu.org/licenses/>. |
3009 | +# |
3010 | +############################################################################## |
3011 | + |
3012 | +# NOTE: The name of the supplied field was initially "display_name", but it seems that OpenERP, |
3013 | +# whenever it seems "name" in the field, returns the value for "name". Well... |
3014 | + |
3015 | +{ |
3016 | + 'name': 'purchase_lot_tracking', |
3017 | + 'version': '1.0', |
3018 | + 'author': 'Savoir-faire Linux', |
3019 | + 'website': 'http://www.savoirfairelinux.com', |
3020 | + 'category': 'Generic Modules/Purchases', |
3021 | + 'description': """ |
3022 | +Lets you track expenses using product's lots numbers |
3023 | +==================================================== |
3024 | + |
3025 | +This module lets you track expenses using a product's lot |
3026 | +number. |
3027 | + |
3028 | +If you create an analytic account for a product |
3029 | + |
3030 | + |
3031 | +""", |
3032 | + 'depends': ['base', 'purchase', 'purchase_landed_costs', 'analytic', 'sale'], |
3033 | + 'data': [ |
3034 | + 'purchase_lot_tracking_view.xml', |
3035 | + 'purchase_workflow.xml', |
3036 | + 'account_view.xml' |
3037 | + ], |
3038 | + 'demo': [], |
3039 | + 'test': [], |
3040 | + 'installable': True, |
3041 | + 'active': False, |
3042 | +} |
3043 | |
3044 | === added file 'purchase_lot_tracking/account.py' |
3045 | --- purchase_lot_tracking/account.py 1970-01-01 00:00:00 +0000 |
3046 | +++ purchase_lot_tracking/account.py 2014-08-27 19:22:25 +0000 |
3047 | @@ -0,0 +1,88 @@ |
3048 | +# -*- coding: utf-8 -*- |
3049 | +############################################################################## |
3050 | +# |
3051 | +# OpenERP, Open Source Management Solution |
3052 | +# Copyright (C) 2013 Savoir-faire Linux (<http://www.savoirfairelinux.com>). |
3053 | +# |
3054 | +# This program is free software: you can redistribute it and/or modify |
3055 | +# it under the terms of the GNU Affero General Public License as |
3056 | +# published by the Free Software Foundation, either version 3 of the |
3057 | +# License, or (at your option) any later version. |
3058 | +# |
3059 | +# This program is distributed in the hope that it will be useful, |
3060 | +# but WITHOUT ANY WARRANTY; without even the implied warranty of |
3061 | +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
3062 | +# GNU Affero General Public License for more details. |
3063 | +# |
3064 | +# You should have received a copy of the GNU Affero General Public License |
3065 | +# along with this program. If not, see <http://www.gnu.org/licenses/>. |
3066 | +# |
3067 | +############################################################################## |
3068 | + |
3069 | +from openerp.osv import orm, fields |
3070 | +import openerp.addons.decimal_precision as dp |
3071 | + |
3072 | +class account_analytic_account(orm.Model): |
3073 | + |
3074 | + _inherit = 'account.analytic.account' |
3075 | + |
3076 | + def _calculate_total_in(self, cr, uid, ids, name, arg, context=None): |
3077 | + res = {} |
3078 | + |
3079 | + move_pool = self.pool.get('stock.move') |
3080 | + |
3081 | + for account in self.browse(cr, uid, ids): |
3082 | + res[account.id] = 0.0 |
3083 | + total_moves = 0 |
3084 | + production_pool = self.pool.get('stock.production.lot') |
3085 | + lot_ids = production_pool.search(cr, uid, [('name', '=', account.name)]) |
3086 | + |
3087 | + for lot in production_pool.browse(cr, uid, lot_ids): |
3088 | + move_ids = move_pool.search( |
3089 | + cr, uid, [('prodlot_id', '=', lot.id)]) |
3090 | + for move in move_pool.browse(cr, uid, move_ids): |
3091 | + |
3092 | + # Add in purchases, remove sales |
3093 | + if move.type == 'in': |
3094 | + total_moves += move.product_qty |
3095 | + #else: |
3096 | + # total_moves -= move.product_qty |
3097 | + |
3098 | + total_moves = max(total_moves, 0) |
3099 | + res[account.id] = total_moves |
3100 | + |
3101 | + return res |
3102 | + |
3103 | + def _calculate_tcu(self, cr, uid, ids, name, arg, context=None): |
3104 | + res = {} |
3105 | + for account in self.browse(cr, uid, ids): |
3106 | + res[account.id] = 0.0 |
3107 | + if account.total_in_qty > 0: |
3108 | + res[account.id] = account.credit / account.total_in_qty |
3109 | + return res |
3110 | + |
3111 | + def _estimated_tcu(self, cr, uid, ids, name, arg, context=None): |
3112 | + res = {} |
3113 | + po_line_pool = self.pool.get('purchase.order.line') |
3114 | + for line in self.browse(cr, uid, ids): |
3115 | + if line.code.startswith('LOT'): |
3116 | + po_line_ids = po_line_pool.search(cr, uid, [('account_analytic_id', '=', line.id)]) |
3117 | + if po_line_ids: |
3118 | + po_line_id = po_line_ids[0] |
3119 | + po_line = po_line_pool.browse(cr, uid, po_line_id, context) |
3120 | + if po_line.product_qty == 0: |
3121 | + res[line.id] = 0 |
3122 | + else: |
3123 | + res[line.id] = po_line.landed_costs / po_line.product_qty |
3124 | + else: |
3125 | + res[line.id] = 0.0 |
3126 | + else: |
3127 | + res[line.id] = 0.0 |
3128 | + return res |
3129 | + |
3130 | + _columns = { |
3131 | + 'purchase_order': fields.many2one('purchase.order', 'Purchase Order', help='Issuing Purchase Order'), |
3132 | + 'total_cost_unit': fields.function(_calculate_tcu, string='Total Cost Unit', type='float'), |
3133 | + 'estimated_tcu': fields.function(_estimated_tcu, string='Estimated Total Cost per Unit', type='float'), |
3134 | + 'total_in_qty': fields.function(_calculate_total_in, string='Total Received Quantity', type='float'), |
3135 | + } |
3136 | |
3137 | === added file 'purchase_lot_tracking/account_view.xml' |
3138 | --- purchase_lot_tracking/account_view.xml 1970-01-01 00:00:00 +0000 |
3139 | +++ purchase_lot_tracking/account_view.xml 2014-08-27 19:22:25 +0000 |
3140 | @@ -0,0 +1,28 @@ |
3141 | +<?xml version="1.0" encoding="utf-8"?> |
3142 | +<openerp> |
3143 | + <data> |
3144 | + <record id="lot_total_cost_unit" model="ir.ui.view"> |
3145 | + <field name="name">Total Cost Unit</field> |
3146 | + <field name="model">account.analytic.account</field> |
3147 | + <field name="inherit_id" ref="account.view_account_analytic_account_tree" /> |
3148 | + <field name="arch" type="xml"> |
3149 | + <field name="type" position="before"> |
3150 | + <field name="total_in_qty" /> |
3151 | + <field name="estimated_tcu" /> |
3152 | + <field name="total_cost_unit"/> |
3153 | + </field> |
3154 | + </field> |
3155 | + </record> |
3156 | + |
3157 | + <record id="lot_purchase_order" model="ir.ui.view"> |
3158 | + <field name="name">Purchase Order</field> |
3159 | + <field name="model">account.analytic.account</field> |
3160 | + <field name="inherit_id" ref="account.view_account_analytic_account_tree" /> |
3161 | + <field name="arch" type="xml"> |
3162 | + <field name="code" position="before"> |
3163 | + <field name="purchase_order" /> |
3164 | + </field> |
3165 | + </field> |
3166 | + </record> |
3167 | + </data> |
3168 | +</openerp> |
3169 | |
3170 | === added directory 'purchase_lot_tracking/i18n' |
3171 | === added file 'purchase_lot_tracking/i18n/fr.po' |
3172 | --- purchase_lot_tracking/i18n/fr.po 1970-01-01 00:00:00 +0000 |
3173 | +++ purchase_lot_tracking/i18n/fr.po 2014-08-27 19:22:25 +0000 |
3174 | @@ -0,0 +1,109 @@ |
3175 | +# Translation of OpenERP Server. |
3176 | +# This file contains the translation of the following modules: |
3177 | +# * purchase_lot_tracking |
3178 | +# |
3179 | +msgid "" |
3180 | +msgstr "" |
3181 | +"Project-Id-Version: OpenERP Server 7.0-20130811-231021\n" |
3182 | +"Report-Msgid-Bugs-To: \n" |
3183 | +"POT-Creation-Date: 2013-09-18 14:23+0000\n" |
3184 | +"PO-Revision-Date: 2013-09-18 14:23+0000\n" |
3185 | +"Last-Translator: Alexandre Boily <alexandre.boily@savoirfairelinux.com>\n" |
3186 | +"Language-Team: Savoir-faire Linux\n" |
3187 | +"MIME-Version: 1.0\n" |
3188 | +"Content-Type: text/plain; charset=UTF-8\n" |
3189 | +"Content-Transfer-Encoding: \n" |
3190 | +"Plural-Forms: \n" |
3191 | + |
3192 | +#. module: purchase_lot_tracking |
3193 | +#: field:sale.order.line,average:0 |
3194 | +msgid "Avg." |
3195 | +msgstr "Moy." |
3196 | + |
3197 | +#. module: purchase_lot_tracking |
3198 | +#: model:ir.model,name:purchase_lot_tracking.model_product_category |
3199 | +msgid "Product Category" |
3200 | +msgstr "Catégorie de produit" |
3201 | + |
3202 | +#. module: purchase_lot_tracking |
3203 | +#: model:ir.model,name:purchase_lot_tracking.model_stock_invoice_onshipping |
3204 | +msgid "Stock Invoice Onshipping" |
3205 | +msgstr "Stock Invoice Onshipping" |
3206 | + |
3207 | +#. module: purchase_lot_tracking |
3208 | +#: field:sale.order.line,minimum:0 |
3209 | +msgid "Min." |
3210 | +msgstr "Min." |
3211 | + |
3212 | +#. module: purchase_lot_tracking |
3213 | +#: model:ir.model,name:purchase_lot_tracking.model_purchase_order_line |
3214 | +msgid "Purchase Order Line" |
3215 | +msgstr "Ligne de bon de commande" |
3216 | + |
3217 | +#. module: purchase_lot_tracking |
3218 | +#: model:ir.model,name:purchase_lot_tracking.model_stock_partial_picking_line |
3219 | +msgid "stock.partial.picking.line" |
3220 | +msgstr "stock.partial.picking.line" |
3221 | + |
3222 | +#. module: purchase_lot_tracking |
3223 | +#: field:product.category,account_id:0 |
3224 | +#: field:product.product,account_id:0 |
3225 | +msgid "Analytical Account" |
3226 | +msgstr "Compte analytique" |
3227 | + |
3228 | +#. module: purchase_lot_tracking |
3229 | +#: model:ir.model,name:purchase_lot_tracking.model_product_product |
3230 | +msgid "Product" |
3231 | +msgstr "Produit" |
3232 | + |
3233 | +#. module: purchase_lot_tracking |
3234 | +#: model:ir.model,name:purchase_lot_tracking.model_account_analytic_account |
3235 | +#: view:product.category:0 |
3236 | +#: field:stock.production.lot,account_analytic_id:0 |
3237 | +msgid "Analytic Account" |
3238 | +msgstr "Compte analytique" |
3239 | + |
3240 | +#. module: purchase_lot_tracking |
3241 | +#: field:purchase.order.line,lot:0 |
3242 | +msgid "Lot Number" |
3243 | +msgstr "Numéro de lot" |
3244 | + |
3245 | +#. module: purchase_lot_tracking |
3246 | +#: model:ir.model,name:purchase_lot_tracking.model_stock_production_lot |
3247 | +msgid "Serial Number" |
3248 | +msgstr "Numéro de série" |
3249 | + |
3250 | +#. module: purchase_lot_tracking |
3251 | +#: field:sale.order.line,maximum:0 |
3252 | +msgid "Max." |
3253 | +msgstr "Max." |
3254 | + |
3255 | +#. module: purchase_lot_tracking |
3256 | +#: field:account.analytic.account,estimated_tcu:0 |
3257 | +msgid "Estimated Total Cost per Unit" |
3258 | +msgstr "Coût total estimé par unité" |
3259 | + |
3260 | +#. module: purchase_lot_tracking |
3261 | +#: model:ir.model,name:purchase_lot_tracking.model_account_invoice |
3262 | +msgid "Invoice" |
3263 | +msgstr "Facture" |
3264 | + |
3265 | +#. module: purchase_lot_tracking |
3266 | +#: field:account.analytic.account,total_cost_unit:0 |
3267 | +msgid "Total Cost Unit" |
3268 | +msgstr "Coût total unitaire" |
3269 | + |
3270 | +#. module: purchase_lot_tracking |
3271 | +#: model:ir.model,name:purchase_lot_tracking.model_purchase_order |
3272 | +msgid "Purchase Order" |
3273 | +msgstr "Bon de commande" |
3274 | + |
3275 | +#. module: purchase_lot_tracking |
3276 | +#: model:ir.model,name:purchase_lot_tracking.model_sale_order_line |
3277 | +msgid "Sales Order Line" |
3278 | +msgstr "Ligne de bon d'achat" |
3279 | + |
3280 | +#. module: purchase_lot_tracking |
3281 | +#: field:account.analytic.account,total_in_qty:0 |
3282 | +msgid "Total Received Quantity" |
3283 | +msgstr "Quantité reçue totale" |
3284 | |
3285 | === added file 'purchase_lot_tracking/i18n/purchase_lot_tracking.pot' |
3286 | --- purchase_lot_tracking/i18n/purchase_lot_tracking.pot 1970-01-01 00:00:00 +0000 |
3287 | +++ purchase_lot_tracking/i18n/purchase_lot_tracking.pot 2014-08-27 19:22:25 +0000 |
3288 | @@ -0,0 +1,110 @@ |
3289 | +# Translation of OpenERP Server. |
3290 | +# This file contains the translation of the following modules: |
3291 | +# * purchase_lot_tracking |
3292 | +# |
3293 | +msgid "" |
3294 | +msgstr "" |
3295 | +"Project-Id-Version: OpenERP Server 7.0-20130811-231021\n" |
3296 | +"Report-Msgid-Bugs-To: \n" |
3297 | +"POT-Creation-Date: 2013-09-18 14:23+0000\n" |
3298 | +"PO-Revision-Date: 2013-09-18 14:23+0000\n" |
3299 | +"Last-Translator: <>\n" |
3300 | +"Language-Team: \n" |
3301 | +"MIME-Version: 1.0\n" |
3302 | +"Content-Type: text/plain; charset=UTF-8\n" |
3303 | +"Content-Transfer-Encoding: \n" |
3304 | +"Plural-Forms: \n" |
3305 | + |
3306 | +#. module: purchase_lot_tracking |
3307 | +#: field:sale.order.line,average:0 |
3308 | +msgid "Avg." |
3309 | +msgstr "" |
3310 | + |
3311 | +#. module: purchase_lot_tracking |
3312 | +#: model:ir.model,name:purchase_lot_tracking.model_product_category |
3313 | +msgid "Product Category" |
3314 | +msgstr "" |
3315 | + |
3316 | +#. module: purchase_lot_tracking |
3317 | +#: model:ir.model,name:purchase_lot_tracking.model_stock_invoice_onshipping |
3318 | +msgid "Stock Invoice Onshipping" |
3319 | +msgstr "" |
3320 | + |
3321 | +#. module: purchase_lot_tracking |
3322 | +#: field:sale.order.line,minimum:0 |
3323 | +msgid "Min." |
3324 | +msgstr "" |
3325 | + |
3326 | +#. module: purchase_lot_tracking |
3327 | +#: model:ir.model,name:purchase_lot_tracking.model_purchase_order_line |
3328 | +msgid "Purchase Order Line" |
3329 | +msgstr "" |
3330 | + |
3331 | +#. module: purchase_lot_tracking |
3332 | +#: model:ir.model,name:purchase_lot_tracking.model_stock_partial_picking_line |
3333 | +msgid "stock.partial.picking.line" |
3334 | +msgstr "" |
3335 | + |
3336 | +#. module: purchase_lot_tracking |
3337 | +#: field:product.category,account_id:0 |
3338 | +#: field:product.product,account_id:0 |
3339 | +msgid "Analytical Account" |
3340 | +msgstr "" |
3341 | + |
3342 | +#. module: purchase_lot_tracking |
3343 | +#: model:ir.model,name:purchase_lot_tracking.model_product_product |
3344 | +msgid "Product" |
3345 | +msgstr "" |
3346 | + |
3347 | +#. module: purchase_lot_tracking |
3348 | +#: model:ir.model,name:purchase_lot_tracking.model_account_analytic_account |
3349 | +#: view:product.category:0 |
3350 | +#: field:stock.production.lot,account_analytic_id:0 |
3351 | +msgid "Analytic Account" |
3352 | +msgstr "" |
3353 | + |
3354 | +#. module: purchase_lot_tracking |
3355 | +#: field:purchase.order.line,lot:0 |
3356 | +msgid "Lot Number" |
3357 | +msgstr "" |
3358 | + |
3359 | +#. module: purchase_lot_tracking |
3360 | +#: model:ir.model,name:purchase_lot_tracking.model_stock_production_lot |
3361 | +msgid "Serial Number" |
3362 | +msgstr "" |
3363 | + |
3364 | +#. module: purchase_lot_tracking |
3365 | +#: field:sale.order.line,maximum:0 |
3366 | +msgid "Max." |
3367 | +msgstr "" |
3368 | + |
3369 | +#. module: purchase_lot_tracking |
3370 | +#: field:account.analytic.account,estimated_tcu:0 |
3371 | +msgid "Estimated Total Cost per Unit" |
3372 | +msgstr "" |
3373 | + |
3374 | +#. module: purchase_lot_tracking |
3375 | +#: model:ir.model,name:purchase_lot_tracking.model_account_invoice |
3376 | +msgid "Invoice" |
3377 | +msgstr "" |
3378 | + |
3379 | +#. module: purchase_lot_tracking |
3380 | +#: field:account.analytic.account,total_cost_unit:0 |
3381 | +msgid "Total Cost Unit" |
3382 | +msgstr "" |
3383 | + |
3384 | +#. module: purchase_lot_tracking |
3385 | +#: model:ir.model,name:purchase_lot_tracking.model_purchase_order |
3386 | +msgid "Purchase Order" |
3387 | +msgstr "" |
3388 | + |
3389 | +#. module: purchase_lot_tracking |
3390 | +#: model:ir.model,name:purchase_lot_tracking.model_sale_order_line |
3391 | +msgid "Sales Order Line" |
3392 | +msgstr "" |
3393 | + |
3394 | +#. module: purchase_lot_tracking |
3395 | +#: field:account.analytic.account,total_in_qty:0 |
3396 | +msgid "Total Received Quantity" |
3397 | +msgstr "" |
3398 | + |
3399 | |
3400 | === added file 'purchase_lot_tracking/product.py' |
3401 | --- purchase_lot_tracking/product.py 1970-01-01 00:00:00 +0000 |
3402 | +++ purchase_lot_tracking/product.py 2014-08-27 19:22:25 +0000 |
3403 | @@ -0,0 +1,44 @@ |
3404 | +# -*- coding: utf-8 -*- |
3405 | +############################################################################## |
3406 | +# |
3407 | +# OpenERP, Open Source Management Solution |
3408 | +# Copyright (C) 2013 Savoir-faire Linux (<http://www.savoirfairelinux.com>). |
3409 | +# |
3410 | +# This program is free software: you can redistribute it and/or modify |
3411 | +# it under the terms of the GNU Affero General Public License as |
3412 | +# published by the Free Software Foundation, either version 3 of the |
3413 | +# License, or (at your option) any later version. |
3414 | +# |
3415 | +# This program is distributed in the hope that it will be useful, |
3416 | +# but WITHOUT ANY WARRANTY; without even the implied warranty of |
3417 | +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
3418 | +# GNU Affero General Public License for more details. |
3419 | +# |
3420 | +# You should have received a copy of the GNU Affero General Public License |
3421 | +# along with this program. If not, see <http://www.gnu.org/licenses/>. |
3422 | +# |
3423 | +############################################################################## |
3424 | + |
3425 | +from openerp.osv import orm, fields |
3426 | + |
3427 | +class product_category(orm.Model): |
3428 | + """ |
3429 | + Adds an analytical account to a purchase category |
3430 | + """ |
3431 | + |
3432 | + _inherit = 'product.category' |
3433 | + |
3434 | + _columns = { |
3435 | + 'account_id': fields.many2one('account.analytic.account', 'Analytical Account', required=False) |
3436 | + } |
3437 | + |
3438 | +class product_product(orm.Model): |
3439 | + """ |
3440 | + Adds an analytical account to a purchase category |
3441 | + """ |
3442 | + |
3443 | + _inherit = 'product.product' |
3444 | + |
3445 | + _columns = { |
3446 | + 'account_id': fields.many2one('account.analytic.account', 'Analytical Account', required=False) |
3447 | + } |
3448 | |
3449 | === added file 'purchase_lot_tracking/purchase.py' |
3450 | --- purchase_lot_tracking/purchase.py 1970-01-01 00:00:00 +0000 |
3451 | +++ purchase_lot_tracking/purchase.py 2014-08-27 19:22:25 +0000 |
3452 | @@ -0,0 +1,265 @@ |
3453 | +# -*- coding: utf-8 -*- |
3454 | +############################################################################## |
3455 | +# |
3456 | +# OpenERP, Open Source Management Solution |
3457 | +# Copyright (C) 2013 Savoir-faire Linux (<http://www.savoirfairelinux.com>). |
3458 | +# |
3459 | +# This program is free software: you can redistribute it and/or modify |
3460 | +# it under the terms of the GNU Affero General Public License as |
3461 | +# published by the Free Software Foundation, either version 3 of the |
3462 | +# License, or (at your option) any later version. |
3463 | +# |
3464 | +# This program is distributed in the hope that it will be useful, |
3465 | +# but WITHOUT ANY WARRANTY; without even the implied warranty of |
3466 | +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
3467 | +# GNU Affero General Public License for more details. |
3468 | +# |
3469 | +# You should have received a copy of the GNU Affero General Public License |
3470 | +# along with this program. If not, see <http://www.gnu.org/licenses/>. |
3471 | +# |
3472 | +############################################################################## |
3473 | + |
3474 | +from openerp.osv import orm, fields |
3475 | +from openerp import netsvc |
3476 | + |
3477 | + |
3478 | +def assign_lot_number(pool, cr, uid, line_orders, context=None): |
3479 | + """ |
3480 | + Manages and tracks a lot number for this production line |
3481 | + |
3482 | + Generates a lot number, a stock.production.lot and an analytic |
3483 | + account for this purchase order line. |
3484 | + """ |
3485 | + stock_prod_lot_obj = pool.get('stock.production.lot') |
3486 | + ir_sequence_obj = pool.get('ir.sequence') |
3487 | + |
3488 | + for line_order in line_orders: |
3489 | + order_id = line_order.order_id.id |
3490 | + |
3491 | + lot_number = ir_sequence_obj.get(cr, uid, 'ls.lot') |
3492 | + product = line_order.product_id |
3493 | + |
3494 | + # Creates the analytic account |
3495 | + account_id = _analytic_account_from_product(pool, |
3496 | + cr, |
3497 | + uid, |
3498 | + order_id, |
3499 | + product, |
3500 | + lot_number, |
3501 | + context=context) |
3502 | + |
3503 | + # Creates the stock.production.line |
3504 | + serial_number_data = { |
3505 | + 'name': lot_number, |
3506 | + 'product_id': product.id, |
3507 | + 'account_analytic_id': account_id, |
3508 | + } |
3509 | + |
3510 | + serial_number_id = stock_prod_lot_obj.create(cr, uid, |
3511 | + serial_number_data, |
3512 | + context=context) |
3513 | + |
3514 | + return serial_number_id, account_id |
3515 | + |
3516 | + |
3517 | +def _analytic_account_from_product(pool, cr, uid, order_id, product, |
3518 | + lot_number, context=None): |
3519 | + """ |
3520 | + Creates an analytic account for the lot number and places it |
3521 | + as a children of the product's analytic account. |
3522 | + |
3523 | + Assumes two variables in the context |
3524 | + - product: parent product id |
3525 | + - lot_number: lot_number to create analytic account for |
3526 | + """ |
3527 | + account_analytic_obj = pool.get('account.analytic.account') |
3528 | + parent_account = product.account_id |
3529 | + |
3530 | + account_values = { |
3531 | + 'name': lot_number, |
3532 | + 'complete_name': lot_number, |
3533 | + 'purchase_order': order_id, |
3534 | + 'code': lot_number, |
3535 | + 'type': 'normal', |
3536 | + 'parent_id': parent_account.id, |
3537 | + 'balance': 0.0, |
3538 | + 'debit': 0.0, |
3539 | + 'credit': 0.0, |
3540 | + 'quantity': 0.0, |
3541 | + 'date_start': parent_account.date_start, |
3542 | + 'date': parent_account.date, |
3543 | + 'state': parent_account.state, |
3544 | + } |
3545 | + |
3546 | + if parent_account.currency_id: |
3547 | + account_values['currency_id'] = parent_account.currency_id.id |
3548 | + |
3549 | + analytic_account_id = account_analytic_obj.create(cr, uid, |
3550 | + account_values, |
3551 | + context=context) |
3552 | + |
3553 | + return analytic_account_id |
3554 | + |
3555 | + |
3556 | +class purchase_order_line(orm.Model): |
3557 | + """ |
3558 | + Adds an analytical account to a product |
3559 | + """ |
3560 | + |
3561 | + _inherit = 'purchase.order.line' |
3562 | + |
3563 | + def must_be_tracked(self, cr, uid, ids): |
3564 | + """ |
3565 | + Determines if this purchase order line for this product must be tracked |
3566 | + """ |
3567 | + return True |
3568 | + |
3569 | + |
3570 | + |
3571 | + |
3572 | + _columns = { |
3573 | + 'lot': fields.char('Lot Number', size=64, required=False, |
3574 | + translate=True), |
3575 | + } |
3576 | + |
3577 | + |
3578 | +class purchase_order(orm.Model): |
3579 | + _inherit = "purchase.order" |
3580 | + |
3581 | + def _create_pickings(self, cr, uid, order, order_lines, picking_id=False, |
3582 | + context=None): |
3583 | + if not picking_id: |
3584 | + picking_id = self.pool.get('stock.picking').create( |
3585 | + cr, uid, |
3586 | + self._prepare_order_picking(cr, uid, order, context=context)) |
3587 | + |
3588 | + todo_moves = [] |
3589 | + stock_move = self.pool.get('stock.move') |
3590 | + wf_service = netsvc.LocalService("workflow") |
3591 | + |
3592 | + for order_line in order_lines: |
3593 | + if not order_line.product_id: |
3594 | + continue |
3595 | + if order_line.product_id.type in ('product', 'consu'): |
3596 | + move = stock_move.create( |
3597 | + cr, uid, |
3598 | + self._prepare_order_line_move(cr, uid, order, order_line, |
3599 | + picking_id, context=context)) |
3600 | + |
3601 | + if order_line.move_dest_id: |
3602 | + order_line.move_dest_id.write( |
3603 | + {'location_id': order.location_id.id}) |
3604 | + |
3605 | + todo_moves.append(move) |
3606 | + |
3607 | + stock_move.action_confirm(cr, uid, todo_moves) |
3608 | + stock_move.force_assign(cr, uid, todo_moves) |
3609 | + wf_service.trg_validate(uid, 'stock.picking', picking_id, |
3610 | + 'button_confirm', cr) |
3611 | + |
3612 | + res = [picking_id] |
3613 | + pick_id = int(res[0]) |
3614 | + |
3615 | + invoice_obj = self.pool.get('account.invoice') |
3616 | + invoice_line_obj = self.pool.get('account.invoice.line') |
3617 | + journal_obj = self.pool.get('account.journal') |
3618 | + journal_ids = journal_obj.search( |
3619 | + cr, uid, [('type', '=', 'purchase'), |
3620 | + ('company_id', '=', order.company_id.id)], limit=1) |
3621 | + |
3622 | + # Create the analytic account |
3623 | + |
3624 | + stock_picking_id = self.pool.get('stock.picking.in').search(cr, uid, [ |
3625 | + ('origin', 'like', order.name)]) |
3626 | + stock_picking = \ |
3627 | + self.pool.get('stock.picking.in').browse(cr, uid, |
3628 | + stock_picking_id)[0] |
3629 | + |
3630 | + all_lines_tracked = True |
3631 | + total_pallets = 0.0 |
3632 | + |
3633 | + for po_line in order.order_line: |
3634 | + if not po_line.product_id.track_production: |
3635 | + all_lines_tracked = False |
3636 | + else: |
3637 | + lot_number, account_id = assign_lot_number(self.pool, cr, uid, [po_line], context=context) |
3638 | + matching_lines = [line for line in stock_picking.move_lines |
3639 | + if line.product_qty == po_line.product_qty |
3640 | + and line.product_id.id == po_line.product_id.id |
3641 | + and not line.prodlot_id] |
3642 | + if matching_lines: |
3643 | + matching_lines[0].write({'prodlot_id': lot_number}) |
3644 | + |
3645 | + po_line.write({'account_analytic_id': account_id}) |
3646 | + po_line.refresh() |
3647 | + stock_picking.refresh() |
3648 | + |
3649 | + total_pallets += po_line.nb_pallets |
3650 | + |
3651 | + for order_cost in order.landed_cost_line_ids: |
3652 | + fiscal_position = False |
3653 | + if order.partner_id.property_account_position: |
3654 | + fiscal_position = order.partner_id.property_account_position.id |
3655 | + |
3656 | + vals_inv = { |
3657 | + 'partner_id': order_cost.partner_id.id, |
3658 | + 'currency_id': order_cost.currency_id.id or order.company_id.currency_id.id, |
3659 | + 'account_id': order_cost.partner_id.property_account_payable.id, |
3660 | + 'type': 'in_invoice', |
3661 | + 'origin': order.name, |
3662 | + 'fiscal_position': fiscal_position, |
3663 | + 'company_id': order.company_id.id, |
3664 | + 'journal_id': len(journal_ids) and journal_ids[0] or False, |
3665 | + } |
3666 | + |
3667 | + inv_id = invoice_obj.create(cr, uid, vals_inv, context=None) |
3668 | + |
3669 | + if all_lines_tracked: |
3670 | + for po_line in order.order_line: |
3671 | + factor = 0.0 |
3672 | + |
3673 | + if order_cost.price_type == 'per_unit': |
3674 | + factor = po_line.product_qty / po_line.order_id.quantity_total |
3675 | + |
3676 | + elif order_cost.price_type == 'value': |
3677 | + factor = po_line.price_subtotal / po_line.order_id.amount_total |
3678 | + |
3679 | + elif order_cost.price_type == 'per_pallet': |
3680 | + factor = po_line.nb_pallets / total_pallets |
3681 | + |
3682 | + else: |
3683 | + raise ValueError( |
3684 | + 'Unknown price type (neither "per_unit", "value" nor "per_pallet")') |
3685 | + |
3686 | + amount = order_cost.amount * factor |
3687 | + vals_line = { |
3688 | + 'product_id': order_cost.product_id.id, |
3689 | + 'name': order_cost.product_id.name, |
3690 | + 'account_id': self._get_product_account_expense_id( |
3691 | + order_cost.product_id), |
3692 | + 'partner_id': order_cost.partner_id.id, |
3693 | + 'invoice_id': inv_id, |
3694 | + 'origin': order.name, |
3695 | + 'account_analytic_id': po_line.account_analytic_id.id, |
3696 | + 'price_unit': amount, |
3697 | + 'invoice_line_tax_id': [(6, 0, [x.id for x in |
3698 | + order_cost.product_id.supplier_taxes_id])], |
3699 | + } |
3700 | + |
3701 | + invoice_line_obj.create(cr, uid, vals_line, context=None) |
3702 | + else: |
3703 | + vals_line = { |
3704 | + 'product_id': order_cost.product_id.id, |
3705 | + 'name': order_cost.product_id.name, |
3706 | + 'account_id': self._get_product_account_expense_id( |
3707 | + order_cost.product_id), |
3708 | + 'partner_id': order_cost.partner_id.id, |
3709 | + 'invoice_id': inv_id, |
3710 | + 'price_unit': order_cost.amount, |
3711 | + 'invoice_line_tax_id': [(6, 0, [x.id for x in |
3712 | + order_cost.product_id.supplier_taxes_id])], |
3713 | + } |
3714 | + |
3715 | + invoice_line_obj.create(cr, uid, vals_line, context=None) |
3716 | + |
3717 | + return res |
3718 | |
3719 | === added file 'purchase_lot_tracking/purchase_lot_tracking.py' |
3720 | --- purchase_lot_tracking/purchase_lot_tracking.py 1970-01-01 00:00:00 +0000 |
3721 | +++ purchase_lot_tracking/purchase_lot_tracking.py 2014-08-27 19:22:25 +0000 |
3722 | @@ -0,0 +1,72 @@ |
3723 | +# -*- coding: utf-8 -*- |
3724 | +############################################################################## |
3725 | +# |
3726 | +# OpenERP, Open Source Management Solution |
3727 | +# Copyright (C) 2013 Savoir-faire Linux (<http://www.savoirfairelinux.com>). |
3728 | +# |
3729 | +# This program is free software: you can redistribute it and/or modify |
3730 | +# it under the terms of the GNU Affero General Public License as |
3731 | +# published by the Free Software Foundation, either version 3 of the |
3732 | +# License, or (at your option) any later version. |
3733 | +# |
3734 | +# This program is distributed in the hope that it will be useful, |
3735 | +# but WITHOUT ANY WARRANTY; without even the implied warranty of |
3736 | +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
3737 | +# GNU Affero General Public License for more details. |
3738 | +# |
3739 | +# You should have received a copy of the GNU Affero General Public License |
3740 | +# along with this program. If not, see <http://www.gnu.org/licenses/>. |
3741 | +# |
3742 | +############################################################################## |
3743 | + |
3744 | +from openerp.osv import orm, fields, osv |
3745 | +from openerp import netsvc |
3746 | +import openerp.addons.decimal_precision as dp |
3747 | + |
3748 | +from datetime import datetime |
3749 | + |
3750 | + |
3751 | + |
3752 | + |
3753 | +#class stock_partial_picking(orm.Model): |
3754 | + |
3755 | +# _inherit = 'stock.picking.in' |
3756 | + |
3757 | +# def action_process(self, cr, uid, ids, context=None): |
3758 | + |
3759 | +# if context is None: |
3760 | +# context = {} |
3761 | +# """Open the partial picking wizard""" |
3762 | +# context.update({ |
3763 | +# 'active_model': self._name, |
3764 | +# 'active_ids': ids, |
3765 | +# 'active_id': len(ids) and ids[0] or False |
3766 | +# }) |
3767 | +# |
3768 | +# for stock_picking in self.browse(cr, uid, ids): |
3769 | +# import ipdb; ipdb.set_trace() |
3770 | +# ref_po_id = self.pool.get('purchase.order').search(cr, uid, [('name', 'like', stock_picking.origin)]) |
3771 | +# ref_po = self.pool.get('purchase.order').browse(cr, uid, ref_po_id)[0] |
3772 | +# |
3773 | +# for stock_picking_line in stock_picking.move_lines: |
3774 | +# |
3775 | +# matching_line = [po_line for po_line in ref_po.order_line if\ |
3776 | +# po_line.product_qty == stock_picking_line.product_qty and \ |
3777 | +# po_line.product_id.id == stock_picking_line.product_id.id][0] |
3778 | +# |
3779 | +## matching_lot = self.pool.get('stock.production.lot').search(cr, uid, [('name', 'like', matching_line.lot)])[0] |
3780 | +# |
3781 | +# stock_picking_line.write({'prodlot_id': matching_lot}) |
3782 | +# stock_picking_line.refresh() |
3783 | + |
3784 | + |
3785 | + |
3786 | +# return { |
3787 | +# 'view_type': 'form', |
3788 | +# 'view_mode': 'form', |
3789 | +# 'res_model': 'stock.partial.picking', |
3790 | +# 'type': 'ir.actions.act_window', |
3791 | +# 'target': 'new', |
3792 | +# 'context': context, |
3793 | +# 'nodestroy': True, |
3794 | +# } |
3795 | |
3796 | === added file 'purchase_lot_tracking/purchase_lot_tracking_view.xml' |
3797 | --- purchase_lot_tracking/purchase_lot_tracking_view.xml 1970-01-01 00:00:00 +0000 |
3798 | +++ purchase_lot_tracking/purchase_lot_tracking_view.xml 2014-08-27 19:22:25 +0000 |
3799 | @@ -0,0 +1,69 @@ |
3800 | +<?xml version="1.0" encoding="utf-8"?> |
3801 | +<openerp> |
3802 | + <data> |
3803 | + <record id="purchase_lot_tracking_product" model="ir.ui.view"> |
3804 | + <field name="name">purchase_lot_tracking.product.view</field> |
3805 | + <field name="model">product.product</field> |
3806 | + <field name="inherit_id" ref="product.product_normal_form_view"/> |
3807 | + <field name="arch" type="xml"> |
3808 | + <field name="taxes_id" position="after"> |
3809 | + <field name="account_id"/> |
3810 | + </field> |
3811 | + </field> |
3812 | + </record> |
3813 | + |
3814 | + <record id="purchase_lot_tracking_product_category" model="ir.ui.view"> |
3815 | + <field name="name">purchase_lot_tracking.product_category.view</field> |
3816 | + <field name="model">product.category</field> |
3817 | + <field name="inherit_id" ref="product.product_category_form_view"/> |
3818 | + <field name="arch" type="xml"> |
3819 | + <field name="type" position="after"> |
3820 | + <group name="analytic_account" string="Analytic Account" colspan="2"> |
3821 | + <field name="account_id"/> |
3822 | + </group> |
3823 | + </field> |
3824 | + </field> |
3825 | + </record> |
3826 | + |
3827 | + <record id="purchase_order_line_readonly_aa" model="ir.ui.view"> |
3828 | + <field name="name">purchase.order.readonly.aa</field> |
3829 | + <field name="model">purchase.order</field> |
3830 | + <field name="inherit_id" ref="purchase.purchase_order_form" /> |
3831 | + <field name="arch" type="xml"> |
3832 | + <field name="account_analytic_id" position="replace"> |
3833 | + <field |
3834 | + name="account_analytic_id" |
3835 | + colspan="2" |
3836 | + groups="purchase.group_analytic_accounting" |
3837 | + attrs="{'readonly': True}" /> |
3838 | + </field> |
3839 | + </field> |
3840 | + </record> |
3841 | + |
3842 | + <record id="purchase_lot_tracking_sale_order" model="ir.ui.view"> |
3843 | + <field name="name">purchase_lot_tracking.sale.order.view</field> |
3844 | + <field name="model">sale.order</field> |
3845 | + <field name="inherit_id" ref="sale.view_order_form"/> |
3846 | + <field name="arch" type="xml"> |
3847 | + <xpath expr="/form/sheet/notebook/page/field[@name='order_line']/tree/field[@name='price_unit']" position="before"> |
3848 | + <field name="minimum" /> |
3849 | + <field name="average" /> |
3850 | + <field name="maximum" /> |
3851 | + </xpath> |
3852 | + </field> |
3853 | + </record> |
3854 | + |
3855 | + <!-- Sequence --> |
3856 | + <record id="seq_type_lot" model="ir.sequence.type"> |
3857 | + <field name="name">ls.lot</field> |
3858 | + <field name="code">ls.lot</field> |
3859 | + </record> |
3860 | + |
3861 | + <record id="seq_lot" model="ir.sequence"> |
3862 | + <field name="name">ls.lot</field> |
3863 | + <field name="code">ls.lot</field> |
3864 | + <field name="prefix">LOT</field> |
3865 | + <field name="padding">6</field> |
3866 | + </record> |
3867 | + </data> |
3868 | +</openerp> |
3869 | |
3870 | === added file 'purchase_lot_tracking/purchase_workflow.xml' |
3871 | --- purchase_lot_tracking/purchase_workflow.xml 1970-01-01 00:00:00 +0000 |
3872 | +++ purchase_lot_tracking/purchase_workflow.xml 2014-08-27 19:22:25 +0000 |
3873 | @@ -0,0 +1,12 @@ |
3874 | +<?xml version="1.0" encoding="utf-8"?> |
3875 | +<openerp> |
3876 | + <data> |
3877 | + <record id="act_confirmed" model="workflow.activity"> |
3878 | + <field name="wkf_id" ref="purchase.purchase_order"/> |
3879 | + <field name="name">confirmed</field> |
3880 | + <field name="split_mode">OR</field> |
3881 | + <field name="kind">function</field> |
3882 | + <field name="action">wkf_confirm_order()</field> |
3883 | + </record> |
3884 | + </data> |
3885 | +</openerp> |
3886 | |
3887 | === added file 'purchase_lot_tracking/sale.py' |
3888 | --- purchase_lot_tracking/sale.py 1970-01-01 00:00:00 +0000 |
3889 | +++ purchase_lot_tracking/sale.py 2014-08-27 19:22:25 +0000 |
3890 | @@ -0,0 +1,95 @@ |
3891 | +# -*- coding: utf-8 -*- |
3892 | +############################################################################## |
3893 | +# |
3894 | +# OpenERP, Open Source Management Solution |
3895 | +# Copyright (C) 2013 Savoir-faire Linux (<http://www.savoirfairelinux.com>). |
3896 | +# |
3897 | +# This program is free software: you can redistribute it and/or modify |
3898 | +# it under the terms of the GNU Affero General Public License as |
3899 | +# published by the Free Software Foundation, either version 3 of the |
3900 | +# License, or (at your option) any later version. |
3901 | +# |
3902 | +# This program is distributed in the hope that it will be useful, |
3903 | +# but WITHOUT ANY WARRANTY; without even the implied warranty of |
3904 | +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
3905 | +# GNU Affero General Public License for more details. |
3906 | +# |
3907 | +# You should have received a copy of the GNU Affero General Public License |
3908 | +# along with this program. If not, see <http://www.gnu.org/licenses/>. |
3909 | +# |
3910 | +############################################################################## |
3911 | + |
3912 | +from openerp.osv import orm, fields |
3913 | +import logging |
3914 | + |
3915 | +class sale(orm.Model): |
3916 | + |
3917 | + _inherit = 'sale.order.line' |
3918 | + _logger = logging.Logger(__name__) |
3919 | + |
3920 | + def _minimum(self, cr, uid, ids, name, arg, context=None): |
3921 | + res = {} |
3922 | + |
3923 | + for order_line in self.browse(cr, uid, ids, context): |
3924 | + account = order_line.product_id.account_id |
3925 | + minimum = 0.0 |
3926 | + |
3927 | + if account: |
3928 | + values = [lot.estimated_tcu for lot in account.child_ids |
3929 | + if lot.total_in_qty != 0] |
3930 | + |
3931 | + if values: |
3932 | + minimum = min(values) |
3933 | + |
3934 | + res[order_line.id] = minimum |
3935 | + |
3936 | + return res |
3937 | + |
3938 | + def _average(self, cr, uid, ids, name, arg, context=None): |
3939 | + res = {} |
3940 | + |
3941 | + for order_line in self.browse(cr, uid, ids, context): |
3942 | + account = order_line.product_id.account_id |
3943 | + average = 0.0 |
3944 | + |
3945 | + total_count = 0 |
3946 | + |
3947 | + if account: |
3948 | + for lot in account.child_ids: |
3949 | + quantity = lot.total_in_qty |
3950 | + tcu = lot.estimated_tcu |
3951 | + |
3952 | + if quantity != 0: |
3953 | + average += quantity * tcu |
3954 | + total_count += quantity |
3955 | + |
3956 | + if total_count == 0: |
3957 | + res[order_line.id] = 0 |
3958 | + else: |
3959 | + res[order_line.id] = average / total_count |
3960 | + |
3961 | + return res |
3962 | + |
3963 | + def _maximum(self, cr, uid, ids, name, arg, context=None): |
3964 | + res = {} |
3965 | + |
3966 | + for order_line in self.browse(cr, uid, ids, context): |
3967 | + account = order_line.product_id.account_id |
3968 | + maximum = 0.0 |
3969 | + |
3970 | + if account: |
3971 | + values = [lot.estimated_tcu for lot in account.child_ids |
3972 | + if lot.total_in_qty != 0] |
3973 | + |
3974 | + if values: |
3975 | + maximum = max(values) |
3976 | + |
3977 | + res[order_line.id] = maximum |
3978 | + |
3979 | + return res |
3980 | + |
3981 | + _columns = { |
3982 | + 'minimum': fields.function(_minimum, string='Min.', type='float'), |
3983 | + 'average': fields.function(_average, string='Avg.', type='float'), |
3984 | + 'maximum': fields.function(_maximum, string='Max.', type='float') |
3985 | + } |
3986 | |
3987 | === added file 'purchase_lot_tracking/stock.py' |
3988 | --- purchase_lot_tracking/stock.py 1970-01-01 00:00:00 +0000 |
3989 | +++ purchase_lot_tracking/stock.py 2014-08-27 19:22:25 +0000 |
3990 | @@ -0,0 +1,141 @@ |
3991 | +# -*- coding: utf-8 -*- |
3992 | +############################################################################## |
3993 | +# |
3994 | +# OpenERP, Open Source Management Solution |
3995 | +# Copyright (C) 2013 Savoir-faire Linux (<http://www.savoirfairelinux.com>). |
3996 | +# |
3997 | +# This program is free software: you can redistribute it and/or modify |
3998 | +# it under the terms of the GNU Affero General Public License as |
3999 | +# published by the Free Software Foundation, either version 3 of the |
4000 | +# License, or (at your option) any later version. |
4001 | +# |
4002 | +# This program is distributed in the hope that it will be useful, |
4003 | +# but WITHOUT ANY WARRANTY; without even the implied warranty of |
4004 | +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
4005 | +# GNU Affero General Public License for more details. |
4006 | +# |
4007 | +# You should have received a copy of the GNU Affero General Public License |
4008 | +# along with this program. If not, see <http://www.gnu.org/licenses/>. |
4009 | +# |
4010 | +############################################################################## |
4011 | + |
4012 | +from openerp.osv import orm, fields |
4013 | +from openerp.tools.translate import _ |
4014 | + |
4015 | +class stock_production_lot(orm.Model): |
4016 | + |
4017 | + _inherit = 'stock.production.lot' |
4018 | + |
4019 | + _columns = { |
4020 | + 'account_analytic_id': fields.many2one('account.analytic.account', 'Analytic Account', required=False) |
4021 | + } |
4022 | + |
4023 | + |
4024 | +class stock_invoice_onshipping(orm.TransientModel): |
4025 | + |
4026 | + _inherit = 'stock.invoice.onshipping' |
4027 | + |
4028 | + def retrieve_move_lines(self, cr, uid, ids, context=None): |
4029 | + """Retrieves all different move lines from the stock picking |
4030 | + """ |
4031 | + move_lines = [] |
4032 | + for pick in self.pool.get('stock.picking').browse(cr, uid, |
4033 | + context['active_ids'], |
4034 | + context=context): |
4035 | + move_lines += pick.move_lines |
4036 | + |
4037 | + return move_lines |
4038 | + |
4039 | + def _retrieve_invoice_lines(self, cr, uid, ids, context=None): |
4040 | + """Retrieves invoice lines of a newly created invoice |
4041 | + |
4042 | + expects invoice_id to be passed in context |
4043 | + """ |
4044 | + invoice = self.pool.get('account.invoice')\ |
4045 | + .browse(cr,uid, context['invoice_id']) |
4046 | + return invoice.invoice_line |
4047 | + |
4048 | + def _find_matching_move_line(self, invoice_line, move_lines): |
4049 | + """Finds the matching invoice line in the move lines list |
4050 | + |
4051 | + It is considered matching if they have the same product quantity |
4052 | + and the same product id. |
4053 | + """ |
4054 | + matching_move_lines = [line for line in move_lines if |
4055 | + line.product_qty == invoice_line.quantity and |
4056 | + line.product_id.id == invoice_line.product_id.id] |
4057 | + |
4058 | + if matching_move_lines: |
4059 | + return matching_move_lines[0] |
4060 | + return None |
4061 | + |
4062 | + def create_invoice(self, cr, uid, ids, context=None): |
4063 | + """ |
4064 | + Creates an invoice when the delivery lots are confirmed |
4065 | + |
4066 | + Iterates through all the lines of the invoice to specify |
4067 | + the proper analytic_account |
4068 | + """ |
4069 | + prod_lot_pool = self.pool.get('stock.production.lot') |
4070 | + # creates the invoice properly |
4071 | + res = super(stock_invoice_onshipping, self)\ |
4072 | + .create_invoice(cr, uid, ids, context=context) |
4073 | + |
4074 | + context['invoice_id'] = res.values()[0] |
4075 | + |
4076 | + # retrieve move lines of stock pickings |
4077 | + move_lines = self.retrieve_move_lines(cr, uid, ids, context=context) |
4078 | + |
4079 | + # retrieve invoice lines of newly create invoice |
4080 | + invoice_lines = self._retrieve_invoice_lines(cr, uid, ids, |
4081 | + context=context) |
4082 | + |
4083 | + # first iteration, check if matching |
4084 | + lst_match = [] |
4085 | + for invoice_line in invoice_lines: |
4086 | + # don't add service to analytic account |
4087 | + if invoice_line.product_id.type == u'service': |
4088 | + continue |
4089 | + matching_move_line = self._find_matching_move_line(invoice_line, |
4090 | + move_lines) |
4091 | + name = invoice_line.name |
4092 | + if not matching_move_line: |
4093 | + msg = _("The item %s is not in stock picking." % name) |
4094 | + raise orm.except_orm(_("Missed line!"), msg) |
4095 | + |
4096 | + # search account analytic |
4097 | + prod_lot_id = matching_move_line.prodlot_id |
4098 | + if not prod_lot_id: |
4099 | + msg = _("The item '%s' missed 'prodlot_id' on associated move \ |
4100 | + item, origin %s." % (name, matching_move_line.origin)) |
4101 | + raise orm.except_orm(_("Missed Serial Number!"), msg) |
4102 | + |
4103 | + matching_prod_lot = prod_lot_pool.browse(cr, uid, prod_lot_id.id) |
4104 | + matching_account = matching_prod_lot.account_analytic_id.id |
4105 | + |
4106 | + lst_match.append((invoice_line, matching_account)) |
4107 | + |
4108 | + # transaction |
4109 | + for invoice_line, matching_account in lst_match: |
4110 | + invoice_line.write({'account_analytic_id': matching_account}) |
4111 | + |
4112 | + return res |
4113 | + |
4114 | + |
4115 | +class stock_picking_out(orm.Model): |
4116 | + |
4117 | + _inherit = 'stock.picking.out' |
4118 | + |
4119 | + def action_process(self, cr, uid, ids, context={}): |
4120 | + '''Check if tracked products have their lot number specified''' |
4121 | + |
4122 | + picking = self.browse(cr, uid, ids, context=context)[0] |
4123 | + |
4124 | + for line in picking.move_lines: |
4125 | + if line.product_id.track_production and not line.prodlot_id.id: |
4126 | + message = ' '.join([ |
4127 | + _('Please specify a lot number for all products of type:'), |
4128 | + line.product_id.name_template]) |
4129 | + raise orm.except_orm(_('Missing lot number'), message) |
4130 | + |
4131 | + return super(stock_picking_out, self).action_process(cr, uid, ids, context) |
4132 | |
4133 | === added directory 'purchase_lot_tracking/wizard' |
4134 | === added file 'purchase_lot_tracking/wizard/__init__.py' |
4135 | --- purchase_lot_tracking/wizard/__init__.py 1970-01-01 00:00:00 +0000 |
4136 | +++ purchase_lot_tracking/wizard/__init__.py 2014-08-27 19:22:25 +0000 |
4137 | @@ -0,0 +1,1 @@ |
4138 | +import stock_partial_picking |
4139 | |
4140 | === added file 'purchase_lot_tracking/wizard/stock_partial_picking.py' |
4141 | --- purchase_lot_tracking/wizard/stock_partial_picking.py 1970-01-01 00:00:00 +0000 |
4142 | +++ purchase_lot_tracking/wizard/stock_partial_picking.py 2014-08-27 19:22:25 +0000 |
4143 | @@ -0,0 +1,53 @@ |
4144 | +# -*- coding: utf-8 -*- |
4145 | +############################################################################## |
4146 | +# |
4147 | +# OpenERP, Open Source Management Solution |
4148 | +# Copyright (C) 2004-TODAY OpenERP SA (<http://openerp.com>). |
4149 | +# |
4150 | +# This program is free software: you can redistribute it and/or modify |
4151 | +# it under the terms of the GNU Affero General Public License as |
4152 | +# published by the Free Software Foundation, either version 3 of the |
4153 | +# License, or (at your option) any later version. |
4154 | +# |
4155 | +# This program is distributed in the hope that it will be useful, |
4156 | +# but WITHOUT ANY WARRANTY; without even the implied warranty of |
4157 | +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
4158 | +# GNU Affero General Public License for more details. |
4159 | +# |
4160 | +# You should have received a copy of the GNU Affero General Public License |
4161 | +# along with this program. If not, see <http://www.gnu.org/licenses/>. |
4162 | +# |
4163 | +############################################################################## |
4164 | + |
4165 | +import time |
4166 | +from lxml import etree |
4167 | +from openerp.osv import fields, osv |
4168 | +from openerp.tools.misc import DEFAULT_SERVER_DATETIME_FORMAT |
4169 | +from openerp.tools.float_utils import float_compare |
4170 | +import openerp.addons.decimal_precision as dp |
4171 | +from openerp.tools.translate import _ |
4172 | + |
4173 | +class stock_partial_picking_line(osv.TransientModel): |
4174 | + |
4175 | + def _tracking(self, cursor, user, ids, name, arg, context=None): |
4176 | + res = {} |
4177 | + for tracklot in self.browse(cursor, user, ids, context=context): |
4178 | + tracking = False |
4179 | + if (tracklot.move_id.picking_id.type == 'in' and tracklot.product_id.track_incoming == True) or \ |
4180 | + (tracklot.move_id.picking_id.type == 'out' and tracklot.product_id.track_outgoing == True): |
4181 | + tracking = True |
4182 | + res[tracklot.id] = tracking |
4183 | + return res |
4184 | + |
4185 | + _inherit = "stock.partial.picking.line" |
4186 | + |
4187 | + def onchange_product_id(self, cr, uid, ids, product_id, context=None): |
4188 | + |
4189 | + raise Exception() |
4190 | + |
4191 | + uom_id = False |
4192 | + if product_id: |
4193 | + product = self.pool.get('product.product').browse(cr, uid, product_id, context=context) |
4194 | + uom_id = product.uom_id.id |
4195 | + return {'value': {'product_uom': uom_id}} |
4196 | + |
4197 | |
4198 | === added directory 'purchase_order_pick_up_date' |
4199 | === added file 'purchase_order_pick_up_date/__init__.py' |
4200 | --- purchase_order_pick_up_date/__init__.py 1970-01-01 00:00:00 +0000 |
4201 | +++ purchase_order_pick_up_date/__init__.py 2014-08-27 19:22:25 +0000 |
4202 | @@ -0,0 +1,22 @@ |
4203 | +# -*- coding: utf-8 -*- |
4204 | +############################################################################## |
4205 | +# |
4206 | +# OpenERP, Open Source Management Solution |
4207 | +# Copyright (C) 2013 Savoir-faire Linux (<http://www.savoirfairelinux.com>). |
4208 | +# |
4209 | +# This program is free software: you can redistribute it and/or modify |
4210 | +# it under the terms of the GNU Affero General Public License as |
4211 | +# published by the Free Software Foundation, either version 3 of the |
4212 | +# License, or (at your option) any later version. |
4213 | +# |
4214 | +# This program is distributed in the hope that it will be useful, |
4215 | +# but WITHOUT ANY WARRANTY; without even the implied warranty of |
4216 | +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
4217 | +# GNU Affero General Public License for more details. |
4218 | +# |
4219 | +# You should have received a copy of the GNU Affero General Public License |
4220 | +# along with this program. If not, see <http://www.gnu.org/licenses/>. |
4221 | +# |
4222 | +############################################################################## |
4223 | + |
4224 | +import purchase |
4225 | |
4226 | === added file 'purchase_order_pick_up_date/__openerp__.py' |
4227 | --- purchase_order_pick_up_date/__openerp__.py 1970-01-01 00:00:00 +0000 |
4228 | +++ purchase_order_pick_up_date/__openerp__.py 2014-08-27 19:22:25 +0000 |
4229 | @@ -0,0 +1,44 @@ |
4230 | +# -*- coding: utf-8 -*- |
4231 | +############################################################################## |
4232 | +# |
4233 | +# OpenERP, Open Source Management Solution |
4234 | +# Copyright (C) 2013 Savoir-faire Linux (<http://www.savoirfairelinux.com>). |
4235 | +# |
4236 | +# This program is free software: you can redistribute it and/or modify |
4237 | +# it under the terms of the GNU Affero General Public License as |
4238 | +# published by the Free Software Foundation, either version 3 of the |
4239 | +# License, or (at your option) any later version. |
4240 | +# |
4241 | +# This program is distributed in the hope that it will be useful, |
4242 | +# but WITHOUT ANY WARRANTY; without even the implied warranty of |
4243 | +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
4244 | +# GNU Affero General Public License for more details. |
4245 | +# |
4246 | +# You should have received a copy of the GNU Affero General Public License |
4247 | +# along with this program. If not, see <http://www.gnu.org/licenses/>. |
4248 | +# |
4249 | +############################################################################## |
4250 | + |
4251 | +{ |
4252 | + 'name': 'Purchase Order Pick Up Date', |
4253 | + 'version': '0.1', |
4254 | + 'author': 'Savoir-faire Linux', |
4255 | + 'maintainer': 'Savoir-faire Linux', |
4256 | + 'website': 'http://www.savoirfairelinux.com', |
4257 | + 'category': 'purchase', |
4258 | + 'description': """ |
4259 | +Add a field for a purchase pick up date |
4260 | +======================================= |
4261 | + |
4262 | +This module lets you specify a scheduled pick up date for a purchase order. |
4263 | +""", |
4264 | + 'depends': ['base', 'purchase'], |
4265 | + 'data': [ |
4266 | + 'purchase_order_pick_up_date_report.xml', |
4267 | + 'purchase_order_pick_up_date_view.xml', |
4268 | + ], |
4269 | + 'demo': [], |
4270 | + 'test': [], |
4271 | + 'installable': True, |
4272 | + 'active': False, |
4273 | +} |
4274 | |
4275 | === added directory 'purchase_order_pick_up_date/i18n' |
4276 | === added file 'purchase_order_pick_up_date/i18n/fr.po' |
4277 | --- purchase_order_pick_up_date/i18n/fr.po 1970-01-01 00:00:00 +0000 |
4278 | +++ purchase_order_pick_up_date/i18n/fr.po 2014-08-27 19:22:25 +0000 |
4279 | @@ -0,0 +1,31 @@ |
4280 | +# Translation of OpenERP Server. |
4281 | +# This file contains the translation of the following modules: |
4282 | +# * purchase_order_pick_up_date |
4283 | +# |
4284 | +msgid "" |
4285 | +msgstr "" |
4286 | +"Project-Id-Version: OpenERP Server 7.0-20130811-231021\n" |
4287 | +"Report-Msgid-Bugs-To: \n" |
4288 | +"POT-Creation-Date: 2013-09-18 14:24+0000\n" |
4289 | +"PO-Revision-Date: 2013-09-18 14:24+0000\n" |
4290 | +"Last-Translator: Alexandre Boily <alexandre.boily@savoirfairelinux.com>\n" |
4291 | +"Language-Team: Savoir-faire Linux\n" |
4292 | +"MIME-Version: 1.0\n" |
4293 | +"Content-Type: text/plain; charset=UTF-8\n" |
4294 | +"Content-Transfer-Encoding: \n" |
4295 | +"Plural-Forms: \n" |
4296 | + |
4297 | +#. module: purchase_order_pick_up_date |
4298 | +#: help:purchase.order,date_pick_up:0 |
4299 | +msgid "Scheduled date where the purchase will arrive at one of your warehouses" |
4300 | +msgstr "Date prévue à laquelle l'achat arrivera à l'un de vos entrepôts" |
4301 | + |
4302 | +#. module: purchase_order_pick_up_date |
4303 | +#: field:purchase.order,date_pick_up:0 |
4304 | +msgid "Pick Up Date" |
4305 | +msgstr "Date de pick up" |
4306 | + |
4307 | +#. module: purchase_order_pick_up_date |
4308 | +#: model:ir.model,name:purchase_order_pick_up_date.model_purchase_order |
4309 | +msgid "Purchase Order" |
4310 | +msgstr "Bon de commande" |
4311 | |
4312 | === added file 'purchase_order_pick_up_date/i18n/purchase_order_pick_up_date.pot' |
4313 | --- purchase_order_pick_up_date/i18n/purchase_order_pick_up_date.pot 1970-01-01 00:00:00 +0000 |
4314 | +++ purchase_order_pick_up_date/i18n/purchase_order_pick_up_date.pot 2014-08-27 19:22:25 +0000 |
4315 | @@ -0,0 +1,32 @@ |
4316 | +# Translation of OpenERP Server. |
4317 | +# This file contains the translation of the following modules: |
4318 | +# * purchase_order_pick_up_date |
4319 | +# |
4320 | +msgid "" |
4321 | +msgstr "" |
4322 | +"Project-Id-Version: OpenERP Server 7.0-20130811-231021\n" |
4323 | +"Report-Msgid-Bugs-To: \n" |
4324 | +"POT-Creation-Date: 2013-09-18 14:24+0000\n" |
4325 | +"PO-Revision-Date: 2013-09-18 14:24+0000\n" |
4326 | +"Last-Translator: <>\n" |
4327 | +"Language-Team: \n" |
4328 | +"MIME-Version: 1.0\n" |
4329 | +"Content-Type: text/plain; charset=UTF-8\n" |
4330 | +"Content-Transfer-Encoding: \n" |
4331 | +"Plural-Forms: \n" |
4332 | + |
4333 | +#. module: purchase_order_pick_up_date |
4334 | +#: help:purchase.order,date_pick_up:0 |
4335 | +msgid "Scheduled date where the purchase will arrive at one of your warehouses" |
4336 | +msgstr "" |
4337 | + |
4338 | +#. module: purchase_order_pick_up_date |
4339 | +#: field:purchase.order,date_pick_up:0 |
4340 | +msgid "Pick Up Date" |
4341 | +msgstr "" |
4342 | + |
4343 | +#. module: purchase_order_pick_up_date |
4344 | +#: model:ir.model,name:purchase_order_pick_up_date.model_purchase_order |
4345 | +msgid "Purchase Order" |
4346 | +msgstr "" |
4347 | + |
4348 | |
4349 | === added file 'purchase_order_pick_up_date/purchase.py' |
4350 | --- purchase_order_pick_up_date/purchase.py 1970-01-01 00:00:00 +0000 |
4351 | +++ purchase_order_pick_up_date/purchase.py 2014-08-27 19:22:25 +0000 |
4352 | @@ -0,0 +1,33 @@ |
4353 | +# -*- coding: utf-8 -*- |
4354 | +############################################################################## |
4355 | +# |
4356 | +# OpenERP, Open Source Management Solution |
4357 | +# Copyright (C) 2013 Savoir-faire Linux (<http://www.savoirfairelinux.com>). |
4358 | +# |
4359 | +# This program is free software: you can redistribute it and/or modify |
4360 | +# it under the terms of the GNU Affero General Public License as |
4361 | +# published by the Free Software Foundation, either version 3 of the |
4362 | +# License, or (at your option) any later version. |
4363 | +# |
4364 | +# This program is distributed in the hope that it will be useful, |
4365 | +# but WITHOUT ANY WARRANTY; without even the implied warranty of |
4366 | +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
4367 | +# GNU Affero General Public License for more details. |
4368 | +# |
4369 | +# You should have received a copy of the GNU Affero General Public License |
4370 | +# along with this program. If not, see <http://www.gnu.org/licenses/>. |
4371 | +# |
4372 | +############################################################################## |
4373 | + |
4374 | +from openerp.osv import orm, fields |
4375 | + |
4376 | +class purchase_order(orm.Model): |
4377 | + |
4378 | + _inherit = 'purchase.order' |
4379 | + |
4380 | + _columns = { |
4381 | + 'date_pick_up': |
4382 | + fields.date( |
4383 | + 'Pick Up Date', |
4384 | + help='''Scheduled date where the purchase will arrive at one of your warehouses'''), |
4385 | + } |
4386 | |
4387 | === added file 'purchase_order_pick_up_date/purchase_order_pick_up_date_report.xml' |
4388 | --- purchase_order_pick_up_date/purchase_order_pick_up_date_report.xml 1970-01-01 00:00:00 +0000 |
4389 | +++ purchase_order_pick_up_date/purchase_order_pick_up_date_report.xml 2014-08-27 19:22:25 +0000 |
4390 | @@ -0,0 +1,21 @@ |
4391 | +<?xml version="1.0" encoding="utf-8" ?> |
4392 | +<openerp> |
4393 | + <data> |
4394 | + <report |
4395 | + auto="False" |
4396 | + id="purchase.report_purchase_quotation" |
4397 | + model="purchase.order" |
4398 | + name="purchase.quotation" |
4399 | + rml="purchase_order_pick_up_date/report/request_quotation.rml" |
4400 | + usage="default" |
4401 | + string="Request for Quotation" /> |
4402 | + |
4403 | + <report |
4404 | + auto="False" |
4405 | + id="purchase.report_purchase_order" |
4406 | + model="purchase.order" |
4407 | + name="purchase.order" |
4408 | + rml="purchase_order_pick_up_date/report/order.rml" |
4409 | + string="Purchase Order" /> |
4410 | + </data> |
4411 | +</openerp> |
4412 | |
4413 | === added file 'purchase_order_pick_up_date/purchase_order_pick_up_date_view.xml' |
4414 | --- purchase_order_pick_up_date/purchase_order_pick_up_date_view.xml 1970-01-01 00:00:00 +0000 |
4415 | +++ purchase_order_pick_up_date/purchase_order_pick_up_date_view.xml 2014-08-27 19:22:25 +0000 |
4416 | @@ -0,0 +1,26 @@ |
4417 | +<?xml version="1.0" encoding="utf-8" ?> |
4418 | +<openerp> |
4419 | + <data> |
4420 | + <record id="purchase_order_pick_up_date_tree" model="ir.ui.view"> |
4421 | + <field name="name">purchase.order.pick.tree</field> |
4422 | + <field name="model">purchase.order</field> |
4423 | + <field name="inherit_id" ref="purchase.purchase_order_tree" /> |
4424 | + <field name="arch" type="xml"> |
4425 | + <field name="minimum_planned_date" position="after"> |
4426 | + <field name="date_pick_up" /> |
4427 | + </field> |
4428 | + </field> |
4429 | + </record> |
4430 | + |
4431 | + <record id="purchase_order_pick_up_date_form" model="ir.ui.view"> |
4432 | + <field name="name">purchase.order.pick.form</field> |
4433 | + <field name="model">purchase.order</field> |
4434 | + <field name="inherit_id" ref="purchase.purchase_order_form" /> |
4435 | + <field name="arch" type="xml"> |
4436 | + <field name="date_order" position="after"> |
4437 | + <field name="date_pick_up" /> |
4438 | + </field> |
4439 | + </field> |
4440 | + </record> |
4441 | + </data> |
4442 | +</openerp> |
4443 | |
4444 | === added directory 'purchase_order_pick_up_date/report' |
4445 | === added file 'purchase_order_pick_up_date/report/order.rml' |
4446 | --- purchase_order_pick_up_date/report/order.rml 1970-01-01 00:00:00 +0000 |
4447 | +++ purchase_order_pick_up_date/report/order.rml 2014-08-27 19:22:25 +0000 |
4448 | @@ -0,0 +1,335 @@ |
4449 | +<?xml version="1.0" encoding="utf-8" ?> |
4450 | +<document filename="Purchase Order.pdf"> |
4451 | + <template title="Purchase Order" author="Savoir-faire Linux (support@savoirfairelinux.com)" allowSplitting="20"> |
4452 | + <pageTemplate id="first"> |
4453 | + <frame id="first" x1="18.0" y1="42.0" width="535" height="758"/> |
4454 | + </pageTemplate> |
4455 | + </template> |
4456 | + <stylesheet> |
4457 | + <blockTableStyle id="Standard_Outline"> |
4458 | + <blockAlignment value="LEFT"/> |
4459 | + <blockValign value="TOP"/> |
4460 | + </blockTableStyle> |
4461 | + <blockTableStyle id="Tableau1"> |
4462 | + <blockAlignment value="LEFT"/> |
4463 | + <blockValign value="TOP"/> |
4464 | + </blockTableStyle> |
4465 | + <blockTableStyle id="Tableau2"> |
4466 | + <blockAlignment value="LEFT"/> |
4467 | + <blockValign value="TOP"/> |
4468 | + </blockTableStyle> |
4469 | + <blockTableStyle id="Header_Order_Reference_Tbl"> |
4470 | + <blockAlignment value="LEFT"/> |
4471 | + <blockValign value="TOP"/> |
4472 | + <lineStyle kind="LINEBEFORE" colorName="#e6e6e6" start="0,0" stop="0,-1"/> |
4473 | + <lineStyle kind="LINEABOVE" colorName="#e6e6e6" start="0,0" stop="0,0"/> |
4474 | + <lineStyle kind="LINEBELOW" colorName="#e6e6e6" start="0,-1" stop="0,-1"/> |
4475 | + <lineStyle kind="LINEBEFORE" colorName="#e6e6e6" start="1,0" stop="1,-1"/> |
4476 | + <lineStyle kind="LINEABOVE" colorName="#e6e6e6" start="1,0" stop="1,0"/> |
4477 | + <lineStyle kind="LINEBELOW" colorName="#e6e6e6" start="1,-1" stop="1,-1"/> |
4478 | + <lineStyle kind="LINEBEFORE" colorName="#e6e6e6" start="2,0" stop="2,-1"/> |
4479 | + <lineStyle kind="LINEABOVE" colorName="#e6e6e6" start="2,0" stop="2,0"/> |
4480 | + <lineStyle kind="LINEBELOW" colorName="#e6e6e6" start="2,-1" stop="2,-1"/> |
4481 | + <lineStyle kind="LINEBEFORE" colorName="#e6e6e6" start="3,0" stop="3,-1"/> |
4482 | + <lineStyle kind="LINEABOVE" colorName="#e6e6e6" start="3,0" stop="3,0"/> |
4483 | + <lineStyle kind="LINEBELOW" colorName="#e6e6e6" start="3,-1" stop="3,-1"/> |
4484 | + <lineStyle kind="LINEBEFORE" colorName="#e6e6e6" start="4,0" stop="4,-1"/> |
4485 | + <lineStyle kind="LINEAFTER" colorName="#e6e6e6" start="4,0" stop="4,-1"/> |
4486 | + <lineStyle kind="LINEABOVE" colorName="#e6e6e6" start="4,0" stop="4,0"/> |
4487 | + <lineStyle kind="LINEBELOW" colorName="#e6e6e6" start="4,-1" stop="4,-1"/> |
4488 | + </blockTableStyle> |
4489 | + <blockTableStyle id="Content_Order_Reference_Table"> |
4490 | + <blockAlignment value="LEFT"/> |
4491 | + <blockValign value="TOP"/> |
4492 | + <lineStyle kind="LINEBEFORE" colorName="#e6e6e6" start="0,0" stop="0,-1"/> |
4493 | + <lineStyle kind="LINEABOVE" colorName="#e6e6e6" start="0,0" stop="0,0"/> |
4494 | + <lineStyle kind="LINEBELOW" colorName="#e6e6e6" start="0,-1" stop="0,-1"/> |
4495 | + <lineStyle kind="LINEBEFORE" colorName="#e6e6e6" start="1,0" stop="1,-1"/> |
4496 | + <lineStyle kind="LINEABOVE" colorName="#e6e6e6" start="1,0" stop="1,0"/> |
4497 | + <lineStyle kind="LINEBELOW" colorName="#e6e6e6" start="1,-1" stop="1,-1"/> |
4498 | + <lineStyle kind="LINEBEFORE" colorName="#e6e6e6" start="2,0" stop="2,-1"/> |
4499 | + <lineStyle kind="LINEABOVE" colorName="#e6e6e6" start="2,0" stop="2,0"/> |
4500 | + <lineStyle kind="LINEBELOW" colorName="#e6e6e6" start="2,-1" stop="2,-1"/> |
4501 | + <lineStyle kind="LINEBEFORE" colorName="#e6e6e6" start="3,0" stop="3,-1"/> |
4502 | + <lineStyle kind="LINEABOVE" colorName="#e6e6e6" start="3,0" stop="3,0"/> |
4503 | + <lineStyle kind="LINEBELOW" colorName="#e6e6e6" start="3,-1" stop="3,-1"/> |
4504 | + <lineStyle kind="LINEBEFORE" colorName="#e6e6e6" start="4,0" stop="4,-1"/> |
4505 | + <lineStyle kind="LINEAFTER" colorName="#e6e6e6" start="4,0" stop="4,-1"/> |
4506 | + <lineStyle kind="LINEABOVE" colorName="#e6e6e6" start="4,0" stop="4,0"/> |
4507 | + <lineStyle kind="LINEBELOW" colorName="#e6e6e6" start="4,-1" stop="4,-1"/> |
4508 | + </blockTableStyle> |
4509 | + <blockTableStyle id="Table_Header_Pur_ord_Line"> |
4510 | + <blockAlignment value="LEFT"/> |
4511 | + <blockValign value="TOP"/> |
4512 | + <lineStyle kind="LINEBELOW" colorName="#000000" start="0,-1" stop="0,-1"/> |
4513 | + <lineStyle kind="LINEBELOW" colorName="#000000" start="1,-1" stop="1,-1"/> |
4514 | + <lineStyle kind="LINEBELOW" colorName="#000000" start="2,-1" stop="2,-1"/> |
4515 | + <lineStyle kind="LINEBELOW" colorName="#000000" start="3,-1" stop="3,-1"/> |
4516 | + <lineStyle kind="LINEBELOW" colorName="#000000" start="4,-1" stop="4,-1"/> |
4517 | + <lineStyle kind="LINEBELOW" colorName="#000000" start="5,-1" stop="5,-1"/> |
4518 | + </blockTableStyle> |
4519 | + <blockTableStyle id="Table_Order_Pur_line_Content"> |
4520 | + <blockAlignment value="LEFT"/> |
4521 | + <blockValign value="TOP"/> |
4522 | + <lineStyle kind="LINEBELOW" colorName="#e6e6e6" start="0,-1" stop="0,-1"/> |
4523 | + <lineStyle kind="LINEBELOW" colorName="#e6e6e6" start="1,-1" stop="1,-1"/> |
4524 | + <lineStyle kind="LINEBELOW" colorName="#e6e6e6" start="2,-1" stop="2,-1"/> |
4525 | + <lineStyle kind="LINEBELOW" colorName="#e6e6e6" start="3,-1" stop="3,-1"/> |
4526 | + <lineStyle kind="LINEBELOW" colorName="#e6e6e6" start="4,-1" stop="4,-1"/> |
4527 | + <lineStyle kind="LINEBELOW" colorName="#e6e6e6" start="5,-1" stop="5,-1"/> |
4528 | + <lineStyle kind="LINEBELOW" colorName="#e6e6e6" start="0,-1" stop="0,-1"/> |
4529 | + <lineStyle kind="LINEBELOW" colorName="#e6e6e6" start="1,-1" stop="1,-1"/> |
4530 | + <lineStyle kind="LINEBELOW" colorName="#e6e6e6" start="2,-1" stop="2,-1"/> |
4531 | + <lineStyle kind="LINEBELOW" colorName="#e6e6e6" start="3,-1" stop="3,-1"/> |
4532 | + <lineStyle kind="LINEBELOW" colorName="#e6e6e6" start="4,-1" stop="4,-1"/> |
4533 | + <lineStyle kind="LINEBELOW" colorName="#e6e6e6" start="5,-1" stop="5,-1"/> |
4534 | + </blockTableStyle> |
4535 | + <blockTableStyle id="Table_All_Total_Detail"> |
4536 | + <blockAlignment value="LEFT"/> |
4537 | + <blockValign value="TOP"/> |
4538 | + <lineStyle kind="LINEABOVE" colorName="#ffffff" start="0,0" stop="0,0"/> |
4539 | + <lineStyle kind="LINEABOVE" colorName="#000000" start="1,0" stop="1,0"/> |
4540 | + <lineStyle kind="LINEABOVE" colorName="#000000" start="2,0" stop="2,0"/> |
4541 | + <lineStyle kind="LINEABOVE" colorName="#000000" start="1,2" stop="1,2"/> |
4542 | + <lineStyle kind="LINEABOVE" colorName="#000000" start="2,2" stop="2,2"/> |
4543 | + </blockTableStyle> |
4544 | + <blockTableStyle id="Table_Outer_Notes"> |
4545 | + <blockAlignment value="LEFT"/> |
4546 | + <blockValign value="TOP"/> |
4547 | + </blockTableStyle> |
4548 | + <initialize> |
4549 | + <paraStyle name="all" alignment="justify"/> |
4550 | + </initialize> |
4551 | + <paraStyle name="terp_header" fontSize="12.0" leading="15" alignment="LEFT" spaceBefore="12.0" spaceAfter="6.0"/> |
4552 | + <paraStyle name="terp_tblheader_General" fontSize="8.0" leading="10" alignment="LEFT" spaceBefore="6.0" spaceAfter="6.0"/> |
4553 | + <paraStyle name="terp_default_8" fontSize="8.0" leading="10" alignment="LEFT" spaceBefore="0.0" spaceAfter="0.0"/> |
4554 | + <paraStyle name="terp_tblheader_General_Centre" fontSize="8.0" leading="10" alignment="CENTER" spaceBefore="6.0" spaceAfter="6.0"/> |
4555 | + <paraStyle name="terp_tblheader_General_Right" fontSize="8.0" leading="10" alignment="RIGHT" spaceBefore="6.0" spaceAfter="6.0"/> |
4556 | + <paraStyle name="terp_default_Centre_8" fontSize="8.0" leading="10" alignment="CENTER" spaceBefore="0.0" spaceAfter="0.0"/> |
4557 | + <paraStyle name="terp_default_9" fontSize="9.0" leading="11" alignment="LEFT" spaceBefore="0.0" spaceAfter="0.0"/> |
4558 | + <paraStyle name="terp_default_Bold_9" fontSize="9.0" leading="11" alignment="LEFT" spaceBefore="0.0" spaceAfter="0.0"/> |
4559 | + <paraStyle name="terp_default_Right_9" fontSize="9.0" leading="11" alignment="RIGHT" spaceBefore="0.0" spaceAfter="0.0"/> |
4560 | + <paraStyle name="terp_default_Bold_9_Right" fontSize="9.0" leading="11" alignment="RIGHT" spaceBefore="0.0" spaceAfter="0.0"/> |
4561 | + <images/> |
4562 | + </stylesheet> |
4563 | + <story> |
4564 | + <pto> |
4565 | + <para style="terp_default_8">[[repeatIn(objects,'o')]]</para> |
4566 | + <para style="terp_default_8">[[ setLang(o.partner_id.lang) ]]</para> |
4567 | + <pto_header> |
4568 | + <blockTable colWidths="180.0,70.0,60.0,80.0,60.0,85.0" repeatRows="1" style="Table_Header_Pur_ord_Line"> |
4569 | + <tr> |
4570 | + <td> |
4571 | + <para style="terp_tblheader_General"><b>Description</b></para> |
4572 | + </td> |
4573 | + <td> |
4574 | + <para style="terp_tblheader_General"><b>Taxes</b></para> |
4575 | + </td> |
4576 | + <td> |
4577 | + <para style="terp_tblheader_General"><b>Date Req.</b></para> |
4578 | + </td> |
4579 | + <td> |
4580 | + <para style="terp_tblheader_General_Right"><b>Qty</b></para> |
4581 | + </td> |
4582 | + <td> |
4583 | + <para style="terp_tblheader_General_Right"><b>Unit Price</b></para> |
4584 | + </td> |
4585 | + <td> |
4586 | + <para style="terp_tblheader_General_Right"><b>Net Price</b></para> |
4587 | + </td> |
4588 | + </tr> |
4589 | + </blockTable> |
4590 | + </pto_header> |
4591 | + <para style="terp_default_9"> |
4592 | + <font color="white"> </font> |
4593 | + </para> |
4594 | + <blockTable colWidths="253.0,59.0,223.0" style="Tableau1"> |
4595 | + <tr> |
4596 | + <td> |
4597 | + <blockTable colWidths="253.0" style="Tableau2"> |
4598 | + <tr> |
4599 | + <td> |
4600 | + <para style="terp_default_Bold_9"><b>Shipping address :</b></para> |
4601 | + <para style="terp_default_9">[[ (o.dest_address_id and o.dest_address_id.name) or (o.warehouse_id and o.warehouse_id.name) or '']]</para> |
4602 | + <para style="terp_default_9">[[ (o.dest_address_id and display_address(o.dest_address_id)) or (o.warehouse_id and display_address(o.warehouse_id.partner_id)) or '']]</para> |
4603 | + </td> |
4604 | + </tr> |
4605 | + </blockTable> |
4606 | + <para style="terp_default_9"> |
4607 | + <font color="white"> </font> |
4608 | + </para> |
4609 | + </td> |
4610 | + <td> |
4611 | + <para style="terp_default_9"> |
4612 | + <font color="white"> </font> |
4613 | + </para> |
4614 | + </td> |
4615 | + <td> |
4616 | + <para style="terp_default_9">[[ (o.partner_id and o.partner_id.title and o.partner_id.title.name) or '' ]] [[ (o.partner_id and o.partner_id.name) or '' ]]</para> |
4617 | + <para style="terp_default_9">[[ o.partner_id and display_address(o.partner_id) ]] </para> |
4618 | + <para style="terp_default_9"> |
4619 | + <font color="white"> </font> |
4620 | + </para> |
4621 | + <para style="terp_default_9">Tel : [[ (o.partner_id.phone) or removeParentNode('para') ]]</para> |
4622 | + <para style="terp_default_9">Fax : [[ (o.partner_id.fax) or removeParentNode('para') ]]</para> |
4623 | + <para style="terp_default_9">TIN : [[ (o.partner_id.vat) or removeParentNode('para') ]]</para> |
4624 | + </td> |
4625 | + </tr> |
4626 | + </blockTable> |
4627 | + <para style="terp_default_9"> |
4628 | + <font color="white"> </font> |
4629 | + </para> |
4630 | + <para style="terp_header"><b>[[ o.state=='draft' and removeParentNode('para') ]] Purchase Order Confirmation N° [[ o.name ]]</b></para> |
4631 | + <para style="terp_header"><b>[[ o.state<>'draft' and removeParentNode('para') ]] Request for Quotation N° [[ o.name ]]</b></para> |
4632 | + <para style="terp_default_8"> |
4633 | + <font color="white"> </font> |
4634 | + </para> |
4635 | + <blockTable colWidths="106.8,106.8,106.8,106.8,106.8" style="Header_Order_Reference_Tbl"> |
4636 | + <tr> |
4637 | + <td> |
4638 | + <para style="terp_tblheader_General_Centre"><b>Our Order Reference</b></para> |
4639 | + </td> |
4640 | + <td> |
4641 | + <para style="terp_tblheader_General_Centre"><b>Your Order Reference</b></para> |
4642 | + </td> |
4643 | + <td> |
4644 | + <para style="terp_tblheader_General_Centre"><b>Order Date</b></para> |
4645 | + </td> |
4646 | + |
4647 | + <td> |
4648 | + <para style="terp_tblheader_General_Centre"><b>Pick Up Date</b></para> |
4649 | + </td> |
4650 | + |
4651 | + <td> |
4652 | + <para style="terp_tblheader_General_Centre"><b>Validated By</b></para> |
4653 | + </td> |
4654 | + </tr> |
4655 | + </blockTable> |
4656 | + <blockTable colWidths="106.8,106.8,106.8,106.8,106.8" style="Content_Order_Reference_Table"> |
4657 | + <tr> |
4658 | + <td> |
4659 | + <para style="terp_default_Centre_8">[[ o.name or '' ]]</para> |
4660 | + </td> |
4661 | + <td> |
4662 | + <para style="terp_default_Centre_8">[[ o.partner_ref or '' ]]</para> |
4663 | + </td> |
4664 | + <td> |
4665 | + <para style="terp_default_Centre_8">[[formatLang(o.date_order,date=True) ]]</para> |
4666 | + </td> |
4667 | + |
4668 | + <td> |
4669 | + <para style="terp_default_Centre_8">[[ formatLang(o.date_pick_up, date=True) ]]</para> |
4670 | + </td> |
4671 | + |
4672 | + <td> |
4673 | + <para style="terp_default_Centre_8">[[ (o.validator and o.validator.name) or '' ]]</para> |
4674 | + </td> |
4675 | + </tr> |
4676 | + </blockTable> |
4677 | + <para style="terp_default_9"> |
4678 | + <font color="white"> </font> |
4679 | + </para> |
4680 | + <blockTable colWidths="180.0,70.0,60.0,80.0,60.0,85.0" repeatRows="1" style="Table_Header_Pur_ord_Line"> |
4681 | + <tr> |
4682 | + <td> |
4683 | + <para style="terp_tblheader_General"><b>Description</b></para> |
4684 | + </td> |
4685 | + <td> |
4686 | + <para style="terp_tblheader_General"><b>Taxes</b></para> |
4687 | + </td> |
4688 | + <td> |
4689 | + <para style="terp_tblheader_General"><b>Date Req.</b></para> |
4690 | + </td> |
4691 | + <td> |
4692 | + <para style="terp_tblheader_General_Right"><b>Qty</b></para> |
4693 | + </td> |
4694 | + <td> |
4695 | + <para style="terp_tblheader_General_Right"><b>Unit Price</b></para> |
4696 | + </td> |
4697 | + <td> |
4698 | + <para style="terp_tblheader_General_Right"><b>Net Price</b></para> |
4699 | + </td> |
4700 | + </tr> |
4701 | + </blockTable> |
4702 | + <section> |
4703 | + <para style="terp_default_8">[[repeatIn(o.order_line,'line')]]</para> |
4704 | + <blockTable colWidths="180.0,70.0,60.0,80.0,60.0,85.0" style="Table_Order_Pur_line_Content"> |
4705 | + <tr> |
4706 | + <td> |
4707 | + <para style="terp_default_9">[[ line.name ]]</para> |
4708 | + </td> |
4709 | + <td> |
4710 | + <para style="terp_default_9">[[ ', '.join(map(lambda x: x.name, line.taxes_id)) ]]</para> |
4711 | + </td> |
4712 | + <td> |
4713 | + <para style="terp_default_9">[[ formatLang( line.date_planned, date=True) ]]</para> |
4714 | + </td> |
4715 | + <td> |
4716 | + <para style="terp_default_Right_9">[[ formatLang(line.product_qty ) ]] [[ line.product_uom.name ]] </para> |
4717 | + </td> |
4718 | + <td> |
4719 | + <para style="terp_default_Right_9">[[ formatLang(line.price_unit, digits=get_digits(dp='Product Price') ) ]]</para> |
4720 | + </td> |
4721 | + <td> |
4722 | + <para style="terp_default_Right_9">[[ formatLang(line.price_subtotal, digits=get_digits(dp='Account'), currency_obj=o.pricelist_id.currency_id ) ]]</para> |
4723 | + </td> |
4724 | + </tr> |
4725 | + </blockTable> |
4726 | + </section> |
4727 | + <blockTable colWidths="375.0,60.0,100.0" style="Table_All_Total_Detail"> |
4728 | + <tr> |
4729 | + <td> |
4730 | + <para style="terp_default_9"> |
4731 | + <font color="white"> </font> |
4732 | + </para> |
4733 | + </td> |
4734 | + <td> |
4735 | + <para style="terp_default_9">Net Total :</para> |
4736 | + </td> |
4737 | + <td> |
4738 | + <para style="terp_default_Right_9">[[ formatLang(o.amount_untaxed, digits=get_digits(dp='Account'), currency_obj=o.pricelist_id.currency_id ) ]]</para> |
4739 | + </td> |
4740 | + </tr> |
4741 | + <tr> |
4742 | + <td> |
4743 | + <para style="terp_default_9"> |
4744 | + <font color="white"> </font> |
4745 | + </para> |
4746 | + </td> |
4747 | + <td> |
4748 | + <para style="terp_default_9">Taxes :</para> |
4749 | + </td> |
4750 | + <td> |
4751 | + <para style="terp_default_Right_9">[[ formatLang(o.amount_tax, dp='Account', currency_obj=o.pricelist_id.currency_id) ]]</para> |
4752 | + </td> |
4753 | + </tr> |
4754 | + <tr> |
4755 | + <td> |
4756 | + <para style="terp_default_9"> |
4757 | + <font color="white"> </font> |
4758 | + </para> |
4759 | + </td> |
4760 | + <td> |
4761 | + <para style="terp_default_Bold_9"><b>Total :</b></para> |
4762 | + </td> |
4763 | + <td> |
4764 | + <para style="terp_default_Bold_9_Right"><b>[[ formatLang(o.amount_total, digits=get_digits(dp='Account') , currency_obj=o.pricelist_id.currency_id) ]]</b></para> |
4765 | + </td> |
4766 | + </tr> |
4767 | + </blockTable> |
4768 | + <para style="terp_default_8"> |
4769 | + <font color="white"> </font> |
4770 | + </para> |
4771 | + <blockTable colWidths="535.0" style="Table_Outer_Notes"> |
4772 | + <tr> |
4773 | + <td> |
4774 | + <para style="terp_default_9">[[ format(o.notes or '') ]]</para> |
4775 | + </td> |
4776 | + </tr> |
4777 | + </blockTable> |
4778 | + <para style="terp_default_9"> |
4779 | + <font color="white"> </font> |
4780 | + </para> |
4781 | + </pto> |
4782 | + </story> |
4783 | +</document> |
4784 | |
4785 | === added file 'purchase_order_pick_up_date/report/request_quotation.rml' |
4786 | --- purchase_order_pick_up_date/report/request_quotation.rml 1970-01-01 00:00:00 +0000 |
4787 | +++ purchase_order_pick_up_date/report/request_quotation.rml 2014-08-27 19:22:25 +0000 |
4788 | @@ -0,0 +1,156 @@ |
4789 | +<?xml version="1.0" encoding="utf-8" ?> |
4790 | +<document filename="requestforquotation.pdf"> |
4791 | + <template pageSize="(595.0,842.0)" title="Test" author="Savoir-faire Linux (support@savoirfairelinux.com)" allowSplitting="20"> |
4792 | + <pageTemplate id="first"> |
4793 | + <frame id="first" x1="23.0" y1="43.0" width="530" height="799"/> |
4794 | + </pageTemplate> |
4795 | + </template> |
4796 | + <stylesheet> |
4797 | + <blockTableStyle id="Standard_Outline"> |
4798 | + <blockAlignment value="LEFT"/> |
4799 | + <blockValign value="TOP"/> |
4800 | + </blockTableStyle> |
4801 | + <blockTableStyle id="Tableau1"> |
4802 | + <blockAlignment value="LEFT"/> |
4803 | + <blockValign value="TOP"/> |
4804 | + </blockTableStyle> |
4805 | + <blockTableStyle id="Tableau2"> |
4806 | + <blockAlignment value="LEFT"/> |
4807 | + <blockValign value="TOP"/> |
4808 | + </blockTableStyle> |
4809 | + <blockTableStyle id="Table_Product_Header_Title"> |
4810 | + <blockAlignment value="LEFT"/> |
4811 | + <blockValign value="TOP"/> |
4812 | + <lineStyle kind="LINEBELOW" colorName="#000000" start="0,-1" stop="0,-1"/> |
4813 | + <lineStyle kind="LINEBELOW" colorName="#000000" start="1,-1" stop="1,-1"/> |
4814 | + <lineStyle kind="LINEBELOW" colorName="#000000" start="2,-1" stop="2,-1"/> |
4815 | + </blockTableStyle> |
4816 | + <blockTableStyle id="Table_Product_Line"> |
4817 | + <blockAlignment value="LEFT"/> |
4818 | + <blockValign value="TOP"/> |
4819 | + <lineStyle kind="LINEBELOW" colorName="#e6e6e6" start="0,-1" stop="0,-1"/> |
4820 | + <lineStyle kind="LINEBELOW" colorName="#e6e6e6" start="1,-1" stop="1,-1"/> |
4821 | + <lineStyle kind="LINEBELOW" colorName="#e6e6e6" start="2,-1" stop="2,-1"/> |
4822 | + <lineStyle kind="LINEBELOW" colorName="#e6e6e6" start="3,-1" stop="3,-1"/> |
4823 | + </blockTableStyle> |
4824 | + <initialize> |
4825 | + <paraStyle name="all" alignment="justify"/> |
4826 | + </initialize> |
4827 | + <paraStyle name="P1" fontSize="9.0" leading="11" alignment="LEFT" spaceBefore="0.0" spaceAfter="0.0"/> |
4828 | + <paraStyle name="Standard"/> |
4829 | + <paraStyle name="terp_header" fontSize="12.0" leading="15" alignment="LEFT" spaceBefore="12.0" spaceAfter="6.0"/> |
4830 | + <paraStyle name="terp_tblheader_Details" fontSize="9.0" leading="11" alignment="LEFT" spaceBefore="6.0" spaceAfter="6.0"/> |
4831 | + <paraStyle name="terp_default_8" fontSize="8.0" leading="10" alignment="LEFT" spaceBefore="0.0" spaceAfter="0.0"/> |
4832 | + <paraStyle name="terp_tblheader_Details_Centre" fontSize="9.0" leading="11" alignment="CENTER" spaceBefore="6.0" spaceAfter="6.0"/> |
4833 | + <paraStyle name="terp_default_9" fontSize="9.0" leading="11" alignment="LEFT" spaceBefore="0.0" spaceAfter="0.0"/> |
4834 | + <paraStyle name="terp_default_Bold_9" fontSize="9.0" leading="11" alignment="LEFT" spaceBefore="0.0" spaceAfter="0.0"/> |
4835 | + <paraStyle name="terp_default_Centre_9" fontSize="9.0" leading="11" alignment="CENTER" spaceBefore="0.0" spaceAfter="0.0"/> |
4836 | + <paraStyle name="terp_default_Right_9" fontSize="9.0" leading="11" alignment="RIGHT" spaceBefore="0.0" spaceAfter="0.0"/> |
4837 | + <paraStyle name="Space bet user and signature" fontSize="4.0" leading="5" alignment="LEFT" spaceBefore="0.0" spaceAfter="0.0"/> |
4838 | + <images/> |
4839 | + </stylesheet> |
4840 | + <story> |
4841 | + <para style="terp_default_9">[[repeatIn(objects,'order')]]</para> |
4842 | + <para style="terp_default_9">[[ setLang(order.partner_id.lang) ]]</para> |
4843 | + <para style="terp_default_9"> |
4844 | + <font color="white"> </font> |
4845 | + </para> |
4846 | + <blockTable colWidths="250.0,59.0,221.0" style="Tableau1"> |
4847 | + <tr> |
4848 | + <td> |
4849 | + <blockTable colWidths="250.0" style="Tableau2"> |
4850 | + <tr> |
4851 | + <td> |
4852 | + <para style="terp_default_Bold_9"><b>Expected Delivery address:</b></para> |
4853 | + <para style="terp_default_9">[[ (order.dest_address_id and order.dest_address_id.name) or (order.warehouse_id and order.warehouse_id.name) or '']]</para> |
4854 | + <para style="P1">[[ order.dest_address_id and display_address(order.dest_address_id) ]]</para> |
4855 | + </td> |
4856 | + </tr> |
4857 | + </blockTable> |
4858 | + <para style="terp_default_9"> |
4859 | + <font color="white"> </font> |
4860 | + </para> |
4861 | + </td> |
4862 | + <td> |
4863 | + <para style="terp_default_9"> |
4864 | + <font color="white"> </font> |
4865 | + </para> |
4866 | + </td> |
4867 | + <td> |
4868 | + <para style="terp_default_9">[[ (order .partner_id and order.partner_id.title and order.partner_id.title.name) or '' ]] [[ (order .partner_id and order.partner_id.name) or '' ]] </para> |
4869 | + <para style="terp_default_9">[[ order.partner_id and display_address(order .partner_id) ]] </para> |
4870 | + <para style="terp_default_9"> |
4871 | + <font color="white"> </font> |
4872 | + </para> |
4873 | + <para style="terp_default_9">Tel.: [[ (order.partner_id and order.partner_id.phone) or removeParentNode('para') ]]</para> |
4874 | + <para style="terp_default_9">Fax: [[ (order.partner_id and order.partner_id.fax) or removeParentNode('para') ]]</para> |
4875 | + <para style="P1">TVA: [[ (order.partner_id and order.partner_id.vat) or removeParentNode('para') ]]</para> |
4876 | + </td> |
4877 | + </tr> |
4878 | + </blockTable> |
4879 | + <para style="Standard"> |
4880 | + <font color="white"> </font> |
4881 | + </para> |
4882 | + |
4883 | + <blockTable colWidths="524.0" style="Tableau1"> |
4884 | + <tr> |
4885 | + <td> |
4886 | + <para style="terp_default_9">Expected Pick Up Date: [[ (order.date_pick_up and formatLang(order.date_pick_up, date=True)) or removeParentNode('para') and '']]</para> |
4887 | + </td> |
4888 | + </tr> |
4889 | + </blockTable> |
4890 | + <para style="terp_header"><b>Request for Quotation : [[order.name]]</b></para> |
4891 | + |
4892 | + <para style="terp_default_8"> |
4893 | + <font color="white"> </font> |
4894 | + </para> |
4895 | + |
4896 | + <blockTable colWidths="371.0,98.0,61.0" repeatRows="1" style="Table_Product_Header_Title"> |
4897 | + <tr> |
4898 | + <td> |
4899 | + <para style="terp_tblheader_Details"><b>Description</b></para> |
4900 | + </td> |
4901 | + <td> |
4902 | + <para style="terp_tblheader_Details_Centre"><b>Expected Date</b></para> |
4903 | + </td> |
4904 | + <td> |
4905 | + <para style="terp_tblheader_Details_Centre"><b>Qty</b></para> |
4906 | + </td> |
4907 | + </tr> |
4908 | + </blockTable> |
4909 | + <section> |
4910 | + <para style="terp_default_9">[[ repeatIn(order.order_line,'order_line') ]]</para> |
4911 | + <blockTable colWidths="371.0,98.0,61.0" style="Table_Product_Line"> |
4912 | + <tr> |
4913 | + <td> |
4914 | + <para style="terp_default_9">[[ order_line.name ]]</para> |
4915 | + </td> |
4916 | + <td> |
4917 | + <para style="terp_default_Centre_9">[[ formatLang(order_line.date_planned, date = True) ]]</para> |
4918 | + </td> |
4919 | + <td> |
4920 | + <para style="terp_default_Right_9"> |
4921 | + [[ formatLang(order_line.product_qty )]] |
4922 | + <i>[[ (order_line.product_uom and order_line.product_uom.name) or '' ]]</i> |
4923 | + </para> |
4924 | + </td> |
4925 | + </tr> |
4926 | + </blockTable> |
4927 | + </section> |
4928 | + <para style="terp_default_9"> |
4929 | + <font color="white"> </font> |
4930 | + </para> |
4931 | + <para style="terp_default_9">[[ format(order.notes or '') ]]</para> |
4932 | + <para style="terp_default_9"> |
4933 | + <font color="white"> </font> |
4934 | + </para> |
4935 | + <para style="terp_default_9">Regards,</para> |
4936 | + <para style="terp_default_9"> |
4937 | + <font color="white"> </font> |
4938 | + </para> |
4939 | + <para style="Space bet user and signature"> |
4940 | + <font color="white"> </font> |
4941 | + </para> |
4942 | + <para style="terp_default_9">[[ user.signature or '' ]]</para> |
4943 | + </story> |
4944 | +</document> |
4945 | |
4946 | === added directory 'sale_improved_slip' |
4947 | === added file 'sale_improved_slip/__init__.py' |
4948 | --- sale_improved_slip/__init__.py 1970-01-01 00:00:00 +0000 |
4949 | +++ sale_improved_slip/__init__.py 2014-08-27 19:22:25 +0000 |
4950 | @@ -0,0 +1,23 @@ |
4951 | +# -*- coding: utf-8 -*- |
4952 | +############################################################################## |
4953 | +# |
4954 | +# OpenERP, Open Source Management Solution |
4955 | +# Copyright (C) 2013 Savoir-faire Linux (<http://www.savoirfairelinux.com>). |
4956 | +# |
4957 | +# This program is free software: you can redistribute it and/or modify |
4958 | +# it under the terms of the GNU Affero General Public License as |
4959 | +# published by the Free Software Foundation, either version 3 of the |
4960 | +# License, or (at your option) any later version. |
4961 | +# |
4962 | +# This program is distributed in the hope that it will be useful, |
4963 | +# but WITHOUT ANY WARRANTY; without even the implied warranty of |
4964 | +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
4965 | +# GNU Affero General Public License for more details. |
4966 | +# |
4967 | +# You should have received a copy of the GNU Affero General Public License |
4968 | +# along with this program. If not, see <http://www.gnu.org/licenses/>. |
4969 | +# |
4970 | +############################################################################## |
4971 | + |
4972 | +import report |
4973 | +import sale |
4974 | |
4975 | === added file 'sale_improved_slip/__openerp__.py' |
4976 | --- sale_improved_slip/__openerp__.py 1970-01-01 00:00:00 +0000 |
4977 | +++ sale_improved_slip/__openerp__.py 2014-08-27 19:22:25 +0000 |
4978 | @@ -0,0 +1,47 @@ |
4979 | +# -*- coding: utf-8 -*- |
4980 | +############################################################################## |
4981 | +# |
4982 | +# OpenERP, Open Source Management Solution |
4983 | +# Copyright (C) 2013 Savoir-faire Linux (<http://www.savoirfairelinux.com>). |
4984 | +# |
4985 | +# This program is free software: you can redistribute it and/or modify |
4986 | +# it under the terms of the GNU Affero General Public License as |
4987 | +# published by the Free Software Foundation, either version 3 of the |
4988 | +# License, or (at your option) any later version. |
4989 | +# |
4990 | +# This program is distributed in the hope that it will be useful, |
4991 | +# but WITHOUT ANY WARRANTY; without even the implied warranty of |
4992 | +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
4993 | +# GNU Affero General Public License for more details. |
4994 | +# |
4995 | +# You should have received a copy of the GNU Affero General Public License |
4996 | +# along with this program. If not, see <http://www.gnu.org/licenses/>. |
4997 | +# |
4998 | +############################################################################## |
4999 | + |
5000 | +{ |
MP Description : ''
MP Commit message : ''
__openerp__.py 'description': """""",
My remarks : '''?'''
Please fix this lack of information about this module