Merge lp:~savoirfairelinux-openerp/purchase-wkfl/pallet-delivery into lp:~purchase-core-editors/purchase-wkfl/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
Reviewer Review Type Date Requested Status
Pedro Manuel Baeza Needs Resubmitting
Yannick Vaucher @ Camptocamp Needs Fixing
Review via email: mp+216325@code.launchpad.net
To post a comment you must log in.
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

Revision history for this message
Yannick Vaucher @ Camptocamp (yvaucher-c2c) wrote :

MP Description : ''
MP Commit message : ''

__openerp__.py 'description': """""",

My remarks : '''?'''

Please fix this lack of information about this module

review: Needs Fixing
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.

Revision history for this message
Pedro Manuel Baeza (pedro.baeza) wrote :

This project is now hosted on https://github.com/OCA/purchase-workflow. Please move your proposal there. This guide may help you https://github.com/OCA/maintainers-tools/wiki/How-to-move-a-Merge-Proposal-to-GitHub

review: Needs Resubmitting
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

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
=== added directory 'delivery_editable_dates'
=== added file 'delivery_editable_dates/__init__.py'
=== added file 'delivery_editable_dates/__openerp__.py'
--- delivery_editable_dates/__openerp__.py 1970-01-01 00:00:00 +0000
+++ delivery_editable_dates/__openerp__.py 2014-08-27 19:22:25 +0000
@@ -0,0 +1,39 @@
1# -*- coding: utf-8 -*-
2##############################################################################
3#
4# OpenERP, Open Source Management Solution
5# Copyright (C) 2013 Savoir-faire Linux (<http://www.savoirfairelinux.com>).
6#
7# This program is free software: you can redistribute it and/or modify
8# it under the terms of the GNU Affero General Public License as
9# published by the Free Software Foundation, either version 3 of the
10# License, or (at your option) any later version.
11#
12# This program is distributed in the hope that it will be useful,
13# but WITHOUT ANY WARRANTY; without even the implied warranty of
14# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15# GNU Affero General Public License for more details.
16#
17# You should have received a copy of the GNU Affero General Public License
18# along with this program. If not, see <http://www.gnu.org/licenses/>.
19#
20##############################################################################
21
22{
23 'name': 'Editable Delivery Dates',
24 'version': '0.1',
25 'author': 'Savoir-faire Linux',
26 'maintainer': 'Savoir-faire Linux',
27 'website': 'http://www.savoirfairelinux.com',
28 'caterogy': 'sales',
29 'description': """
30""",
31 'depends': ['base', 'sale'],
32 'data': [
33 'editable_delivery_dates_view.xml',
34 ],
35 'demo': [],
36 'test': [],
37 'installable': True,
38 'active': False,
39}
040
=== added file 'delivery_editable_dates/editable_delivery_dates_view.xml'
--- delivery_editable_dates/editable_delivery_dates_view.xml 1970-01-01 00:00:00 +0000
+++ delivery_editable_dates/editable_delivery_dates_view.xml 2014-08-27 19:22:25 +0000
@@ -0,0 +1,37 @@
1<?xml version="1.0" encoding="utf-8" ?>
2<openerp>
3 <data>
4 <record id="editable_so_form" model="ir.ui.view">
5 <field name="name">sale.order.editable.form</field>
6 <field name="model">sale.order</field>
7 <field name="inherit_id" ref="sale.view_order_form" />
8 <field name="arch" type="xml">
9 <field name="date_order" position="replace">
10 <field name="date_order" attrs="{'readonly': False}" />
11 </field>
12 </field>
13 </record>
14
15 <record id="editable_do_form" model="ir.ui.view">
16 <field name="name">stock.picking.out.editable.form</field>
17 <field name="model">stock.picking.out</field>
18 <field name="inherit_id" ref="stock.view_picking_out_form" />
19 <field name="arch" type="xml">
20 <field name="min_date" position="replace">
21 <field name="min_date" attrs="{'readonly': False, 'invisible': [('min_date', '=', False)]}" />
22 </field>
23 </field>
24 </record>
25
26 <record id="editable_in_form" model="ir.ui.view">
27 <field name="name">stock.picking.in.editable.form</field>
28 <field name="model">stock.picking.in</field>
29 <field name="inherit_id" ref="stock.view_picking_in_form" />
30 <field name="arch" type="xml">
31 <field name="min_date" position="replace">
32 <field name="min_date" attrs="{'readonly': False, 'invisible': [('min_date', '=', False)]}" />
33 </field>
34 </field>
35 </record>
36 </data>
37</openerp>
038
=== added directory 'delivery_editable_dates/i18n'
=== added file 'delivery_editable_dates/i18n/delivery_editable_dates.pot'
--- delivery_editable_dates/i18n/delivery_editable_dates.pot 1970-01-01 00:00:00 +0000
+++ delivery_editable_dates/i18n/delivery_editable_dates.pot 2014-08-27 19:22:25 +0000
@@ -0,0 +1,16 @@
1# Translation of OpenERP Server.
2# This file contains the translation of the following modules:
3#
4msgid ""
5msgstr ""
6"Project-Id-Version: OpenERP Server 7.0-20130811-231021\n"
7"Report-Msgid-Bugs-To: \n"
8"POT-Creation-Date: 2013-09-18 14:19+0000\n"
9"PO-Revision-Date: 2013-09-18 14:19+0000\n"
10"Last-Translator: <>\n"
11"Language-Team: \n"
12"MIME-Version: 1.0\n"
13"Content-Type: text/plain; charset=UTF-8\n"
14"Content-Transfer-Encoding: \n"
15"Plural-Forms: \n"
16
017
=== added directory 'landed_cost_per_pallet'
=== added file 'landed_cost_per_pallet/README'
=== added file 'landed_cost_per_pallet/__init__.py'
--- landed_cost_per_pallet/__init__.py 1970-01-01 00:00:00 +0000
+++ landed_cost_per_pallet/__init__.py 2014-08-27 19:22:25 +0000
@@ -0,0 +1,22 @@
1# -*- coding: utf-8 -*-
2##############################################################################
3#
4# OpenERP, Open Source Management Solution
5# Copyright (C) 2013 Savoir-faire Linux (<http://www.savoirfairelinux.com>).
6#
7# This program is free software: you can redistribute it and/or modify
8# it under the terms of the GNU Affero General Public License as
9# published by the Free Software Foundation, either version 3 of the
10# License, or (at your option) any later version.
11#
12# This program is distributed in the hope that it will be useful,
13# but WITHOUT ANY WARRANTY; without even the implied warranty of
14# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15# GNU Affero General Public License for more details.
16#
17# You should have received a copy of the GNU Affero General Public License
18# along with this program. If not, see <http://www.gnu.org/licenses/>.
19#
20##############################################################################
21
22import purchase
023
=== added file 'landed_cost_per_pallet/__openerp__.py'
--- landed_cost_per_pallet/__openerp__.py 1970-01-01 00:00:00 +0000
+++ landed_cost_per_pallet/__openerp__.py 2014-08-27 19:22:25 +0000
@@ -0,0 +1,52 @@
1# -*- coding: utf-8 -*-
2##############################################################################
3#
4# OpenERP, Open Source Management Solution
5# Copyright (C) 2013 Savoir-faire Linux (<http://www.savoirfairelinux.com>).
6#
7# This program is free software: you can redistribute it and/or modify
8# it under the terms of the GNU Affero General Public License as
9# published by the Free Software Foundation, either version 3 of the
10# License, or (at your option) any later version.
11#
12# This program is distributed in the hope that it will be useful,
13# but WITHOUT ANY WARRANTY; without even the implied warranty of
14# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15# GNU Affero General Public License for more details.
16#
17# You should have received a copy of the GNU Affero General Public License
18# along with this program. If not, see <http://www.gnu.org/licenses/>.
19#
20##############################################################################
21
22# NOTE: The name of the supplied field was initially "display_name", but it seems that OpenERP,
23# whenever it seems "name" in the field, returns the value for "name". Well...
24
25{
26 'name': 'Landed Cost per Pallet',
27 'version': '1.1',
28 'author': 'Savoir-faire Linux',
29 'maintainer': 'Savoir-faire Linux',
30 'website': 'http://www.savoirfairelinux.com',
31 'category': 'Generic Modules/Purchases',
32 'description': """
33
34Lets you manage product quantities using crates and pallets
35===========================================================
36
37This module modifies the purchase module to let you manage product
38quantities by specifying a number of pallets and a number of crates
39per pallet.
40
41This also adds a 'Per Pallet' option to landed costs, in order to compute the
42landed costs per pallet.
43""",
44 'depends': ['base', 'purchase', 'purchase_landed_costs'],
45 'data': [
46 'landed_cost_per_pallet_view.xml',
47 ],
48 'demo': [],
49 'test': [],
50 'installable': True,
51 'active': False,
52}
053
=== added directory 'landed_cost_per_pallet/i18n'
=== added file 'landed_cost_per_pallet/i18n/fr.po'
--- landed_cost_per_pallet/i18n/fr.po 1970-01-01 00:00:00 +0000
+++ landed_cost_per_pallet/i18n/fr.po 2014-08-27 19:22:25 +0000
@@ -0,0 +1,46 @@
1# Translation of OpenERP Server.
2# This file contains the translation of the following modules:
3# * landed_cost_per_pallet
4#
5msgid ""
6msgstr ""
7"Project-Id-Version: OpenERP Server 7.0-20130811-231021\n"
8"Report-Msgid-Bugs-To: \n"
9"POT-Creation-Date: 2013-09-18 14:21+0000\n"
10"PO-Revision-Date: 2013-09-18 14:21+0000\n"
11"Last-Translator: Alexandre Boily <alexandre.boily@savoirfairelinux.com>\n"
12"Language-Team: Savoir-faire Linux\n"
13"MIME-Version: 1.0\n"
14"Content-Type: text/plain; charset=UTF-8\n"
15"Content-Transfer-Encoding: \n"
16"Plural-Forms: \n"
17
18#. module: landed_cost_per_pallet
19#: field:purchase.order,landed_cost_base_pallet:0
20msgid "Landed Costs Base Pallet"
21msgstr "Coûts d'aterissage par palette"
22
23#. module: landed_cost_per_pallet
24#: model:ir.model,name:landed_cost_per_pallet.model_purchase_order_line
25msgid "Purchase Order Line"
26msgstr "Ligne de bon de commande"
27
28#. module: landed_cost_per_pallet
29#: model:ir.model,name:landed_cost_per_pallet.model_purchase_order
30msgid "Purchase Order"
31msgstr "Bon de commande"
32
33#. module: landed_cost_per_pallet
34#: field:purchase.order.line,nb_crates_per_pallet:0
35msgid "Crates per pallet"
36msgstr "Caisses par palette"
37
38#. module: landed_cost_per_pallet
39#: field:purchase.order.line,nb_pallets:0
40msgid "Pallets"
41msgstr "Palettes"
42
43#. module: landed_cost_per_pallet
44#: model:ir.model,name:landed_cost_per_pallet.model_landed_cost_position
45msgid "landed.cost.position"
46msgstr "landed.cost.position"
047
=== added file 'landed_cost_per_pallet/i18n/landed_cost_per_pallet.pot'
--- landed_cost_per_pallet/i18n/landed_cost_per_pallet.pot 1970-01-01 00:00:00 +0000
+++ landed_cost_per_pallet/i18n/landed_cost_per_pallet.pot 2014-08-27 19:22:25 +0000
@@ -0,0 +1,47 @@
1# Translation of OpenERP Server.
2# This file contains the translation of the following modules:
3# * landed_cost_per_pallet
4#
5msgid ""
6msgstr ""
7"Project-Id-Version: OpenERP Server 7.0-20130811-231021\n"
8"Report-Msgid-Bugs-To: \n"
9"POT-Creation-Date: 2013-09-18 14:21+0000\n"
10"PO-Revision-Date: 2013-09-18 14:21+0000\n"
11"Last-Translator: <>\n"
12"Language-Team: \n"
13"MIME-Version: 1.0\n"
14"Content-Type: text/plain; charset=UTF-8\n"
15"Content-Transfer-Encoding: \n"
16"Plural-Forms: \n"
17
18#. module: landed_cost_per_pallet
19#: field:purchase.order,landed_cost_base_pallet:0
20msgid "Landed Costs Base Pallet"
21msgstr ""
22
23#. module: landed_cost_per_pallet
24#: model:ir.model,name:landed_cost_per_pallet.model_purchase_order_line
25msgid "Purchase Order Line"
26msgstr ""
27
28#. module: landed_cost_per_pallet
29#: model:ir.model,name:landed_cost_per_pallet.model_purchase_order
30msgid "Purchase Order"
31msgstr ""
32
33#. module: landed_cost_per_pallet
34#: field:purchase.order.line,nb_crates_per_pallet:0
35msgid "Crates per pallet"
36msgstr ""
37
38#. module: landed_cost_per_pallet
39#: field:purchase.order.line,nb_pallets:0
40msgid "Pallets"
41msgstr ""
42
43#. module: landed_cost_per_pallet
44#: model:ir.model,name:landed_cost_per_pallet.model_landed_cost_position
45msgid "landed.cost.position"
46msgstr ""
47
048
=== added file 'landed_cost_per_pallet/landed_cost_per_pallet_view.xml'
--- landed_cost_per_pallet/landed_cost_per_pallet_view.xml 1970-01-01 00:00:00 +0000
+++ landed_cost_per_pallet/landed_cost_per_pallet_view.xml 2014-08-27 19:22:25 +0000
@@ -0,0 +1,27 @@
1<?xml version="1.0" encoding="utf-8"?>
2<openerp>
3 <data>
4 <record id="view_purchase_pallet_crate_order_line" model="ir.ui.view">
5 <field name="name">purchase.order.form</field>
6 <field name="model">purchase.order</field>
7 <field name="inherit_id" ref="purchase.purchase_order_form"/>
8 <field name="arch" type="xml">
9 <field name="product_qty" position="before">
10 <field name="nb_pallets"/>
11 <field name="nb_crates_per_pallet"/>
12 </field>
13 </field>
14 </record>
15
16 <record id="view_purchase_pallet_crate_thing" model="ir.ui.view">
17 <field name="name">purchase.order.landing.form</field>
18 <field name="model">purchase.order</field>
19 <field name="inherit_id" ref="purchase_landed_costs.c2c_purchase_order_landed_cost_view" />
20 <field name="arch" type="xml">
21 <field name="landed_cost_base_value" position="after">
22 <field name="landed_cost_base_pallet" />
23 </field>
24 </field>
25 </record>
26 </data>
27</openerp>
028
=== added file 'landed_cost_per_pallet/purchase.py'
--- landed_cost_per_pallet/purchase.py 1970-01-01 00:00:00 +0000
+++ landed_cost_per_pallet/purchase.py 2014-08-27 19:22:25 +0000
@@ -0,0 +1,125 @@
1# -*- coding: utf-8 -*-
2##############################################################################
3#
4# OpenERP, Open Source Management Solution
5# Copyright (C) 2013 Savoir-faire Linux (<http://www.savoirfairelinux.com>).
6#
7# This program is free software: you can redistribute it and/or modify
8# it under the terms of the GNU Affero General Public License as
9# published by the Free Software Foundation, either version 3 of the
10# License, or (at your option) any later version.
11#
12# This program is distributed in the hope that it will be useful,
13# but WITHOUT ANY WARRANTY; without even the implied warranty of
14# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15# GNU Affero General Public License for more details.
16#
17# You should have received a copy of the GNU Affero General Public License
18# along with this program. If not, see <http://www.gnu.org/licenses/>.
19#
20##############################################################################
21
22from openerp.osv import orm, fields
23import openerp.addons.decimal_precision as dp
24
25class purchase_order(orm.Model):
26
27 _inherit = 'purchase.order'
28
29 def _landed_cost_base_pallet(self, cr, uid, ids, name, args, context):
30 if not ids:
31 return {}
32
33 result = {}
34 landed_costs_base_pallet = 0.0
35
36 for line in self.browse(cr, uid, ids):
37 if line.landed_cost_line_ids:
38 for costs in line.landed_cost_line_ids:
39 if costs.price_type == 'per_pallet':
40 landed_costs_base_pallet += costs.amount
41 result[line.id] = landed_costs_base_pallet
42
43 return result
44
45 _columns = {
46 'landed_cost_base_pallet': fields.function(
47 _landed_cost_base_pallet,
48 digits_compute=dp.get_precision('Account'),
49 string='Landed Costs Base Pallet'),
50 }
51
52
53class purchase_order_line(orm.Model):
54
55 _inherit = 'purchase.order.line'
56
57 def _product_quantity(self, cursor, user, ids, name, arg, context=None):
58 res = {}
59 for line in self.browse(cursor, user, ids, context=context):
60 if not line.nb_crates_per_pallet or not line.nb_pallets:
61 res[line.id] = 0
62 else:
63 res[line.id] = line.nb_crates_per_pallet * line.nb_pallets
64 return res
65
66 def _landing_cost_order(self, cr, uid, ids, name, args, context):
67 if not ids:
68 return {}
69
70 result = {}
71
72 lines = self.browse(cr, uid, ids)
73
74 # Pre-compute total number of pallets
75 pallets_total = 0.0
76 for line in lines:
77 for po_line in line.order_id.order_line:
78 if po_line.order_id.landed_cost_line_ids:
79 pallets_total += po_line.nb_pallets
80
81 # Landed costs line by line
82 for line in lines:
83 landed_costs = 0.0
84 # distribution of landed costs of PO
85 if line.order_id.landed_cost_line_ids:
86 # Base value (Absolute Value)
87 landed_costs += line.order_id.landed_cost_base_value / line.order_id.amount_total * line.price_subtotal
88
89 # Base quantity (Per Quantity)
90 landed_costs += line.order_id.landed_cost_base_quantity / line.order_id.quantity_total * line.product_qty
91
92 # Base pallet (Per Pallet)
93 landed_costs += line.order_id.landed_cost_base_pallet / pallets_total * line.nb_pallets
94 result[line.id] = landed_costs
95
96 return result
97
98 _columns = {
99 'nb_pallets': fields.float('Pallets', required=True),
100 'nb_crates_per_pallet': fields.integer('Crates per pallet', required=True),
101 'product_qty': fields.function(_product_quantity,
102 digits_compute=dp.get_precision('Product Unit of Measure'),
103 string="Quantity",
104 type='float'),
105 'landing_costs_order': fields.function(_landing_cost_order,
106 digits_compute=dp.get_precision('Account'),
107 string='Landing Costs from Order'),
108 }
109
110
111class landed_cost_position(orm.Model):
112
113 _inherit = 'landed.cost.position'
114
115 _columns = {
116 'price_type': fields.selection(
117 [('per_pallet', 'Per Pallet'), ('per_unit','Per Quantity'), ('value','Absolute Value')],
118 'Amount Type',
119 required=True,
120 help="Defines if the amount is to be calculated for each quantity or an absolute value"),
121 }
122
123 _defaults = {
124 'price_type': 'per_pallet',
125 }
0126
=== added directory 'pallet_delivery'
=== added file 'pallet_delivery/README'
=== added file 'pallet_delivery/__init__.py'
--- pallet_delivery/__init__.py 1970-01-01 00:00:00 +0000
+++ pallet_delivery/__init__.py 2014-08-27 19:22:25 +0000
@@ -0,0 +1,22 @@
1# -*- coding: utf-8 -*-
2##############################################################################
3#
4# OpenERP, Open Source Management Solution
5# Copyright (C) 2013 Savoir-faire Linux (<http://www.savoirfairelinux.com>).
6#
7# This program is free software: you can redistribute it and/or modify
8# it under the terms of the GNU Affero General Public License as
9# published by the Free Software Foundation, either version 3 of the
10# License, or (at your option) any later version.
11#
12# This program is distributed in the hope that it will be useful,
13# but WITHOUT ANY WARRANTY; without even the implied warranty of
14# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15# GNU Affero General Public License for more details.
16#
17# You should have received a copy of the GNU Affero General Public License
18# along with this program. If not, see <http://www.gnu.org/licenses/>.
19#
20##############################################################################
21
22import stock
023
=== added file 'pallet_delivery/__openerp__.py'
--- pallet_delivery/__openerp__.py 1970-01-01 00:00:00 +0000
+++ pallet_delivery/__openerp__.py 2014-08-27 19:22:25 +0000
@@ -0,0 +1,58 @@
1# -*- coding: utf-8 -*-
2##############################################################################
3#
4# OpenERP, Open Source Management Solution
5# Copyright (C) 2013 Savoir-faire Linux (<http://www.savoirfairelinux.com>).
6#
7# This program is free software: you can redistribute it and/or modify
8# it under the terms of the GNU Affero General Public License as
9# published by the Free Software Foundation, either version 3 of the
10# License, or (at your option) any later version.
11#
12# This program is distributed in the hope that it will be useful,
13# but WITHOUT ANY WARRANTY; without even the implied warranty of
14# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15# GNU Affero General Public License for more details.
16#
17# You should have received a copy of the GNU Affero General Public License
18# along with this program. If not, see <http://www.gnu.org/licenses/>.
19#
20##############################################################################
21
22# NOTE: The name of the supplied field was initially "display_name", but it seems that OpenERP,
23# whenever it seems "name" in the field, returns the value for "name". Well...
24
25{
26 'name': 'Pallet delivery',
27 'version': '1.1',
28 'author': 'Savoir-faire Linux',
29 'maintainer': 'Savoir-faire Linux',
30 'website': 'http://www.savoirfairelinux.com',
31 'category': 'warehouse',
32 'description': """
33
34Lets you manage truck deliveries
35===========================================================
36
37This module lets you specify where exactly in the delivery truck
38was the merchandise.
39
40Also lets you give more specific information like the temperature
41at various points.
42
43""",
44 'depends': [
45 'base', 'purchase', 'stock',
46 'landed_cost_per_pallet', 'purchase_lot_tracking',
47 ],
48 'data': [
49 'security/ir.model.access.csv',
50 'stock_workflow.xml',
51 'pallet_delivery_data.xml',
52 'pallet_delivery_view.xml',
53 ],
54 'demo': [],
55 'test': [],
56 'installable': True,
57 'active': False,
58}
059
=== added directory 'pallet_delivery/i18n'
=== added file 'pallet_delivery/i18n/fr.po'
--- pallet_delivery/i18n/fr.po 1970-01-01 00:00:00 +0000
+++ pallet_delivery/i18n/fr.po 2014-08-27 19:22:25 +0000
@@ -0,0 +1,186 @@
1# Translation of OpenERP Server.
2# This file contains the translation of the following modules:
3# * pallet_delivery
4#
5msgid ""
6msgstr ""
7"Project-Id-Version: OpenERP Server 7.0-20130811-231021\n"
8"Report-Msgid-Bugs-To: \n"
9"POT-Creation-Date: 2013-09-05 14:56+0000\n"
10"PO-Revision-Date: 2013-09-05 14:56+0000\n"
11"Last-Translator: <>\n"
12"Language-Team: \n"
13"MIME-Version: 1.0\n"
14"Content-Type: text/plain; charset=UTF-8\n"
15"Content-Transfer-Encoding: \n"
16"Plural-Forms: \n"
17
18#. module: pallet_delivery
19#: model:ir.actions.act_window,help:pallet_delivery.action_truck_pending
20msgid "<p class=\"oe_view_nocontent_create\">Click to create a draft truck</p>\n"
21"\n"
22" <p>The truck contains an incoming, physical shipment. With it you can\n"
23" register the truck's details, such as its serial number, sampled\n"
24" temperatures, and other information. Also, the truck serves you as a\n"
25" map of what your company received.</p>\n"
26"\n"
27" <p>When you confirm the truck, it will act as an “Incoming Shipment”\n"
28" confirmation, and the products will be moved from your Suppliers (as\n"
29" listed in Purchase Orders) to your Stock.</p>\n"
30" "
31msgstr "<p class=\"oe_view_nocontent_create\">Cliquez pour créer un camion brouillon</p>\n
32<p>Le camion contient une livraison physique entrante. Avec celui-ci, vous
33pouvez enregistrer les détails du camion, comme son numéro de série, les
34températures échantillonnées, et d'autre informations. De même, le camion est
35utile comme carte des produits reçus.</p>
36<p>Lorsque vous confirmez la réception du camion, ce dernier agira comme une
37\"Livraison entrante\" confirmée, et le produits seront déplacés de vos
38fournisseurs (tels que listés dans vos bons de commandes) vers votre
39entrepôt.</p>"
40
41#. module: pallet_delivery
42#: model:ir.model,name:pallet_delivery.model_purchase_order_line
43msgid "Purchase Order Line"
44msgstr "Ligne de bon d'achat"
45
46#. module: pallet_delivery
47#: view:stock.truck:0
48msgid "Confirm"
49msgstr "Confirmer"
50
51#. module: pallet_delivery
52#: model:ir.model,name:pallet_delivery.model_stock_truck_line
53msgid "A single pallet shipped in an incoming truck"
54msgstr "Une seule palette livrée dans un camion entrant"
55
56#. module: pallet_delivery
57#: view:stock.truck:0
58#: field:stock.truck.line,crates:0
59msgid "Crates"
60msgstr "Caisses"
61
62#. module: pallet_delivery
63#: field:stock.truck.line,pallet:0
64msgid "Pallet"
65msgstr "Palette"
66
67#. module: pallet_delivery
68#: field:stock.truck,state:0
69msgid "State"
70msgstr "État"
71
72#. module: pallet_delivery
73#: model:ir.model,name:pallet_delivery.model_stock_truck
74msgid "Incoming truck"
75msgstr "Camion entrant"
76
77#. module: pallet_delivery
78#: selection:stock.truck,state:0
79msgid "Draft"
80msgstr "Ébauche"
81
82#. module: pallet_delivery
83#: view:stock.truck:0
84msgid "Details"
85msgstr "Détails"
86
87#. module: pallet_delivery
88#: field:stock.truck,front_temperature:0
89msgid "Front Temperature"
90msgstr "Température avant"
91
92#. module: pallet_delivery
93#: field:stock.truck,supplier:0
94msgid "Supplier"
95msgstr "Fournisseur"
96
97#. module: pallet_delivery
98#: view:stock.truck:0
99msgid "Truck Composition"
100msgstr "Composition du camion"
101
102#. module: pallet_delivery
103#: field:stock.truck,back_temperature:0
104msgid "Back Temperature"
105msgstr "Température arrière"
106
107#. module: pallet_delivery
108#: view:stock.truck:0
109msgid "Serial Number"
110msgstr "Numéro de série"
111
112#. module: pallet_delivery
113#: view:stock.truck:0
114msgid "Left Pallets"
115msgstr "Palettes gauche"
116
117#. module: pallet_delivery
118#: field:stock.truck,left_pallet_ids:0
119#: field:stock.truck,right_pallet_ids:0
120msgid "Pallets"
121msgstr "Palettes"
122
123#. module: pallet_delivery
124#: field:stock.truck,truck_sn:0
125msgid "Truck S/N"
126msgstr "Numéro de série"
127
128#. module: pallet_delivery
129#: field:stock.truck,name:0
130#: field:stock.truck.line,name:0
131msgid "Name"
132msgstr "Nom"
133
134#. module: pallet_delivery
135#: field:purchase.order,stock_truck_ids:0
136msgid "Trucks"
137msgstr "Camions"
138
139#. module: pallet_delivery
140#: view:stock.truck:0
141msgid "Search Truck"
142msgstr "Rechercher un camion"
143
144#. module: pallet_delivery
145#: model:ir.model,name:pallet_delivery.model_purchase_order
146msgid "Purchase Order"
147msgstr "Bon d'achat"
148
149#. module: pallet_delivery
150#: field:stock.truck,arrival:0
151msgid "Date of Arrival"
152msgstr "Date d'arrivée"
153
154#. module: pallet_delivery
155#: view:stock.truck:0
156#: field:stock.truck.line,left_id:0
157#: field:stock.truck.line,right_id:0
158msgid "Truck"
159msgstr "Camion"
160
161#. module: pallet_delivery
162#: view:stock.truck:0
163msgid "Right Pallets"
164msgstr "Palettes droite"
165
166#. module: pallet_delivery
167#: model:ir.actions.act_window,name:pallet_delivery.action_truck_pending
168msgid "On Draft Truck"
169msgstr "Camion en ébauche"
170
171#. module: pallet_delivery
172#: model:ir.ui.menu,name:pallet_delivery.menu_truck
173msgid "Incoming Truck"
174msgstr "Camion entrant"
175
176#. module: pallet_delivery
177#: selection:stock.truck,state:0
178msgid "Done"
179msgstr "Complété"
180
181#. module: pallet_delivery
182#: view:stock.truck:0
183#: field:stock.truck,purchase_order_ids:0
184msgid "Purchase Orders"
185msgstr "Bons d'achats"
186
0187
=== added file 'pallet_delivery/i18n/pallet_delivery.pot'
--- pallet_delivery/i18n/pallet_delivery.pot 1970-01-01 00:00:00 +0000
+++ pallet_delivery/i18n/pallet_delivery.pot 2014-08-27 19:22:25 +0000
@@ -0,0 +1,225 @@
1# Translation of OpenERP Server.
2# This file contains the translation of the following modules:
3# * pallet_delivery
4#
5msgid ""
6msgstr ""
7"Project-Id-Version: OpenERP Server 7.0\n"
8"Report-Msgid-Bugs-To: \n"
9"POT-Creation-Date: 2014-05-04 15:54+0000\n"
10"PO-Revision-Date: 2014-05-04 15:54+0000\n"
11"Last-Translator: <>\n"
12"Language-Team: \n"
13"MIME-Version: 1.0\n"
14"Content-Type: text/plain; charset=UTF-8\n"
15"Content-Transfer-Encoding: \n"
16"Plural-Forms: \n"
17
18#. module: pallet_delivery
19#: model:ir.actions.act_window,help:pallet_delivery.action_truck_pending
20msgid "<p class=\"oe_view_nocontent_create\">Click to create a draft truck</p>\n"
21"\n"
22" <p>The truck contains an incoming, physical shipment. With it you can\n"
23" register the truck's details, such as its serial number, sampled\n"
24" temperatures, and other information. Also, the truck serves you as a\n"
25" map of what your company received.</p>\n"
26"\n"
27" <p>When you confirm the truck, it will act as an “Incoming Shipment”\n"
28" confirmation, and the products will be moved from your Suppliers (as\n"
29" listed in Purchase Orders) to your Stock.</p>\n"
30" "
31msgstr ""
32
33#. module: pallet_delivery
34#: model:ir.model,name:pallet_delivery.model_purchase_order_line
35msgid "Purchase Order Line"
36msgstr ""
37
38#. module: pallet_delivery
39#: field:stock.truck,back_temperature:0
40msgid "Back Temperature"
41msgstr ""
42
43#. module: pallet_delivery
44#: model:ir.model,name:pallet_delivery.model_stock_picking_in
45msgid "Incoming Shipments"
46msgstr ""
47
48#. module: pallet_delivery
49#: model:ir.model,name:pallet_delivery.model_stock_truck_line
50msgid "A single pallet shipped in an incoming truck"
51msgstr ""
52
53#. module: pallet_delivery
54#: view:stock.truck:0
55#: field:stock.truck.line,crates:0
56msgid "Crates"
57msgstr ""
58
59#. module: pallet_delivery
60#: field:stock.truck.line,pallet:0
61msgid "Pallet"
62msgstr ""
63
64#. module: pallet_delivery
65#: field:stock.truck,state:0
66msgid "State"
67msgstr ""
68
69#. module: pallet_delivery
70#: model:ir.model,name:pallet_delivery.model_stock_truck
71msgid "Incoming truck"
72msgstr ""
73
74#. module: pallet_delivery
75#: selection:stock.truck,state:0
76msgid "Draft"
77msgstr ""
78
79#. module: pallet_delivery
80#: view:stock.truck:0
81msgid "Details"
82msgstr ""
83
84#. module: pallet_delivery
85#: field:stock.truck,front_temperature:0
86msgid "Front Temperature"
87msgstr ""
88
89#. module: pallet_delivery
90#: field:stock.truck,supplier:0
91msgid "Supplier"
92msgstr ""
93
94#. module: pallet_delivery
95#: field:purchase.order,hidden:0
96msgid "Hidden"
97msgstr ""
98
99#. module: pallet_delivery
100#: view:stock.truck:0
101msgid "Truck Composition"
102msgstr ""
103
104#. module: pallet_delivery
105#: field:purchase.order,assigned:0
106msgid "unknown"
107msgstr ""
108
109#. module: pallet_delivery
110#: view:stock.truck:0
111msgid "Confirm"
112msgstr ""
113
114#. module: pallet_delivery
115#: view:stock.truck:0
116msgid "Serial Number"
117msgstr ""
118
119#. module: pallet_delivery
120#: view:stock.truck:0
121msgid "Right Pallets"
122msgstr ""
123
124#. module: pallet_delivery
125#: field:stock.truck,left_pallet_ids:0
126#: field:stock.truck,right_pallet_ids:0
127msgid "Pallets"
128msgstr ""
129
130#. module: pallet_delivery
131#: field:stock.truck,truck_sn:0
132msgid "Truck S/N"
133msgstr ""
134
135#. module: pallet_delivery
136#: code:addons/pallet_delivery/stock.py:293
137#, python-format
138msgid "Input Error !"
139msgstr ""
140
141#. module: pallet_delivery
142#: field:stock.truck,name:0
143#: field:stock.truck.line,name:0
144msgid "Name"
145msgstr ""
146
147#. module: pallet_delivery
148#: field:purchase.order,stock_truck_ids:0
149msgid "Trucks"
150msgstr ""
151
152#. module: pallet_delivery
153#: view:stock.truck:0
154msgid "Search Truck"
155msgstr ""
156
157#. module: pallet_delivery
158#: model:ir.model,name:pallet_delivery.model_purchase_order
159msgid "Purchase Order"
160msgstr ""
161
162#. module: pallet_delivery
163#: field:stock.truck,arrival:0
164msgid "Date of Arrival"
165msgstr ""
166
167#. module: pallet_delivery
168#: view:stock.truck:0
169#: field:stock.truck.line,left_id:0
170#: field:stock.truck.line,right_id:0
171msgid "Truck"
172msgstr ""
173
174#. module: pallet_delivery
175#: view:stock.truck:0
176msgid "Left Pallets"
177msgstr ""
178
179#. module: pallet_delivery
180#: model:ir.actions.act_window,help:pallet_delivery.purchase_order_hidden
181msgid "<p class=\"oe_view_nocontent_create\">\n"
182" Click to create a quotation that will be converted into a purchase order. \n"
183" </p><p>\n"
184" Use this menu to search within your purchase orders by\n"
185" references, supplier, products, etc. For each purchase order,\n"
186" you can track the related discussion with the supplier, control\n"
187" the products received and control the supplier invoices.\n"
188" </p>\n"
189" "
190msgstr ""
191
192#. module: pallet_delivery
193#: model:ir.actions.act_window,name:pallet_delivery.action_truck_pending
194msgid "On Draft Truck"
195msgstr ""
196
197#. module: pallet_delivery
198#: code:addons/pallet_delivery/stock.py:294
199#, python-format
200msgid "Please enter real numbers."
201msgstr ""
202
203#. module: pallet_delivery
204#: model:ir.model,name:pallet_delivery.model_stock_move
205msgid "Stock Move"
206msgstr ""
207
208#. module: pallet_delivery
209#: model:ir.ui.menu,name:pallet_delivery.menu_truck_purchase
210#: model:ir.ui.menu,name:pallet_delivery.menu_truck_stock
211msgid "Incoming Truck"
212msgstr ""
213
214#. module: pallet_delivery
215#: selection:stock.truck,state:0
216msgid "Done"
217msgstr ""
218
219#. module: pallet_delivery
220#: model:ir.actions.act_window,name:pallet_delivery.purchase_order_hidden
221#: view:stock.truck:0
222#: field:stock.truck,purchase_order_ids:0
223msgid "Purchase Orders"
224msgstr ""
225
0226
=== added file 'pallet_delivery/pallet_delivery_data.xml'
--- pallet_delivery/pallet_delivery_data.xml 1970-01-01 00:00:00 +0000
+++ pallet_delivery/pallet_delivery_data.xml 2014-08-27 19:22:25 +0000
@@ -0,0 +1,35 @@
1<?xml version="1.0" encoding="utf-8"?>
2<openerp>
3 <data noupdate="1">
4 <record id="pallet_delivery_external_po" model="purchase.order">
5 <field name="partner_id">1</field>
6 <field name="location_id">8</field>
7 <field name="state">cancel</field>
8 <field name="pricelist_id" ref="purchase.list0"/>
9 <field name="hidden">1</field>
10 </record>
11
12 <record id="pallet_delivery_external_line" model="purchase.order.line">
13 <field name="product_uom">1</field>
14 <field name="order_id" ref="pallet_delivery_external_po" />
15 <field name="price_unit">1</field>
16 <field name="name">Not ours</field>
17 <field name="date_planned">2013-01-01</field>
18 <field name="state">confirmed</field>
19 <field name="nb_pallets">1</field>
20 <field name="nb_crates_per_pallet">1</field>
21 </record>
22
23 <record id="seq_type_stock_truck" model="ir.sequence.type">
24 <field name="name">Truck</field>
25 <field name="code">stock.truck</field>
26 </record>
27
28 <record id="seq_stock_truck" model="ir.sequence">
29 <field name="name">Truck</field>
30 <field name="code">stock.truck</field>
31 <field name="prefix">TRK</field>
32 <field name="padding">5</field>
33 </record>
34 </data>
35</openerp>
036
=== added file 'pallet_delivery/pallet_delivery_view.xml'
--- pallet_delivery/pallet_delivery_view.xml 1970-01-01 00:00:00 +0000
+++ pallet_delivery/pallet_delivery_view.xml 2014-08-27 19:22:25 +0000
@@ -0,0 +1,160 @@
1<?xml version="1.0" encoding="utf-8"?>
2<openerp>
3 <data>
4 <!-- Purchase Order -->
5 <record id="purchase_order_hidden" model="ir.actions.act_window">
6 <field name="name">Purchase Orders</field>
7 <field name="type">ir.actions.act_window</field>
8 <field name="res_model">purchase.order</field>
9 <field name="view_mode">tree,form,graph,calendar</field>
10 <field name="context">{}</field>
11 <field name="domain">['&amp;', ('state','not in',('draft','sent','confirmed')), ('hidden', '!=', True)]</field>
12 <field name="search_view_id" ref="purchase.view_purchase_order_filter"/>
13 <field name="help" type="html">
14 <p class="oe_view_nocontent_create">
15 Click to create a quotation that will be converted into a purchase order.
16 </p><p>
17 Use this menu to search within your purchase orders by
18 references, supplier, products, etc. For each purchase order,
19 you can track the related discussion with the supplier, control
20 the products received and control the supplier invoices.
21 </p>
22 </field>
23 </record>
24
25 <menuitem
26 id="purchase.menu_purchase_form_action"
27 action="purchase_order_hidden"
28 parent="purchase.menu_procurement_management"
29 sequence="6" />
30
31 <!-- Truck -->
32 <record id="truck_tree" model="ir.ui.view">
33 <field name="name">stock.truck.tree</field>
34 <field name="model">stock.truck</field>
35 <field name="arch" type="xml">
36 <tree string="Truck">
37 <field name="name" />
38 <field name="truck_sn" />
39 <field name="supplier" />
40 <field name="arrival" />
41 </tree>
42 </field>
43 </record>
44
45 <record id="truck_form" model="ir.ui.view">
46 <field name="name">stock.truck.form</field>
47 <field name="model">stock.truck</field>
48 <field eval="1" name="priority" />
49 <field name="arch" type="xml">
50 <form string="Truck" version="7.0">
51 <header>
52 <button
53 name="action_done"
54 type="object"
55 states="draft"
56 string="Confirm"
57 class="oe_highlight" />
58
59 <field
60 name="state"
61 widget="statusbar"
62 statusbar_visible="draft,done"
63 statusbar_colors='{"draft":"blue","done":"blue"}' />
64 </header>
65
66 <sheet>
67 <group>
68 <group name="pedigree" string="Details" colspan="4" col="4">
69 <group>
70 <field name="truck_sn" />
71 <field name="supplier" />
72 <field name="arrival" on_change="onchange_arrival(arrival)" />
73 </group>
74
75 <group>
76 <field name="front_temperature" on_change="validate_temperature(front_temperature, 'front_temperature')" />
77 <field name="back_temperature" on_change="validate_temperature(back_temperature, 'back_temperature')" />
78 </group>
79 </group>
80
81 <group name="purchase_orders" string="Purchase Orders" colspan="4">
82 <field name="purchase_order_ids" nolabel="1" domain="[('state', 'not in', ['draft', 'done']), ('assigned', '=', True)]">
83 <tree>
84 <field name="name" />
85 </tree>
86 </field>
87 </group>
88
89 <group name="pallets" string="Truck Composition" colspan="4">
90 <group>
91 <field name="left_pallet_ids" nolabel="1">
92 <tree editable="bottom">
93 <field name="pallet" string="Left Pallets" context="{'nice':'nice','parent':parent}" />
94 <field name="crates" string="Crates" />
95 </tree>
96 </field>
97 </group>
98
99 <group>
100 <field name="right_pallet_ids" nolabel="1">
101 <tree editable="bottom">
102 <field name="pallet" string="Right Pallets" context="{'nice':'nice','parent':parent}" />
103 <field name="crates" string="Crates" />
104 </tree>
105 </field>
106 </group>
107 </group>
108 </group>
109 </sheet>
110 </form>
111 </field>
112 </record>
113
114 <record id="view_truck_filter" model="ir.ui.view">
115 <field name="name">stock.truck.select</field>
116 <field name="model">stock.truck</field>
117 <field name="arch" type="xml">
118 <search string="Search Truck">
119 <field name="truck_sn" string="Serial Number" filter_domain="[('truck_sn', '=', self)]" />
120 </search>
121 </field>
122 </record>
123
124 <!-- Menu -->
125 <record id="action_truck_pending" model="ir.actions.act_window">
126 <field name="name">On Draft Truck</field>
127 <field name="res_model">stock.truck</field>
128 <field name="view_type">form</field>
129 <field name="view_mode">tree,form</field>
130 <field eval="False" name="view_id" />
131 <field name="search_view_id" ref="pallet_delivery.view_truck_filter" />
132 <field name="help" type="html">
133 <p class="oe_view_nocontent_create">Click to create a draft truck</p>
134
135 <p>The truck contains an incoming, physical shipment. With it you can
136 register the truck's details, such as its serial number, sampled
137 temperatures, and other information. Also, the truck serves you as a
138 map of what your company received.</p>
139
140 <p>When you confirm the truck, it will act as an “Incoming Shipment”
141 confirmation, and the products will be moved from your Suppliers (as
142 listed in Purchase Orders) to your Stock.</p>
143 </field>
144 </record>
145
146 <menuitem
147 name="Incoming Truck"
148 id="menu_truck_purchase"
149 action="action_truck_pending"
150 parent="purchase.menu_procurement_management_inventory"
151 sequence="8" />
152
153 <menuitem
154 name="Incoming Truck"
155 id="menu_truck_stock"
156 action="action_truck_pending"
157 parent="stock.menu_stock_warehouse_mgmt"
158 sequence="0" />
159 </data>
160</openerp>
0161
=== added directory 'pallet_delivery/security'
=== added file 'pallet_delivery/security/ir.model.access.csv'
--- pallet_delivery/security/ir.model.access.csv 1970-01-01 00:00:00 +0000
+++ pallet_delivery/security/ir.model.access.csv 2014-08-27 19:22:25 +0000
@@ -0,0 +1,5 @@
1id,name,model_id:id,group_id:id,perm_read,perm_write,perm_create,perm_unlink
2access_stock_truck_stock,stock.truck all,model_stock_truck,stock.group_stock_user,1,1,1,1
3access_stock_truck_purchase,stock.truck all,model_stock_truck,purchase.group_purchase_user,1,1,1,1
4access_stock_truck_line_stock,stock.truck.line all,model_stock_truck_line,stock.group_stock_user,1,1,1,1
5access_stock_truck_line_purchase,stock.truck.line all,model_stock_truck_line,purchase.group_purchase_user,1,1,1,1
06
=== added file 'pallet_delivery/stock.py'
--- pallet_delivery/stock.py 1970-01-01 00:00:00 +0000
+++ pallet_delivery/stock.py 2014-08-27 19:22:25 +0000
@@ -0,0 +1,310 @@
1# -*- coding: utf-8 -*-
2##############################################################################
3#
4# OpenERP, Open Source Management Solution
5# Copyright (C) 2013 Savoir-faire Linux (<http://www.savoirfairelinux.com>).
6#
7# This program is free software: you can redistribute it and/or modify
8# it under the terms of the GNU Affero General Public License as
9# published by the Free Software Foundation, either version 3 of the
10# License, or (at your option) any later version.
11#
12# This program is distributed in the hope that it will be useful,
13# but WITHOUT ANY WARRANTY; without even the implied warranty of
14# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15# GNU Affero General Public License for more details.
16#
17# You should have received a copy of the GNU Affero General Public License
18# along with this program. If not, see <http://www.gnu.org/licenses/>.
19#
20##############################################################################
21
22from collections import defaultdict
23from openerp.tools.translate import _
24from openerp.osv import orm, fields
25
26def group(lst):
27 """Saner group function than the one found in itertools
28
29 This one mimics Haskell's group from Data.List:
30 group :: Eq a => [a] -> [[a]]
31 """
32
33 if not lst:
34 return []
35
36 res = []
37 current = lst[0]
38
39 grp = []
40 for x in lst:
41 if x != current:
42 res.append(grp)
43 grp = []
44 grp.append(x)
45 current = x
46
47 if grp:
48 res.append(grp)
49
50 return res
51
52
53class stock_move(orm.Model):
54
55 _inherit = 'stock.move'
56
57 def _find_hidden(self, cr, uid, ids, context=None):
58 po_pool = self.pool.get("purchase.order")
59 hidden_id = po_pool.search(cr, uid, [('hidden', '=', True)], context=context)[0]
60 return po_pool.browse(cr, uid, hidden_id, context)
61
62 @staticmethod
63 def _unique_line(seq):
64 seen = set()
65 seen_add = seen.add
66 return [ x for x in seq if x not in seen and not seen_add(x)]
67
68 @staticmethod
69 def _get_line_name(line, crates=None, force_total_qty=False):
70 available = None
71 nice = '%s' % line.product_id.name
72 incoming_crates = line.product_qty
73 if crates:
74 # Incoming crates
75 available = max(0, incoming_crates - crates[line.id])
76 elif force_total_qty:
77 available = incoming_crates
78
79 nice += " / %s" % line.prodlot_id.name
80
81 if available is not None:
82 nice += " (%d)" % available
83
84 return nice, available
85
86 def name_get(self, cr, uid, ids, context=None):
87 if context is None:
88 context = {}
89
90 if isinstance(ids, (int, long)):
91 ids = [ids]
92
93 stl_pool = self.pool.get('stock.truck.line')
94 spi_pool = self.pool.get('stock.picking.in')
95 # Out from selection; display name
96
97 #hidden = self._find_hidden(cr, uid, ids, context=context)
98 res = []
99 if not context.has_key('nice'):
100 for line in self.browse(cr, uid, ids, context=context):
101 name, available = self._get_line_name(line)
102 res.append((line.id, name))
103
104 # Add special 'not ours' line
105 #res.append((hidden.id, hidden.name))
106 return res
107
108 # Doing a selection
109 # Add special 'not ours' line
110 #res.append((hidden.id, hidden.name))
111
112 # Retrieve entered form data
113 parent = context['parent']
114 all_pallets = parent['left_pallet_ids'] + parent['right_pallet_ids']
115 po_ids = parent['purchase_order_ids'][0][2]
116
117 # find list of stock picking in
118 spi_ids = spi_pool.search(cr, uid, [('purchase_id', '=', po_ids)],
119 context=context)
120
121 # Build crate structure
122 crates = defaultdict(lambda: 0)
123 for pallet_struct in all_pallets:
124 if pallet_struct[0] == 4:
125 st_line = stl_pool.browse(cr, uid, pallet_struct[1],
126 context=context)
127 crates[st_line.pallet.id] += st_line.crates
128 else:
129 fields = pallet_struct[2]
130 if fields and 'pallet' in fields:
131 crates[fields['pallet']] += fields['crates']
132
133 spi_lines = spi_pool.browse(cr, uid, spi_ids, context=context)
134 all_lines = [line for lines in spi_lines for line in lines.move_lines
135 if line.state == "assigned"]
136 move_line = self._unique_line(all_lines)
137
138 # Prettify data to be displayed
139 for line in move_line:
140 force_total_qty = not crates
141 name, available = self._get_line_name(line, crates=crates,
142 force_total_qty=force_total_qty)
143 if available:
144 res.append((line.id, name))
145
146 return res
147
148
149class purchase_order(orm.Model):
150
151 _inherit = 'purchase.order'
152
153 def _assigned(self, cr, uid, obj, name, args, context=None):
154 '''Domain filter on corresponding entries in stock.picking where state is assigned'''
155
156 if context is None:
157 context = {}
158
159 picking_pool = self.pool.get('stock.picking')
160 ids = picking_pool.search(cr, uid, [('state', '=', 'assigned')], context=context)
161 po_ids = [po.purchase_id.id for po in picking_pool.browse(cr, uid, ids, context=context)]
162
163 return [('id', 'in', po_ids)]
164
165 _columns = {
166 'hidden': fields.boolean('Hidden'),
167 'stock_truck_ids': fields.many2many(
168 'stock.truck', 'truck_order_rel', 'order_id', 'truck_id', 'Trucks'),
169 'assigned': fields.function(lambda **x: True, fnct_search=_assigned, type='boolean', method=True),
170 }
171
172
173class stock_truck_line(orm.Model):
174
175 _name = 'stock.truck.line'
176 _description = 'A single pallet shipped in an incoming truck'
177
178 _columns = {
179 'name': fields.char('Name', size=64),
180 'left_id': fields.many2one('stock.truck', 'Truck'),
181 'right_id': fields.many2one('stock.truck', 'Truck'),
182 'pallet': fields.many2one('stock.move', 'Pallet', required=True),
183 'crates': fields.integer('Crates', required=True),
184 }
185
186
187class stock_truck(orm.Model):
188
189 _name = 'stock.truck'
190 _description = 'Incoming truck'
191
192 def onchange_arrival(self, cr, uid, ids, arrival, context=None):
193 '''Force seconds to zero'''
194
195 arrival = arrival[:-2] + '00'
196
197 return {'value': {'arrival': arrival}}
198
199 def action_done(self, cr, uid, ids, context=None):
200 if context is None:
201 context = {}
202
203 truck = self.browse(cr, uid, ids, context=context)[0]
204
205 # Build a dictionary of:
206 # - key: Purchase Order
207 # - value: a dictionary of:
208 # - key: Lot Number
209 # - value: tuple of
210 # - Purchase Order Line
211 # - Crate count
212 products = defaultdict(dict)
213
214 def _process_pallets(column):
215 for line in column:
216 pallet = line.pallet
217 pi = pallet.picking_id
218 po = pallet.purchase_line_id.order_id
219 lot = pallet.prodlot_id if pallet.prodlot_id else None
220 # Skip over fake 'not ours' line
221 if po and po.hidden:
222 continue
223
224 if not products[pi.id].has_key(lot):
225 products[pi.id][lot] = (pallet, 0)
226
227 lot_product = products[pi.id][lot]
228 count = lot_product[1]
229 products[pi.id][lot] = (lot_product[0], count + line.crates)
230
231 _process_pallets(truck.left_pallet_ids)
232 _process_pallets(truck.right_pallet_ids)
233
234 # Make the calls to the Pickings stock moves
235
236 picking_pool = self.pool.get('stock.picking')
237
238 for po in truck.purchase_order_ids:
239 pi = None
240 pi_ids = picking_pool.search(
241 cr, uid,
242 ['&', ('purchase_id', '=', po.id), ('state', '=', 'assigned')],
243 context=context)
244 if pi_ids:
245 # take the last one
246 pi = pi_ids[-1]
247
248 if not pi or not products.has_key(pi):
249 # Purchase Order was added to the list, but there are not
250 # pallets pertaining to that PO.
251 continue
252
253 partial_data = {'delivery_date': truck.arrival}
254
255
256 for move_line, count in products[pi].values():
257 # Skip over the fake 'not ours' line
258 po_line = move_line.purchase_line_id
259 if po_line and po_line.order_id.hidden:
260 continue
261
262 partial_data['move%s' % (move_line.id, )] = {
263 'product_id': move_line.product_id.id,
264 'product_qty': count,
265 'product_uom': 1,
266 'prodlot_id': move_line.prodlot_id.id,
267 }
268
269 picking_pool.do_partial(cr, uid, [pi], partial_data, context=context)
270
271 self.write(cr, uid, ids, {'state': 'done'})
272
273 return True
274
275 @staticmethod
276 def validate_temperature(cr, uid, ids, temperature, field_name,
277 context=None):
278 try:
279 float(temperature)
280 except ValueError:
281 warning = {'title': _('Input Error !'),
282 'message': _('Please enter real numbers.')}
283 return {'value': {field_name: ""}, 'warning': warning}
284 return True
285
286 _columns = {
287 # Overhead
288 'name': fields.char('Name', size=64),
289 'state': fields.selection([
290 ('draft', 'Draft'),
291 ('done', 'Done'),
292 ], 'State', readonly=True, select=True, track_visibility='onchange'),
293
294 # Display
295 'front_temperature': fields.char('Front Temperature', required=True),
296 'back_temperature': fields.char('Back Temperature', required=True),
297 'truck_sn': fields.char('Truck S/N', size=64),
298 'supplier': fields.many2one('res.partner', 'Supplier', required=True),
299 'arrival': fields.datetime('Date of Arrival', required=True),
300 'purchase_order_ids': fields.many2many(
301 'purchase.order', 'truck_order_rel', 'truck_id', 'order_id', 'Purchase Orders'),
302 'left_pallet_ids': fields.one2many('stock.truck.line', 'left_id', 'Pallets'),
303 'right_pallet_ids': fields.one2many('stock.truck.line', 'right_id', 'Pallets'),
304 }
305
306 _defaults = {
307 'name': lambda self, cr, uid, ctx={}: self.pool.get('ir.sequence').get(cr, uid, 'stock.truck'),
308 'state': 'draft',
309 'front_temperature': None,
310 }
0311
=== added file 'pallet_delivery/stock_workflow.xml'
--- pallet_delivery/stock_workflow.xml 1970-01-01 00:00:00 +0000
+++ pallet_delivery/stock_workflow.xml 2014-08-27 19:22:25 +0000
@@ -0,0 +1,30 @@
1<?xml version="1.0" encoding="utf-8"?>
2<openerp>
3 <data>
4 <record id="wkf_stock_truck" model="workflow">
5 <field name="name">stock.truck</field>
6 <field name="osv">stock.truck</field>
7 <field name="on_create">True</field>
8 </record>
9
10 <record id="act_draft" model="workflow.activity">
11 <field name="wkf_id" ref="wkf_stock_truck" />
12 <field name="name">draft</field>
13 <field name="flow_start">True</field>
14 </record>
15
16 <record id="act_done" model="workflow.activity">
17 <field name="wkf_id" ref="wkf_stock_truck" />
18 <field name="name">done</field>
19 <field name="flow_stop">True</field>
20 <field name="kind">function</field>
21 <field name="action">action_done()</field>
22 </record>
23
24 <record id="trans_draft_done" model="workflow.transition">
25 <field name="act_from" ref="act_draft" />
26 <field name="act_to" ref="act_done" />
27 <field name="signal">button_done</field>
28 </record>
29 </data>
30</openerp>
031
=== added directory 'partner_discount'
=== added file 'partner_discount/__init__.py'
--- partner_discount/__init__.py 1970-01-01 00:00:00 +0000
+++ partner_discount/__init__.py 2014-08-27 19:22:25 +0000
@@ -0,0 +1,25 @@
1# -*- encoding: utf-8 -*-
2###############################################################################
3#
4# OpenERP, Open Source Management Solution
5# This module copyright (C) 2013 Savoir-faire Linux
6# (<http://www.savoirfairelinux.com>).
7#
8# This program is free software: you can redistribute it and/or modify
9# it under the terms of the GNU Affero General Public License as
10# published by the Free Software Foundation, either version 3 of the
11# License, or (at your option) any later version.
12#
13# This program is distributed in the hope that it will be useful,
14# but WITHOUT ANY WARRANTY; without even the implied warranty of
15# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16# GNU Affero General Public License for more details.
17#
18# You should have received a copy of the GNU Affero General Public License
19# along with this program. If not, see <http://www.gnu.org/licenses/>.
20#
21###############################################################################
22
23import res_partner
24
25# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
026
=== added file 'partner_discount/__openerp__.py'
--- partner_discount/__openerp__.py 1970-01-01 00:00:00 +0000
+++ partner_discount/__openerp__.py 2014-08-27 19:22:25 +0000
@@ -0,0 +1,41 @@
1# -*- encoding: utf-8 -*-
2###############################################################################
3#
4# OpenERP, Open Source Management Solution
5# This module copyright (C) 2013 Savoir-faire Linux
6# (<http://www.savoirfairelinux.com>).
7#
8# This program is free software: you can redistribute it and/or modify
9# it under the terms of the GNU Affero General Public License as
10# published by the Free Software Foundation, either version 3 of the
11# License, or (at your option) any later version.
12#
13# This program is distributed in the hope that it will be useful,
14# but WITHOUT ANY WARRANTY; without even the implied warranty of
15# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16# GNU Affero General Public License for more details.
17#
18# You should have received a copy of the GNU Affero General Public License
19# along with this program. If not, see <http://www.gnu.org/licenses/>.
20#
21###############################################################################
22
23{
24 'name': 'Partner Discount',
25 'version': '1.0',
26 'author': 'Savoir-faire Linux',
27 'maintainer': 'Savoir-faire Linux',
28 'website': 'http://www.savoirfairelinux.com',
29 'category': 'sale',
30 'description': """\
31Adds a discount percentage to the partner form.
32""",
33 'depends': [],
34 'data': ['res_partner_view.xml'],
35 'demo': [],
36 'test': [],
37 'installable': True,
38 'active': False,
39}
40
41# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
042
=== added directory 'partner_discount/i18n'
=== added file 'partner_discount/i18n/fr.po'
--- partner_discount/i18n/fr.po 1970-01-01 00:00:00 +0000
+++ partner_discount/i18n/fr.po 2014-08-27 19:22:25 +0000
@@ -0,0 +1,36 @@
1# Translation of OpenERP Server.
2# This file contains the translation of the following modules:
3# * partner_discount
4#
5msgid ""
6msgstr ""
7"Project-Id-Version: OpenERP Server 7.0\n"
8"Report-Msgid-Bugs-To: \n"
9"POT-Creation-Date: 2013-11-01 15:41+0000\n"
10"PO-Revision-Date: 2013-11-01 15:41+0000\n"
11"Last-Translator: <>\n"
12"Language-Team: \n"
13"MIME-Version: 1.0\n"
14"Content-Type: text/plain; charset=UTF-8\n"
15"Content-Transfer-Encoding: \n"
16"Plural-Forms: \n"
17
18#. module: partner_discount
19#: field:res.partner,discount:0
20msgid "Discount"
21msgstr "Ristourne"
22
23#. module: partner_discount
24#: help:res.partner,discount:0
25msgid "For percent enter a ratio between 0-1."
26msgstr "Pour être en pourcentage, saisir une valeur entre 0 et 1."
27
28#. module: partner_discount
29#: view:res.partner:0
30msgid "Sales & Purchases"
31msgstr "Achats-Ventes"
32
33#. module: partner_discount
34#: model:ir.model,name:partner_discount.model_res_partner
35msgid "Partner"
36msgstr "Partenaire"
037
=== added file 'partner_discount/i18n/partner_discount.pot'
--- partner_discount/i18n/partner_discount.pot 1970-01-01 00:00:00 +0000
+++ partner_discount/i18n/partner_discount.pot 2014-08-27 19:22:25 +0000
@@ -0,0 +1,36 @@
1# Translation of OpenERP Server.
2# This file contains the translation of the following modules:
3# * partner_discount
4#
5msgid ""
6msgstr ""
7"Project-Id-Version: OpenERP Server 7.0\n"
8"Report-Msgid-Bugs-To: \n"
9"POT-Creation-Date: 2013-11-01 15:41+0000\n"
10"PO-Revision-Date: 2013-11-01 15:41+0000\n"
11"Last-Translator: <>\n"
12"Language-Team: \n"
13"MIME-Version: 1.0\n"
14"Content-Type: text/plain; charset=UTF-8\n"
15"Content-Transfer-Encoding: \n"
16"Plural-Forms: \n"
17
18#. module: partner_discount
19#: field:res.partner,discount:0
20msgid "Discount"
21msgstr ""
22
23#. module: partner_discount
24#: help:res.partner,discount:0
25msgid "For percent enter a ratio between 0-1."
26msgstr ""
27
28#. module: partner_discount
29#: view:res.partner:0
30msgid "Sales & Purchases"
31msgstr ""
32
33#. module: partner_discount
34#: model:ir.model,name:partner_discount.model_res_partner
35msgid "Partner"
36msgstr ""
037
=== added file 'partner_discount/res_partner.py'
--- partner_discount/res_partner.py 1970-01-01 00:00:00 +0000
+++ partner_discount/res_partner.py 2014-08-27 19:22:25 +0000
@@ -0,0 +1,36 @@
1# -*- encoding: utf-8 -*-
2###############################################################################
3#
4# OpenERP, Open Source Management Solution
5# This module copyright (C) 2013 Savoir-faire Linux
6# (<http://www.savoirfairelinux.com>).
7#
8# This program is free software: you can redistribute it and/or modify
9# it under the terms of the GNU Affero General Public License as
10# published by the Free Software Foundation, either version 3 of the
11# License, or (at your option) any later version.
12#
13# This program is distributed in the hope that it will be useful,
14# but WITHOUT ANY WARRANTY; without even the implied warranty of
15# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16# GNU Affero General Public License for more details.
17#
18# You should have received a copy of the GNU Affero General Public License
19# along with this program. If not, see <http://www.gnu.org/licenses/>.
20#
21###############################################################################
22
23from openerp.osv import orm, fields
24
25
26class res_partner(orm.Model):
27 """ Inherits partner and adds discount percentage """
28 _inherit = 'res.partner'
29 _columns = {
30 'discount': fields.float('Discount', digits=(1, 4),
31 help="For percent enter a ratio between 0-1."),
32 }
33 _defaults = {'discount': 0.0}
34
35
36# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
037
=== added file 'partner_discount/res_partner_view.xml'
--- partner_discount/res_partner_view.xml 1970-01-01 00:00:00 +0000
+++ partner_discount/res_partner_view.xml 2014-08-27 19:22:25 +0000
@@ -0,0 +1,19 @@
1<?xml version = "1.0" encoding="utf-8"?>
2<openerp>
3 <data>
4 <record id="view_partner_discount_form" model="ir.ui.view">
5 <field name="name">res.partner.discount.form.inherit</field>
6 <field name="model">res.partner</field>
7 <field name="inherit_id" ref="base.view_partner_form"/>
8 <field name="arch" type="xml">
9 <page string="Sales &amp; Purchases">
10 <group>
11 <group>
12 <field name="discount"/>
13 </group>
14 </group>
15 </page>
16 </field>
17 </record>
18 </data>
19</openerp>
020
=== added directory 'produce_details'
=== added file 'produce_details/__init__.py'
--- produce_details/__init__.py 1970-01-01 00:00:00 +0000
+++ produce_details/__init__.py 2014-08-27 19:22:25 +0000
@@ -0,0 +1,22 @@
1# -*- coding: utf-8 -*-
2##############################################################################
3#
4# OpenERP, Open Source Management Solution
5# Copyright (C) 2013 Savoir-faire Linux (<http://www.savoirfairelinux.com>).
6#
7# This program is free software: you can redistribute it and/or modify
8# it under the terms of the GNU Affero General Public License as
9# published by the Free Software Foundation, either version 3 of the
10# License, or (at your option) any later version.
11#
12# This program is distributed in the hope that it will be useful,
13# but WITHOUT ANY WARRANTY; without even the implied warranty of
14# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15# GNU Affero General Public License for more details.
16#
17# You should have received a copy of the GNU Affero General Public License
18# along with this program. If not, see <http://www.gnu.org/licenses/>.
19#
20##############################################################################
21
22import product
023
=== added file 'produce_details/__openerp__.py'
--- produce_details/__openerp__.py 1970-01-01 00:00:00 +0000
+++ produce_details/__openerp__.py 2014-08-27 19:22:25 +0000
@@ -0,0 +1,49 @@
1# -*- coding: utf-8 -*-
2##############################################################################
3#
4# OpenERP, Open Source Management Solution
5# Copyright (C) 2013 Savoir-faire Linux (<http://www.savoirfairelinux.com>).
6#
7# This program is free software: you can redistribute it and/or modify
8# it under the terms of the GNU Affero General Public License as
9# published by the Free Software Foundation, either version 3 of the
10# License, or (at your option) any later version.
11#
12# This program is distributed in the hope that it will be useful,
13# but WITHOUT ANY WARRANTY; without even the implied warranty of
14# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15# GNU Affero General Public License for more details.
16#
17# You should have received a copy of the GNU Affero General Public License
18# along with this program. If not, see <http://www.gnu.org/licenses/>.
19#
20##############################################################################
21
22{
23 'name': 'Produce Details',
24 'version': '0.1',
25 'author': 'Savoir-faire Linux',
26 'maintainer': 'Savoir-faire Linux',
27 'website': 'http://www.savoirfairelinux.com',
28 'category': 'product',
29 'description': """
30Agricultural produce details
31============================
32
33This module adds four descriptive fields for produce-related products, namely:
34
35* A variety (e.g. Haden)
36* An origin (Brazil)
37* Conditioning weight (10 kg)
38* A size category (#12)
39* PLU code (4216)
40""",
41 'depends': ['base', 'purchase'],
42 'data': [
43 'produce_details_view.xml',
44 ],
45 'demo': [],
46 'test': [],
47 'installable': True,
48 'active': False,
49}
050
=== added directory 'produce_details/i18n'
=== added file 'produce_details/i18n/fr.po'
--- produce_details/i18n/fr.po 1970-01-01 00:00:00 +0000
+++ produce_details/i18n/fr.po 2014-08-27 19:22:25 +0000
@@ -0,0 +1,41 @@
1# Translation of OpenERP Server.
2# This file contains the translation of the following modules:
3# * produce_details
4#
5msgid ""
6msgstr ""
7"Project-Id-Version: OpenERP Server 7.0-20130811-231021\n"
8"Report-Msgid-Bugs-To: \n"
9"POT-Creation-Date: 2013-09-18 14:22+0000\n"
10"PO-Revision-Date: 2013-09-18 14:22+0000\n"
11"Last-Translator: Alexandre Boily <alexandre.boily@savoirfairelinux.com>\n"
12"Language-Team: Savoir-faire Linux\n"
13"MIME-Version: 1.0\n"
14"Content-Type: text/plain; charset=UTF-8\n"
15"Content-Transfer-Encoding: \n"
16"Plural-Forms: \n"
17
18#. module: produce_details
19#: field:product.product,origin:0
20msgid "Origin"
21msgstr "Origine"
22
23#. module: produce_details
24#: model:ir.model,name:produce_details.model_product_product
25msgid "Product"
26msgstr "Produit"
27
28#. module: produce_details
29#: field:product.product,variety:0
30msgid "Variety"
31msgstr "Variété"
32
33#. module: produce_details
34#: field:product.product,cond_weight:0
35msgid "Conditioning weight"
36msgstr "Poids de conditionnement"
37
38#. module: produce_details
39#: field:product.product,size_category:0
40msgid "Size"
41msgstr "Taille"
042
=== added file 'produce_details/i18n/produce_details.pot'
--- produce_details/i18n/produce_details.pot 1970-01-01 00:00:00 +0000
+++ produce_details/i18n/produce_details.pot 2014-08-27 19:22:25 +0000
@@ -0,0 +1,42 @@
1# Translation of OpenERP Server.
2# This file contains the translation of the following modules:
3# * produce_details
4#
5msgid ""
6msgstr ""
7"Project-Id-Version: OpenERP Server 7.0-20130811-231021\n"
8"Report-Msgid-Bugs-To: \n"
9"POT-Creation-Date: 2013-09-18 14:22+0000\n"
10"PO-Revision-Date: 2013-09-18 14:22+0000\n"
11"Last-Translator: <>\n"
12"Language-Team: \n"
13"MIME-Version: 1.0\n"
14"Content-Type: text/plain; charset=UTF-8\n"
15"Content-Transfer-Encoding: \n"
16"Plural-Forms: \n"
17
18#. module: produce_details
19#: field:product.product,origin:0
20msgid "Origin"
21msgstr ""
22
23#. module: produce_details
24#: model:ir.model,name:produce_details.model_product_product
25msgid "Product"
26msgstr ""
27
28#. module: produce_details
29#: field:product.product,variety:0
30msgid "Variety"
31msgstr ""
32
33#. module: produce_details
34#: field:product.product,cond_weight:0
35msgid "Conditioning weight"
36msgstr ""
37
38#. module: produce_details
39#: field:product.product,size_category:0
40msgid "Size"
41msgstr ""
42
043
=== added file 'produce_details/produce_details_view.xml'
--- produce_details/produce_details_view.xml 1970-01-01 00:00:00 +0000
+++ produce_details/produce_details_view.xml 2014-08-27 19:22:25 +0000
@@ -0,0 +1,34 @@
1<?xml version="1.0" encoding="utf-8" ?>
2<openerp>
3 <data>
4 <record id="produce_details_form" model="ir.ui.view">
5 <field name="name">product.product.produce.details.form</field>
6 <field name="model">product.product</field>
7 <field name="inherit_id" ref="product.product_normal_form_view" />
8 <field name="arch" type="xml">
9 <field name="description" position="before">
10 <group>
11 <group>
12 <field name="variety" />
13 <field name="origin" />
14 </group>
15
16 <group>
17 <field name="cond_weight" />
18 <field name="size_category" />
19 </group>
20 </group>
21 <group>
22 <group>
23 <label for="plu1"/>
24 <field name="plu1" nolabel="1" />
25 <div />
26 <field name="plu2" nolabel="1" />
27 </group>
28 <group/>
29 </group>
30 </field>
31 </field>
32 </record>
33 </data>
34</openerp>
035
=== added file 'produce_details/product.py'
--- produce_details/product.py 1970-01-01 00:00:00 +0000
+++ produce_details/product.py 2014-08-27 19:22:25 +0000
@@ -0,0 +1,36 @@
1# -*- coding: utf-8 -*-
2##############################################################################
3#
4# OpenERP, Open Source Management Solution
5# Copyright (C) 2013 Savoir-faire Linux (<http://www.savoirfairelinux.com>).
6#
7# This program is free software: you can redistribute it and/or modify
8# it under the terms of the GNU Affero General Public License as
9# published by the Free Software Foundation, either version 3 of the
10# License, or (at your option) any later version.
11#
12# This program is distributed in the hope that it will be useful,
13# but WITHOUT ANY WARRANTY; without even the implied warranty of
14# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15# GNU Affero General Public License for more details.
16#
17# You should have received a copy of the GNU Affero General Public License
18# along with this program. If not, see <http://www.gnu.org/licenses/>.
19#
20##############################################################################
21
22import openerp.addons.decimal_precision as dp
23from openerp.osv import orm, fields
24
25class product_product(orm.Model):
26
27 _inherit = 'product.product'
28
29 _columns = {
30 'variety': fields.char('Variety', size=64),
31 'origin': fields.many2one('res.country', 'Origin'),
32 'cond_weight': fields.float('Conditioning weight', digits_compute=dp.get_precision('Stock Weight'), help='Conditioning weight in kg.'),
33 'size_category': fields.char('Size', size=16),
34 'plu1': fields.char('PLU', size=8),
35 'plu2': fields.char('PLU2', size=8),
36 }
037
=== added directory 'product_reserve_forecast'
=== added file 'product_reserve_forecast/__init__.py'
--- product_reserve_forecast/__init__.py 1970-01-01 00:00:00 +0000
+++ product_reserve_forecast/__init__.py 2014-08-27 19:22:25 +0000
@@ -0,0 +1,23 @@
1# -*- coding: utf-8 -*-
2##############################################################################
3#
4# OpenERP, Open Source Management Solution
5# Copyright (C) 2013 Savoir-faire Linux (<http://www.savoirfairelinux.com>).
6#
7# This program is free software: you can redistribute it and/or modify
8# it under the terms of the GNU Affero General Public License as
9# published by the Free Software Foundation, either version 3 of the
10# License, or (at your option) any later version.
11#
12# This program is distributed in the hope that it will be useful,
13# but WITHOUT ANY WARRANTY; without even the implied warranty of
14# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15# GNU Affero General Public License for more details.
16#
17# You should have received a copy of the GNU Affero General Public License
18# along with this program. If not, see <http://www.gnu.org/licenses/>.
19#
20##############################################################################
21
22import product
23import sale_stock
024
=== added file 'product_reserve_forecast/__openerp__.py'
--- product_reserve_forecast/__openerp__.py 1970-01-01 00:00:00 +0000
+++ product_reserve_forecast/__openerp__.py 2014-08-27 19:22:25 +0000
@@ -0,0 +1,44 @@
1# -*- coding: utf-8 -*-
2##############################################################################
3#
4# OpenERP, Open Source Management Solution
5# Copyright (C) 2013 Savoir-faire Linux (<http://www.savoirfairelinux.com>).
6#
7# This program is free software: you can redistribute it and/or modify
8# it under the terms of the GNU Affero General Public License as
9# published by the Free Software Foundation, either version 3 of the
10# License, or (at your option) any later version.
11#
12# This program is distributed in the hope that it will be useful,
13# but WITHOUT ANY WARRANTY; without even the implied warranty of
14# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15# GNU Affero General Public License for more details.
16#
17# You should have received a copy of the GNU Affero General Public License
18# along with this program. If not, see <http://www.gnu.org/licenses/>.
19#
20##############################################################################
21
22{
23 'name': 'Reserve Product Quantity on Forecast',
24 'version': '0.1',
25 'author': 'Savoir-faire Linux',
26 'maintainer': 'Savoir-faire Linux',
27 'website': 'http://www.savoirfairelinux.com',
28 'category': 'product',
29 'description': """
30Put aside an unsaleable quantity for a product
31==============================================
32
33This reduces the forecasted quantity by a given amount.
34""",
35 'depends': ['base', 'product', 'sale', 'sale_stock', 'stock'],
36 'data': [
37 'security/product_reserve_forecast_security.xml',
38 'product_reserve_forecast_view.xml',
39 ],
40 'demo': [],
41 'test': [],
42 'installable': True,
43 'active': False,
44}
045
=== added directory 'product_reserve_forecast/i18n'
=== added file 'product_reserve_forecast/i18n/fr.po'
--- product_reserve_forecast/i18n/fr.po 1970-01-01 00:00:00 +0000
+++ product_reserve_forecast/i18n/fr.po 2014-08-27 19:22:25 +0000
@@ -0,0 +1,67 @@
1# Translation of OpenERP Server.
2# This file contains the translation of the following modules:
3# * product_reserve_forecast
4#
5msgid ""
6msgstr ""
7"Project-Id-Version: OpenERP Server 7.0-20130811-231021\n"
8"Report-Msgid-Bugs-To: \n"
9"POT-Creation-Date: 2013-09-26 11:42+0000\n"
10"PO-Revision-Date: 2013-09-26 11:42+0000\n"
11"Last-Translator: Alexandre Boily <alexandre.boily@savoirfairelinux.com>\n"
12"Language-Team: Savoir-faire Linux\n"
13"MIME-Version: 1.0\n"
14"Content-Type: text/plain; charset=UTF-8\n"
15"Content-Transfer-Encoding: \n"
16"Plural-Forms: \n"
17
18#. module: product_reserve_forecast
19#: field:product.product,virtual_clone:0
20msgid "Forecasted Quantity"
21msgstr "Quantité prévue"
22
23#. module: product_reserve_forecast
24#: model:ir.model,name:product_reserve_forecast.model_product_product
25msgid "Product"
26msgstr "Produit"
27
28#. module: product_reserve_forecast
29#: code:addons/product_reserve_forecast/sale_stock.py:85
30#, python-format
31msgid "Not enough stock ! : "
32msgstr "Pas assez de stock: "
33
34#. module: product_reserve_forecast
35#: code:addons/product_reserve_forecast/sale_stock.py:81
36#, python-format
37msgid "You plan to sell %.2f %s but you only have %.2f %s available !\n"
38"The real stock is %.2f %s. (without reservations)"
39msgstr "Vous planifiez vendre %.2f %s, mais seulement %.2f %s sont disponibles.
40La vraie quantité en stock est %.2f %s (sans réservations)."
41
42#. module: product_reserve_forecast
43#: model:res.groups,name:product_reserve_forecast.group_product_reserve
44msgid "Define product reserve quantity"
45msgstr "Définir la quantié réservée sur un produit"
46
47#. module: product_reserve_forecast
48#: code:addons/product_reserve_forecast/sale_stock.py:90
49#, python-format
50msgid "Configuration Error!"
51msgstr "Erreur de configuration!"
52
53#. module: product_reserve_forecast
54#: field:product.product,reserved:0
55msgid "Reserved Quantity"
56msgstr "Quantité réservée"
57
58#. module: product_reserve_forecast
59#: model:ir.model,name:product_reserve_forecast.model_sale_order_line
60msgid "Sales Order Line"
61msgstr "Ligne de vente"
62
63#. module: product_reserve_forecast
64#: model:res.groups,comment:product_reserve_forecast.group_product_reserve
65msgid "Can see and set the per product reserve quantity."
66msgstr "Peut voir et modifier la quantité réservée d'un produit."
67
068
=== added file 'product_reserve_forecast/i18n/product_reserve_forecast.pot'
--- product_reserve_forecast/i18n/product_reserve_forecast.pot 1970-01-01 00:00:00 +0000
+++ product_reserve_forecast/i18n/product_reserve_forecast.pot 2014-08-27 19:22:25 +0000
@@ -0,0 +1,66 @@
1# Translation of OpenERP Server.
2# This file contains the translation of the following modules:
3# * product_reserve_forecast
4#
5msgid ""
6msgstr ""
7"Project-Id-Version: OpenERP Server 7.0-20130811-231021\n"
8"Report-Msgid-Bugs-To: \n"
9"POT-Creation-Date: 2013-09-26 11:42+0000\n"
10"PO-Revision-Date: 2013-09-26 11:42+0000\n"
11"Last-Translator: <>\n"
12"Language-Team: \n"
13"MIME-Version: 1.0\n"
14"Content-Type: text/plain; charset=UTF-8\n"
15"Content-Transfer-Encoding: \n"
16"Plural-Forms: \n"
17
18#. module: product_reserve_forecast
19#: field:product.product,virtual_clone:0
20msgid "Forecasted Quantity"
21msgstr ""
22
23#. module: product_reserve_forecast
24#: model:ir.model,name:product_reserve_forecast.model_product_product
25msgid "Product"
26msgstr ""
27
28#. module: product_reserve_forecast
29#: code:addons/product_reserve_forecast/sale_stock.py:85
30#, python-format
31msgid "Not enough stock ! : "
32msgstr ""
33
34#. module: product_reserve_forecast
35#: code:addons/product_reserve_forecast/sale_stock.py:81
36#, python-format
37msgid "You plan to sell %.2f %s but you only have %.2f %s available !\n"
38"The real stock is %.2f %s. (without reservations)"
39msgstr ""
40
41#. module: product_reserve_forecast
42#: model:res.groups,name:product_reserve_forecast.group_product_reserve
43msgid "Define product reserve quantity"
44msgstr ""
45
46#. module: product_reserve_forecast
47#: code:addons/product_reserve_forecast/sale_stock.py:90
48#, python-format
49msgid "Configuration Error!"
50msgstr ""
51
52#. module: product_reserve_forecast
53#: field:product.product,reserved:0
54msgid "Reserved Quantity"
55msgstr ""
56
57#. module: product_reserve_forecast
58#: model:ir.model,name:product_reserve_forecast.model_sale_order_line
59msgid "Sales Order Line"
60msgstr ""
61
62#. module: product_reserve_forecast
63#: model:res.groups,comment:product_reserve_forecast.group_product_reserve
64msgid "Can see and set the per product reserve quantity."
65msgstr ""
66
067
=== added file 'product_reserve_forecast/product.py'
--- product_reserve_forecast/product.py 1970-01-01 00:00:00 +0000
+++ product_reserve_forecast/product.py 2014-08-27 19:22:25 +0000
@@ -0,0 +1,70 @@
1# -*- coding: utf-8 -*-
2##############################################################################
3#
4# OpenERP, Open Source Management Solution
5# Copyright (C) 2013 Savoir-faire Linux (<http://www.savoirfairelinux.com>).
6#
7# This program is free software: you can redistribute it and/or modify
8# it under the terms of the GNU Affero General Public License as
9# published by the Free Software Foundation, either version 3 of the
10# License, or (at your option) any later version.
11#
12# This program is distributed in the hope that it will be useful,
13# but WITHOUT ANY WARRANTY; without even the implied warranty of
14# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15# GNU Affero General Public License for more details.
16#
17# You should have received a copy of the GNU Affero General Public License
18# along with this program. If not, see <http://www.gnu.org/licenses/>.
19#
20##############################################################################
21
22import openerp.addons.decimal_precision as dp
23from openerp.osv import orm, fields
24
25class product_product(orm.Model):
26
27 _inherit = 'product.product'
28
29 def _virtual_available(self, cr, uid, ids, names, arg, context=None):
30 orig = self._product_available(cr, uid, ids, names, arg, context=context)
31 product_pool = self.pool.get('product.product')
32 for product_id in orig.keys():
33 reserved = product_pool.browse(cr, uid, product_id, context=context).reserved
34 orig[product_id]['virtual_available'] -= reserved
35
36 return orig
37
38 def _virtual_clone(self, cr, uid, ids, names, arg, context=None):
39 '''Small hack to get priority over the Stock module's virtual_available'''
40
41 res = {}
42
43 for line in self.browse(cr, uid, ids, context=context):
44 res[line.id] = line.virtual_available
45
46 return res
47
48 _columns = {
49 'reserved': fields.integer('Reserved Quantity'),
50
51 'virtual_clone':
52 fields.function(_virtual_clone, type='float',
53 digits_compute=dp.get_precision('Product Unit of Measure'), string='Forecasted Quantity'),
54
55 'virtual_available': fields.function(_virtual_available, multi='qty_available',
56 type='float', digits_compute=dp.get_precision('Product Unit of Measure'),
57 string='Forecasted Quantity',
58 help="Forecast quantity (computed as Quantity On Hand "
59 "- Outgoing - Reserved + Incoming)\n"
60 "In a context with a single Stock Location, this includes "
61 "goods stored in this location, or any of its children.\n"
62 "In a context with a single Warehouse, this includes "
63 "goods stored in the Stock Location of this Warehouse, or any "
64 "of its children.\n"
65 "In a context with a single Shop, this includes goods "
66 "stored in the Stock Location of the Warehouse of this Shop, "
67 "or any of its children.\n"
68 "Otherwise, this includes goods stored in any Stock Location "
69 "with 'internal' type."),
70 }
071
=== added file 'product_reserve_forecast/product_reserve_forecast_view.xml'
--- product_reserve_forecast/product_reserve_forecast_view.xml 1970-01-01 00:00:00 +0000
+++ product_reserve_forecast/product_reserve_forecast_view.xml 2014-08-27 19:22:25 +0000
@@ -0,0 +1,28 @@
1<?xml version="1.0" encoding="utf8" ?>
2<openerp>
3 <data>
4 <record id="product_reserve_forecast_form" model="ir.ui.view">
5 <field name="name">product.product.reserve.form</field>
6 <field name="model">product.product</field>
7 <field name="inherit_id" ref="stock.view_normal_procurement_locations_form" />
8 <field name="arch" type="xml">
9 <field name="virtual_available" position="replace">
10 <field name="virtual_clone" />
11 <field name="reserved" groups="product_reserve_forecast.group_product_reserve" />
12 </field>
13 </field>
14 </record>
15
16 <record id="product_reserve_forecast_tree" model="ir.ui.view">
17 <field name="name">product.product.reserve.tree</field>
18 <field name="model">product.product</field>
19 <field name="inherit_id" ref="product.product_product_tree_view" />
20 <field name="arch" type="xml">
21 <field name="virtual_available" position="replace">
22 <field name="virtual_available" invisible="1" />
23 <field name="virtual_clone" />
24 </field>
25 </field>
26 </record>
27 </data>
28</openerp>
029
=== added file 'product_reserve_forecast/sale_stock.py'
--- product_reserve_forecast/sale_stock.py 1970-01-01 00:00:00 +0000
+++ product_reserve_forecast/sale_stock.py 2014-08-27 19:22:25 +0000
@@ -0,0 +1,94 @@
1# -*- coding: utf-8 -*-
2##############################################################################
3#
4# OpenERP, Open Source Management Solution
5# Copyright (C) 2013 Savoir-faire Linux (<http://www.savoirfairelinux.com>).
6#
7# This program is free software: you can redistribute it and/or modify
8# it under the terms of the GNU Affero General Public License as
9# published by the Free Software Foundation, either version 3 of the
10# License, or (at your option) any later version.
11#
12# This program is distributed in the hope that it will be useful,
13# but WITHOUT ANY WARRANTY; without even the implied warranty of
14# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15# GNU Affero General Public License for more details.
16#
17# You should have received a copy of the GNU Affero General Public License
18# along with this program. If not, see <http://www.gnu.org/licenses/>.
19#
20##############################################################################
21
22from openerp.osv import fields, orm
23from openerp.tools import float_compare
24from openerp.tools.translate import _
25
26class sale_order_line(orm.Model):
27
28 _inherit = 'sale.order.line'
29
30 def product_id_change(self, cr, uid, ids, pricelist, product, qty=0,
31 uom=False, qty_uos=0, uos=False, name='', partner_id=False,
32 lang=False, update_tax=True, date_order=False, packaging=False,
33 fiscal_position=False, flag=False, context=None):
34 '''Slightly tweaked copy from sale_stock
35
36 The only difference resides in the way the compare_qty is computed: in
37 this implementation, take into account the product's reserved quantity.
38 '''
39
40 context = context or {}
41 product_uom_obj = self.pool.get('product.uom')
42 partner_obj = self.pool.get('res.partner')
43 product_obj = self.pool.get('product.product')
44 warning = {}
45 res = super(sale_order_line, self).product_id_change(cr, uid, ids, pricelist, product, qty=qty,
46 uom=uom, qty_uos=qty_uos, uos=uos, name=name, partner_id=partner_id,
47 lang=lang, update_tax=update_tax, date_order=date_order, packaging=packaging, fiscal_position=fiscal_position, flag=flag, context=context)
48
49 if not product:
50 res['value'].update({'product_packaging': False})
51 return res
52
53 #update of result obtained in super function
54 product_obj = product_obj.browse(cr, uid, product, context=context)
55 res['value']['delay'] = (product_obj.sale_delay or 0.0)
56 res['value']['type'] = product_obj.procure_method
57
58 #check if product is available, and if not: raise an error
59 uom2 = False
60 if uom:
61 uom2 = product_uom_obj.browse(cr, uid, uom)
62 if product_obj.uom_id.category_id.id != uom2.category_id.id:
63 uom = False
64 if not uom2:
65 uom2 = product_obj.uom_id
66
67 # Calling product_packaging_change function after updating UoM
68 res_packing = self.product_packaging_change(cr, uid, ids, pricelist, product, qty, uom, partner_id, packaging, context=context)
69 res['value'].update(res_packing.get('value', {}))
70 warning_msgs = res_packing.get('warning') and res_packing['warning']['message'] or ''
71
72 # Original comparison did not substract reserved quantity
73 avail = product_obj.virtual_available - product_obj.reserved
74 compare_qty = float_compare(
75 avail * uom2.factor,
76 qty * product_obj.uom_id.factor,
77 precision_rounding=product_obj.uom_id.rounding)
78
79 if (product_obj.type=='product') and int(compare_qty) == -1 \
80 and (product_obj.procure_method=='make_to_stock'):
81 warn_msg = _('You plan to sell %.2f %s but you only have %.2f %s available !\nThe real stock is %.2f %s. (without reservations)') % \
82 (qty, uom2 and uom2.name or product_obj.uom_id.name,
83 max(0,product_obj.virtual_available), product_obj.uom_id.name,
84 max(0,product_obj.qty_available), product_obj.uom_id.name)
85 warning_msgs += _("Not enough stock ! : ") + warn_msg + "\n\n"
86
87 #update of warning messages
88 if warning_msgs:
89 warning = {
90 'title': _('Configuration Error!'),
91 'message' : warning_msgs
92 }
93 res.update({'warning': warning})
94 return res
095
=== added directory 'product_reserve_forecast/security'
=== added file 'product_reserve_forecast/security/ir.model.access.csv'
--- product_reserve_forecast/security/ir.model.access.csv 1970-01-01 00:00:00 +0000
+++ product_reserve_forecast/security/ir.model.access.csv 2014-08-27 19:22:25 +0000
@@ -0,0 +1,1 @@
1access_sale_order_warn,access_sale_order_warn,model_sale_order_warn,,1,1,1,1
02
=== added file 'product_reserve_forecast/security/product_reserve_forecast_security.xml'
--- product_reserve_forecast/security/product_reserve_forecast_security.xml 1970-01-01 00:00:00 +0000
+++ product_reserve_forecast/security/product_reserve_forecast_security.xml 2014-08-27 19:22:25 +0000
@@ -0,0 +1,11 @@
1<?xml version="1.0" encoding="utf-8" ?>
2<openerp>
3 <data>
4 <record id="group_product_reserve" model="res.groups">
5 <field name="name">Define product reserve quantity</field>
6 <field name="category_id" ref="base.module_category_hidden" />
7 <field name="comment">Can see and set the per product reserve quantity.</field>
8 <field name="implied_ids" eval="[(4, ref('base.group_user'))]" />
9 </record>
10 </data>
11</openerp>
012
=== added directory 'purchase_gains'
=== added file 'purchase_gains/__init__.py'
--- purchase_gains/__init__.py 1970-01-01 00:00:00 +0000
+++ purchase_gains/__init__.py 2014-08-27 19:22:25 +0000
@@ -0,0 +1,23 @@
1# -*- coding: utf-8 -*-
2##############################################################################
3#
4# OpenERP, Open Source Management Solution
5# Copyright (C) 2013 Savoir-faire Linux (<http://www.savoirfairelinux.com>).
6#
7# This program is free software: you can redistribute it and/or modify
8# it under the terms of the GNU Affero General Public License as
9# published by the Free Software Foundation, either version 3 of the
10# License, or (at your option) any later version.
11#
12# This program is distributed in the hope that it will be useful,
13# but WITHOUT ANY WARRANTY; without even the implied warranty of
14# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15# GNU Affero General Public License for more details.
16#
17# You should have received a copy of the GNU Affero General Public License
18# along with this program. If not, see <http://www.gnu.org/licenses/>.
19#
20##############################################################################
21
22import report
23import purchase
024
=== added file 'purchase_gains/__init__.pyc'
1Binary files purchase_gains/__init__.pyc 1970-01-01 00:00:00 +0000 and purchase_gains/__init__.pyc 2014-08-27 19:22:25 +0000 differ25Binary 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
=== added file 'purchase_gains/__openerp__.py'
--- purchase_gains/__openerp__.py 1970-01-01 00:00:00 +0000
+++ purchase_gains/__openerp__.py 2014-08-27 19:22:25 +0000
@@ -0,0 +1,45 @@
1# -*- coding: utf-8 -*-
2##############################################################################
3#
4# OpenERP, Open Source Management Solution
5# Copyright (C) 2013 Savoir-faire Linux (<http://www.savoirfairelinux.com>).
6#
7# This program is free software: you can redistribute it and/or modify
8# it under the terms of the GNU Affero General Public License as
9# published by the Free Software Foundation, either version 3 of the
10# License, or (at your option) any later version.
11#
12# This program is distributed in the hope that it will be useful,
13# but WITHOUT ANY WARRANTY; without even the implied warranty of
14# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15# GNU Affero General Public License for more details.
16#
17# You should have received a copy of the GNU Affero General Public License
18# along with this program. If not, see <http://www.gnu.org/licenses/>.
19#
20##############################################################################
21
22# NOTE: The name of the supplied field was initially "display_name", but it seems that OpenERP,
23# whenever it seems "name" in the field, returns the value for "name". Well...
24
25{
26 'name': 'Purchase gain',
27 'version': '1.1',
28 'author': 'Savoir-faire Linux',
29 'maintainer': 'Savoir-faire Linux',
30 'website': 'http://www.savoirfairelinux.com',
31 'category': 'Generic Modules/Purchases',
32 'description': """
33Create a menu in reporting for Purchase gains
34====================================================
35""",
36 'depends': ['base', 'purchase'],
37 'data': [
38 'purchase_report.xml',
39 'purchase_view.xml',
40 ],
41 'demo': [],
42 'test': [],
43 'installable': True,
44 'active': False,
45}
046
=== added file 'purchase_gains/purchase.py'
--- purchase_gains/purchase.py 1970-01-01 00:00:00 +0000
+++ purchase_gains/purchase.py 2014-08-27 19:22:25 +0000
@@ -0,0 +1,106 @@
1# -*- coding: utf-8 -*-
2##############################################################################
3#
4# OpenERP, Open Source Management Solution
5# Copyright (C) 2013 Savoir-faire Linux (<http://www.savoirfairelinux.com>).
6#
7# This program is free software: you can redistribute it and/or modify
8# it under the terms of the GNU Affero General Public License as
9# published by the Free Software Foundation, either version 3 of the
10# License, or (at your option) any later version.
11#
12# This program is distributed in the hope that it will be useful,
13# but WITHOUT ANY WARRANTY; without even the implied warranty of
14# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15# GNU Affero General Public License for more details.
16#
17# You should have received a copy of the GNU Affero General Public License
18# along with this program. If not, see <http://www.gnu.org/licenses/>.
19#
20##############################################################################
21
22from openerp.osv import orm, fields
23import openerp.addons.decimal_precision as dp
24
25class purchase_order(orm.Model):
26
27 _inherit = 'purchase.order'
28
29 def get_profit_all(self, cr, uid, ids, name, args, context):
30 if not ids:
31 return {}
32 res = {}
33 for line in self.browse(cr, uid, ids):
34 res[line.id] = {
35 'profit_po': 0.0,
36 'amount_total_discount': 0.0,
37 'amount_landing_cost': 0.0,
38 'amount_total_price_unit': 0.0,
39 'amount_total_sale_order': 0.0
40 }
41 total_landed_cost_po = 0.0
42 if line.landed_cost_line_ids:
43 for costs in line.landed_cost_line_ids:
44 total_landed_cost_po += costs.amount
45 res[line.id]['amount_landing_cost'] = total_landed_cost_po
46 total_price_unit = 0.0
47
48 amount_total_sale_order = 0.0
49 amount_total_discounts = 0.0
50 total_landed_cost_so = 0.0
51 if line.order_line:
52 for one_line in line.order_line:
53 acc_id = one_line.account_analytic_id.id
54 total_price_unit += one_line.price_unit
55 ids_stock_prod_lot = self.pool.get('stock.production.lot').search(cr, uid, [('account_analytic_id', '=', acc_id)], context=context)[0]
56 id_stock_prod_lot = self.pool.get('stock.production.lot').browse(cr, uid, ids_stock_prod_lot).id
57 stock_move_ids = self.pool.get('stock.move').search(cr, uid, [('prodlot_id', '=', id_stock_prod_lot)], context=context)
58
59 list_stock_move = self.pool.get('stock.move').browse(cr, uid, stock_move_ids, context)
60 amount_total_sale_order = 0.0
61 amount_total_discounts = 0.0
62 if list_stock_move:
63 for one_move_line in list_stock_move:
64 if one_move_line.picking_id.sale_id:
65 amount_total_sale_order += one_move_line.picking_id.sale_id.amount_total
66 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))
67 total_landed_cost_so = 0.0
68 if one_move_line.picking_id.sale_id.landed_cost_line_ids:
69 for costs_so in one_move_line.picking_id.sale_id.landed_cost_line_ids:
70 total_landed_cost_so += costs_so.amount
71 res[line.id]['total_landed_cost_so'] = total_landed_cost_so
72 res[line.id]['amount_total_price_unit'] = total_price_unit
73 res[line.id]['amount_total_discount'] = amount_total_discounts
74 res[line.id]['amount_total_sale_order'] = amount_total_sale_order
75 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'])
76 return res
77
78
79 _columns = {
80 'profit_po': fields.function(
81 get_profit_all,
82 digits_compute=dp.get_precision('Account'),
83 string='Profit', multi='all'),
84 'amount_total_discount': fields.function(
85 get_profit_all,
86 digits_compute=dp.get_precision('Account'),
87 string='Total amount discount', multi='all'),
88 'amount_landing_cost': fields.function(
89 get_profit_all,
90 digits_compute=dp.get_precision('Account'),
91 string='Total amount landing cost', multi='all'),
92 'amount_total_price_unit': fields.function(
93 get_profit_all,
94 digits_compute=dp.get_precision('Account'),
95 string='Total amount price unit', multi='all'),
96 'amount_total_sale_order': fields.function(
97 get_profit_all,
98 digits_compute=dp.get_precision('Account'),
99 string='Total amount sale order', multi='all'),
100 'total_landed_cost_so': fields.function(
101 get_profit_all,
102 digits_compute=dp.get_precision('Account'),
103 string='Total amount landing cost sale order', multi='all'),
104 }
105
106
0107
=== added file 'purchase_gains/purchase.pyc'
1Binary files purchase_gains/purchase.pyc 1970-01-01 00:00:00 +0000 and purchase_gains/purchase.pyc 2014-08-27 19:22:25 +0000 differ108Binary 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
=== added file 'purchase_gains/purchase_report.xml'
--- purchase_gains/purchase_report.xml 1970-01-01 00:00:00 +0000
+++ purchase_gains/purchase_report.xml 2014-08-27 19:22:25 +0000
@@ -0,0 +1,9 @@
1<?xml version="1.0" encoding="utf-8"?>
2<openerp>
3 <data>
4 <report auto="False" id="report_purchase_order_gains" model="purchase.order"
5 name="purchase.order.gains" rml="purchase_gains/report/order.rml"
6 usage="default" string="Purchase Order gains"/>
7
8 </data>
9</openerp>
0\ No newline at end of file10\ No newline at end of file
111
=== added file 'purchase_gains/purchase_view.xml'
--- purchase_gains/purchase_view.xml 1970-01-01 00:00:00 +0000
+++ purchase_gains/purchase_view.xml 2014-08-27 19:22:25 +0000
@@ -0,0 +1,14 @@
1<openerp>
2 <data>
3 <record id="purchase_order_tree_inherit44" model="ir.ui.view">
4 <field name="name">purchase.order.tree.inherit44</field>
5 <field name="model">purchase.order</field>
6 <field name="inherit_id" ref="purchase.purchase_order_tree"></field>
7 <field name="arch" type="xml">
8 <field name="state" position="after">
9 <field name="profit_po"></field>
10 </field>
11 </field>
12 </record>
13 </data>
14</openerp>
015
=== added directory 'purchase_gains/report'
=== added file 'purchase_gains/report/__init__.py'
--- purchase_gains/report/__init__.py 1970-01-01 00:00:00 +0000
+++ purchase_gains/report/__init__.py 2014-08-27 19:22:25 +0000
@@ -0,0 +1,24 @@
1# -*- coding: utf-8 -*-
2##############################################################################
3#
4# OpenERP, Open Source Management Solution
5# Copyright (C) 2013 Savoir-faire Linux (<http://www.savoirfairelinux.com>).
6#
7# This program is free software: you can redistribute it and/or modify
8# it under the terms of the GNU Affero General Public License as
9# published by the Free Software Foundation, either version 3 of the
10# License, or (at your option) any later version.
11#
12# This program is distributed in the hope that it will be useful,
13# but WITHOUT ANY WARRANTY; without even the implied warranty of
14# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15# GNU Affero General Public License for more details.
16#
17# You should have received a copy of the GNU Affero General Public License
18# along with this program. If not, see <http://www.gnu.org/licenses/>.
19#
20##############################################################################
21
22import order
23
24# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
0\ No newline at end of file25\ No newline at end of file
126
=== added file 'purchase_gains/report/order.py'
--- purchase_gains/report/order.py 1970-01-01 00:00:00 +0000
+++ purchase_gains/report/order.py 2014-08-27 19:22:25 +0000
@@ -0,0 +1,35 @@
1# -*- coding: utf-8 -*-
2##############################################################################
3#
4# OpenERP, Open Source Management Solution
5# Copyright (C) 2013 Savoir-faire Linux (<http://www.savoirfairelinux.com>).
6#
7# This program is free software: you can redistribute it and/or modify
8# it under the terms of the GNU Affero General Public License as
9# published by the Free Software Foundation, either version 3 of the
10# License, or (at your option) any later version.
11#
12# This program is distributed in the hope that it will be useful,
13# but WITHOUT ANY WARRANTY; without even the implied warranty of
14# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15# GNU Affero General Public License for more details.
16#
17# You should have received a copy of the GNU Affero General Public License
18# along with this program. If not, see <http://www.gnu.org/licenses/>.
19#
20##############################################################################
21
22import time
23from openerp.report import report_sxw
24from openerp.osv import osv
25from openerp import pooler
26
27class order(report_sxw.rml_parse):
28 def __init__(self, cr, uid, name, context):
29 super(order, self).__init__(cr, uid, name, context=context)
30 self.localcontext.update({'time': time})
31
32report_sxw.report_sxw('report.purchase.order.gains','purchase.order','addons/purchase_gains/report/order.rml',parser=order)
33
34# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
35
036
=== added file 'purchase_gains/report/order.rml'
--- purchase_gains/report/order.rml 1970-01-01 00:00:00 +0000
+++ purchase_gains/report/order.rml 2014-08-27 19:22:25 +0000
@@ -0,0 +1,172 @@
1<?xml version="1.0"?>
2<document filename="Purchase Order.pdf">
3 <template title="Purchase Order" author="OpenERP S.A.(sales@openerp.com)" allowSplitting="20">
4 <pageTemplate id="first">
5 <frame id="first" x1="18.0" y1="42.0" width="535" height="758"/>
6 </pageTemplate>
7 </template>
8 <stylesheet>
9 <blockTableStyle id="Standard_Outline">
10 <blockAlignment value="LEFT"/>
11 <blockValign value="TOP"/>
12 </blockTableStyle>
13 <blockTableStyle id="Tableau1">
14 <blockAlignment value="LEFT"/>
15 <blockValign value="TOP"/>
16 </blockTableStyle>
17 <blockTableStyle id="Tableau2">
18 <blockAlignment value="LEFT"/>
19 <blockValign value="TOP"/>
20 </blockTableStyle>
21 <blockTableStyle id="Header_Order_Reference_Tbl">
22 <blockAlignment value="LEFT"/>
23 <blockValign value="TOP"/>
24 <lineStyle kind="LINEBEFORE" colorName="#e6e6e6" start="0,0" stop="0,-1"/>
25 <lineStyle kind="LINEABOVE" colorName="#e6e6e6" start="0,0" stop="0,0"/>
26 <lineStyle kind="LINEBELOW" colorName="#e6e6e6" start="0,-1" stop="0,-1"/>
27 <lineStyle kind="LINEBEFORE" colorName="#e6e6e6" start="1,0" stop="1,-1"/>
28 <lineStyle kind="LINEABOVE" colorName="#e6e6e6" start="1,0" stop="1,0"/>
29 <lineStyle kind="LINEBELOW" colorName="#e6e6e6" start="1,-1" stop="1,-1"/>
30 <lineStyle kind="LINEBEFORE" colorName="#e6e6e6" start="2,0" stop="2,-1"/>
31 <lineStyle kind="LINEABOVE" colorName="#e6e6e6" start="2,0" stop="2,0"/>
32 <lineStyle kind="LINEBELOW" colorName="#e6e6e6" start="2,-1" stop="2,-1"/>
33 <lineStyle kind="LINEBEFORE" colorName="#e6e6e6" start="3,0" stop="3,-1"/>
34 <lineStyle kind="LINEAFTER" colorName="#e6e6e6" start="3,0" stop="3,-1"/>
35 <lineStyle kind="LINEABOVE" colorName="#e6e6e6" start="3,0" stop="3,0"/>
36 <lineStyle kind="LINEBELOW" colorName="#e6e6e6" start="3,-1" stop="3,-1"/>
37 <lineStyle kind="LINEAFTER" colorName="#e6e6e6" start="4,0" stop="4,-1"/>
38 <lineStyle kind="LINEABOVE" colorName="#e6e6e6" start="4,0" stop="4,0"/>
39 <lineStyle kind="LINEBELOW" colorName="#e6e6e6" start="4,-1" stop="4,-1"/>
40 </blockTableStyle>
41 <blockTableStyle id="Content_Order_Reference_Table">
42 <blockAlignment value="LEFT"/>
43 <blockValign value="TOP"/>
44 <lineStyle kind="LINEBEFORE" colorName="#e6e6e6" start="0,0" stop="0,-1"/>
45 <lineStyle kind="LINEABOVE" colorName="#e6e6e6" start="0,0" stop="0,0"/>
46 <lineStyle kind="LINEBELOW" colorName="#e6e6e6" start="0,-1" stop="0,-1"/>
47 <lineStyle kind="LINEBEFORE" colorName="#e6e6e6" start="1,0" stop="1,-1"/>
48 <lineStyle kind="LINEABOVE" colorName="#e6e6e6" start="1,0" stop="1,0"/>
49 <lineStyle kind="LINEBELOW" colorName="#e6e6e6" start="1,-1" stop="1,-1"/>
50 <lineStyle kind="LINEBEFORE" colorName="#e6e6e6" start="2,0" stop="2,-1"/>
51 <lineStyle kind="LINEABOVE" colorName="#e6e6e6" start="2,0" stop="2,0"/>
52 <lineStyle kind="LINEBELOW" colorName="#e6e6e6" start="2,-1" stop="2,-1"/>
53 <lineStyle kind="LINEBEFORE" colorName="#e6e6e6" start="3,0" stop="3,-1"/>
54 <lineStyle kind="LINEAFTER" colorName="#e6e6e6" start="3,0" stop="3,-1"/>
55 <lineStyle kind="LINEABOVE" colorName="#e6e6e6" start="3,0" stop="3,0"/>
56 <lineStyle kind="LINEBELOW" colorName="#e6e6e6" start="3,-1" stop="3,-1"/>
57 <lineStyle kind="LINEAFTER" colorName="#e6e6e6" start="4,0" stop="4,-1"/>
58 <lineStyle kind="LINEABOVE" colorName="#e6e6e6" start="4,0" stop="4,0"/>
59 <lineStyle kind="LINEBELOW" colorName="#e6e6e6" start="4,-1" stop="4,-1"/>
60 </blockTableStyle>
61 <blockTableStyle id="Table_Header_Pur_ord_Line">
62 <blockAlignment value="LEFT"/>
63 <blockValign value="TOP"/>
64 <lineStyle kind="LINEBELOW" colorName="#000000" start="0,-1" stop="0,-1"/>
65 <lineStyle kind="LINEBELOW" colorName="#000000" start="1,-1" stop="1,-1"/>
66 <lineStyle kind="LINEBELOW" colorName="#000000" start="2,-1" stop="2,-1"/>
67 <lineStyle kind="LINEBELOW" colorName="#000000" start="3,-1" stop="3,-1"/>
68 <lineStyle kind="LINEBELOW" colorName="#000000" start="4,-1" stop="4,-1"/>
69 <lineStyle kind="LINEBELOW" colorName="#000000" start="5,-1" stop="5,-1"/>
70 </blockTableStyle>
71 <blockTableStyle id="Table_Order_Pur_line_Content">
72 <blockAlignment value="LEFT"/>
73 <blockValign value="TOP"/>
74 <lineStyle kind="LINEBELOW" colorName="#e6e6e6" start="0,-1" stop="0,-1"/>
75 <lineStyle kind="LINEBELOW" colorName="#e6e6e6" start="1,-1" stop="1,-1"/>
76 <lineStyle kind="LINEBELOW" colorName="#e6e6e6" start="2,-1" stop="2,-1"/>
77 <lineStyle kind="LINEBELOW" colorName="#e6e6e6" start="3,-1" stop="3,-1"/>
78 <lineStyle kind="LINEBELOW" colorName="#e6e6e6" start="4,-1" stop="4,-1"/>
79 <lineStyle kind="LINEBELOW" colorName="#e6e6e6" start="5,-1" stop="5,-1"/>
80 <lineStyle kind="LINEBELOW" colorName="#e6e6e6" start="0,-1" stop="0,-1"/>
81 <lineStyle kind="LINEBELOW" colorName="#e6e6e6" start="1,-1" stop="1,-1"/>
82 <lineStyle kind="LINEBELOW" colorName="#e6e6e6" start="2,-1" stop="2,-1"/>
83 <lineStyle kind="LINEBELOW" colorName="#e6e6e6" start="3,-1" stop="3,-1"/>
84 <lineStyle kind="LINEBELOW" colorName="#e6e6e6" start="4,-1" stop="4,-1"/>
85 <lineStyle kind="LINEBELOW" colorName="#e6e6e6" start="5,-1" stop="5,-1"/>
86 </blockTableStyle>
87 <blockTableStyle id="Table_All_Total_Detail">
88 <blockAlignment value="LEFT"/>
89 <blockValign value="TOP"/>
90 <lineStyle kind="LINEABOVE" colorName="#ffffff" start="0,0" stop="0,0"/>
91 <lineStyle kind="LINEABOVE" colorName="#000000" start="1,0" stop="1,0"/>
92 <lineStyle kind="LINEABOVE" colorName="#000000" start="2,0" stop="2,0"/>
93 <lineStyle kind="LINEABOVE" colorName="#000000" start="1,2" stop="1,2"/>
94 <lineStyle kind="LINEABOVE" colorName="#000000" start="2,2" stop="2,2"/>
95 </blockTableStyle>
96 <blockTableStyle id="Table_Outer_Notes">
97 <blockAlignment value="LEFT"/>
98 <blockValign value="TOP"/>
99 </blockTableStyle>
100 <initialize>
101 <paraStyle name="all" alignment="justify"/>
102 </initialize>
103 <paraStyle name="terp_header" fontSize="12.0" leading="15" alignment="LEFT" spaceBefore="12.0" spaceAfter="6.0"/>
104 <paraStyle name="terp_tblheader_General" fontSize="8.0" leading="10" alignment="LEFT" spaceBefore="6.0" spaceAfter="6.0"/>
105 <paraStyle name="terp_default_8" fontSize="8.0" leading="10" alignment="LEFT" spaceBefore="0.0" spaceAfter="0.0"/>
106 <paraStyle name="terp_tblheader_General_Centre" fontSize="8.0" leading="10" alignment="CENTER" spaceBefore="6.0" spaceAfter="6.0"/>
107 <paraStyle name="terp_tblheader_General_Right" fontSize="8.0" leading="10" alignment="RIGHT" spaceBefore="6.0" spaceAfter="6.0"/>
108 <paraStyle name="terp_default_Centre_8" fontSize="8.0" leading="10" alignment="CENTER" spaceBefore="0.0" spaceAfter="0.0"/>
109 <paraStyle name="terp_default_9" fontSize="9.0" leading="11" alignment="LEFT" spaceBefore="0.0" spaceAfter="0.0"/>
110 <paraStyle name="terp_default_Bold_9" fontSize="9.0" leading="11" alignment="LEFT" spaceBefore="0.0" spaceAfter="0.0"/>
111 <paraStyle name="terp_default_Right_9" fontSize="9.0" leading="11" alignment="RIGHT" spaceBefore="0.0" spaceAfter="0.0"/>
112 <paraStyle name="terp_default_Bold_9_Right" fontSize="9.0" leading="11" alignment="RIGHT" spaceBefore="0.0" spaceAfter="0.0"/>
113 <images/>
114 </stylesheet>
115 <story>
116 <pto>
117 <!--<para style="terp_default_8">[[ setLang(o.partner_id.lang) ]]</para>-->
118 <para style="terp_default_9">
119 <font color="white"> </font>
120 </para>
121 <para style="terp_default_9">
122 <font color="white"> </font>
123 </para>
124 <para style="terp_header"><b>Purchase Order gains </b></para>
125 <para style="terp_default_8">
126 <font color="white"> </font>
127 </para>
128 <blockTable colWidths="136.0,132.0,96.0,100.0,70.0" style="Header_Order_Reference_Tbl">
129 <tr>
130 <td>
131 <para style="terp_tblheader_General_Centre"><b>Our Order Reference</b></para>
132 </td>
133 <td>
134 <para style="terp_tblheader_General_Centre"><b>Your Order Reference</b></para>
135 </td>
136 <td>
137 <para style="terp_tblheader_General_Centre"><b>Order Date</b></para>
138 </td>
139 <td>
140 <para style="terp_tblheader_General_Centre"><b>Validated By</b></para>
141 </td>
142 <td>
143 <para style="terp_tblheader_General_Centre"><b>Profit</b></para>
144 </td>
145 </tr>
146 </blockTable>
147 <section>
148 <para style="terp_default_8">[[repeatIn(objects,'o')]]</para>
149 <blockTable colWidths="136.0,132.0,96.0,100.0,70.0" style="Content_Order_Reference_Table">
150 <tr>
151 <td>
152 <para style="terp_default_Centre_8">[[ o.name or '' ]]</para>
153 </td>
154 <td>
155 <para style="terp_default_Centre_8">[[ o.partner_ref or '' ]]</para>
156 </td>
157 <td>
158 <para style="terp_default_Centre_8">[[formatLang(o.date_order,date=True) ]]</para>
159 </td>
160 <td>
161 <para style="terp_default_Centre_8">[[ (o.validator and o.validator.name) or '' ]]</para>
162 </td>
163 <td>
164 <para style="terp_default_Centre_8">[[ formatLang(o.profit_po, digits=get_digits(dp='Account'), currency_obj=o.pricelist_id.currency_id ) ]]</para>
165 <para style="terp_default_Centre_8"></para>
166 </td>
167 </tr>
168 </blockTable>
169 </section>
170 </pto>
171 </story>
172</document>
0173
=== added directory 'purchase_lot_tracking'
=== added file 'purchase_lot_tracking/README'
=== added file 'purchase_lot_tracking/__init__.py'
--- purchase_lot_tracking/__init__.py 1970-01-01 00:00:00 +0000
+++ purchase_lot_tracking/__init__.py 2014-08-27 19:22:25 +0000
@@ -0,0 +1,28 @@
1# -*- coding: utf-8 -*-
2##############################################################################
3#
4# OpenERP, Open Source Management Solution
5# Copyright (C) 2013 Savoir-faire Linux (<http://www.savoirfairelinux.com>).
6#
7# This program is free software: you can redistribute it and/or modify
8# it under the terms of the GNU Affero General Public License as
9# published by the Free Software Foundation, either version 3 of the
10# License, or (at your option) any later version.
11#
12# This program is distributed in the hope that it will be useful,
13# but WITHOUT ANY WARRANTY; without even the implied warranty of
14# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15# GNU Affero General Public License for more details.
16#
17# You should have received a copy of the GNU Affero General Public License
18# along with this program. If not, see <http://www.gnu.org/licenses/>.
19#
20##############################################################################
21
22import purchase_lot_tracking
23import product
24import purchase
25import stock
26import wizard
27import account
28import sale
029
=== added file 'purchase_lot_tracking/__openerp__.py'
--- purchase_lot_tracking/__openerp__.py 1970-01-01 00:00:00 +0000
+++ purchase_lot_tracking/__openerp__.py 2014-08-27 19:22:25 +0000
@@ -0,0 +1,52 @@
1# -*- coding: utf-8 -*-
2##############################################################################
3#
4# OpenERP, Open Source Management Solution
5# Copyright (C) 2013 Savoir-faire Linux (<http://www.savoirfairelinux.com>).
6#
7# This program is free software: you can redistribute it and/or modify
8# it under the terms of the GNU Affero General Public License as
9# published by the Free Software Foundation, either version 3 of the
10# License, or (at your option) any later version.
11#
12# This program is distributed in the hope that it will be useful,
13# but WITHOUT ANY WARRANTY; without even the implied warranty of
14# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15# GNU Affero General Public License for more details.
16#
17# You should have received a copy of the GNU Affero General Public License
18# along with this program. If not, see <http://www.gnu.org/licenses/>.
19#
20##############################################################################
21
22# NOTE: The name of the supplied field was initially "display_name", but it seems that OpenERP,
23# whenever it seems "name" in the field, returns the value for "name". Well...
24
25{
26 'name': 'purchase_lot_tracking',
27 'version': '1.0',
28 'author': 'Savoir-faire Linux',
29 'website': 'http://www.savoirfairelinux.com',
30 'category': 'Generic Modules/Purchases',
31 'description': """
32Lets you track expenses using product's lots numbers
33====================================================
34
35This module lets you track expenses using a product's lot
36number.
37
38If you create an analytic account for a product
39
40
41""",
42 'depends': ['base', 'purchase', 'purchase_landed_costs', 'analytic', 'sale'],
43 'data': [
44 'purchase_lot_tracking_view.xml',
45 'purchase_workflow.xml',
46 'account_view.xml'
47 ],
48 'demo': [],
49 'test': [],
50 'installable': True,
51 'active': False,
52}
053
=== added file 'purchase_lot_tracking/account.py'
--- purchase_lot_tracking/account.py 1970-01-01 00:00:00 +0000
+++ purchase_lot_tracking/account.py 2014-08-27 19:22:25 +0000
@@ -0,0 +1,88 @@
1# -*- coding: utf-8 -*-
2##############################################################################
3#
4# OpenERP, Open Source Management Solution
5# Copyright (C) 2013 Savoir-faire Linux (<http://www.savoirfairelinux.com>).
6#
7# This program is free software: you can redistribute it and/or modify
8# it under the terms of the GNU Affero General Public License as
9# published by the Free Software Foundation, either version 3 of the
10# License, or (at your option) any later version.
11#
12# This program is distributed in the hope that it will be useful,
13# but WITHOUT ANY WARRANTY; without even the implied warranty of
14# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15# GNU Affero General Public License for more details.
16#
17# You should have received a copy of the GNU Affero General Public License
18# along with this program. If not, see <http://www.gnu.org/licenses/>.
19#
20##############################################################################
21
22from openerp.osv import orm, fields
23import openerp.addons.decimal_precision as dp
24
25class account_analytic_account(orm.Model):
26
27 _inherit = 'account.analytic.account'
28
29 def _calculate_total_in(self, cr, uid, ids, name, arg, context=None):
30 res = {}
31
32 move_pool = self.pool.get('stock.move')
33
34 for account in self.browse(cr, uid, ids):
35 res[account.id] = 0.0
36 total_moves = 0
37 production_pool = self.pool.get('stock.production.lot')
38 lot_ids = production_pool.search(cr, uid, [('name', '=', account.name)])
39
40 for lot in production_pool.browse(cr, uid, lot_ids):
41 move_ids = move_pool.search(
42 cr, uid, [('prodlot_id', '=', lot.id)])
43 for move in move_pool.browse(cr, uid, move_ids):
44
45 # Add in purchases, remove sales
46 if move.type == 'in':
47 total_moves += move.product_qty
48 #else:
49 # total_moves -= move.product_qty
50
51 total_moves = max(total_moves, 0)
52 res[account.id] = total_moves
53
54 return res
55
56 def _calculate_tcu(self, cr, uid, ids, name, arg, context=None):
57 res = {}
58 for account in self.browse(cr, uid, ids):
59 res[account.id] = 0.0
60 if account.total_in_qty > 0:
61 res[account.id] = account.credit / account.total_in_qty
62 return res
63
64 def _estimated_tcu(self, cr, uid, ids, name, arg, context=None):
65 res = {}
66 po_line_pool = self.pool.get('purchase.order.line')
67 for line in self.browse(cr, uid, ids):
68 if line.code.startswith('LOT'):
69 po_line_ids = po_line_pool.search(cr, uid, [('account_analytic_id', '=', line.id)])
70 if po_line_ids:
71 po_line_id = po_line_ids[0]
72 po_line = po_line_pool.browse(cr, uid, po_line_id, context)
73 if po_line.product_qty == 0:
74 res[line.id] = 0
75 else:
76 res[line.id] = po_line.landed_costs / po_line.product_qty
77 else:
78 res[line.id] = 0.0
79 else:
80 res[line.id] = 0.0
81 return res
82
83 _columns = {
84 'purchase_order': fields.many2one('purchase.order', 'Purchase Order', help='Issuing Purchase Order'),
85 'total_cost_unit': fields.function(_calculate_tcu, string='Total Cost Unit', type='float'),
86 'estimated_tcu': fields.function(_estimated_tcu, string='Estimated Total Cost per Unit', type='float'),
87 'total_in_qty': fields.function(_calculate_total_in, string='Total Received Quantity', type='float'),
88 }
089
=== added file 'purchase_lot_tracking/account_view.xml'
--- purchase_lot_tracking/account_view.xml 1970-01-01 00:00:00 +0000
+++ purchase_lot_tracking/account_view.xml 2014-08-27 19:22:25 +0000
@@ -0,0 +1,28 @@
1<?xml version="1.0" encoding="utf-8"?>
2<openerp>
3 <data>
4 <record id="lot_total_cost_unit" model="ir.ui.view">
5 <field name="name">Total Cost Unit</field>
6 <field name="model">account.analytic.account</field>
7 <field name="inherit_id" ref="account.view_account_analytic_account_tree" />
8 <field name="arch" type="xml">
9 <field name="type" position="before">
10 <field name="total_in_qty" />
11 <field name="estimated_tcu" />
12 <field name="total_cost_unit"/>
13 </field>
14 </field>
15 </record>
16
17 <record id="lot_purchase_order" model="ir.ui.view">
18 <field name="name">Purchase Order</field>
19 <field name="model">account.analytic.account</field>
20 <field name="inherit_id" ref="account.view_account_analytic_account_tree" />
21 <field name="arch" type="xml">
22 <field name="code" position="before">
23 <field name="purchase_order" />
24 </field>
25 </field>
26 </record>
27 </data>
28</openerp>
029
=== added directory 'purchase_lot_tracking/i18n'
=== added file 'purchase_lot_tracking/i18n/fr.po'
--- purchase_lot_tracking/i18n/fr.po 1970-01-01 00:00:00 +0000
+++ purchase_lot_tracking/i18n/fr.po 2014-08-27 19:22:25 +0000
@@ -0,0 +1,109 @@
1# Translation of OpenERP Server.
2# This file contains the translation of the following modules:
3# * purchase_lot_tracking
4#
5msgid ""
6msgstr ""
7"Project-Id-Version: OpenERP Server 7.0-20130811-231021\n"
8"Report-Msgid-Bugs-To: \n"
9"POT-Creation-Date: 2013-09-18 14:23+0000\n"
10"PO-Revision-Date: 2013-09-18 14:23+0000\n"
11"Last-Translator: Alexandre Boily <alexandre.boily@savoirfairelinux.com>\n"
12"Language-Team: Savoir-faire Linux\n"
13"MIME-Version: 1.0\n"
14"Content-Type: text/plain; charset=UTF-8\n"
15"Content-Transfer-Encoding: \n"
16"Plural-Forms: \n"
17
18#. module: purchase_lot_tracking
19#: field:sale.order.line,average:0
20msgid "Avg."
21msgstr "Moy."
22
23#. module: purchase_lot_tracking
24#: model:ir.model,name:purchase_lot_tracking.model_product_category
25msgid "Product Category"
26msgstr "Catégorie de produit"
27
28#. module: purchase_lot_tracking
29#: model:ir.model,name:purchase_lot_tracking.model_stock_invoice_onshipping
30msgid "Stock Invoice Onshipping"
31msgstr "Stock Invoice Onshipping"
32
33#. module: purchase_lot_tracking
34#: field:sale.order.line,minimum:0
35msgid "Min."
36msgstr "Min."
37
38#. module: purchase_lot_tracking
39#: model:ir.model,name:purchase_lot_tracking.model_purchase_order_line
40msgid "Purchase Order Line"
41msgstr "Ligne de bon de commande"
42
43#. module: purchase_lot_tracking
44#: model:ir.model,name:purchase_lot_tracking.model_stock_partial_picking_line
45msgid "stock.partial.picking.line"
46msgstr "stock.partial.picking.line"
47
48#. module: purchase_lot_tracking
49#: field:product.category,account_id:0
50#: field:product.product,account_id:0
51msgid "Analytical Account"
52msgstr "Compte analytique"
53
54#. module: purchase_lot_tracking
55#: model:ir.model,name:purchase_lot_tracking.model_product_product
56msgid "Product"
57msgstr "Produit"
58
59#. module: purchase_lot_tracking
60#: model:ir.model,name:purchase_lot_tracking.model_account_analytic_account
61#: view:product.category:0
62#: field:stock.production.lot,account_analytic_id:0
63msgid "Analytic Account"
64msgstr "Compte analytique"
65
66#. module: purchase_lot_tracking
67#: field:purchase.order.line,lot:0
68msgid "Lot Number"
69msgstr "Numéro de lot"
70
71#. module: purchase_lot_tracking
72#: model:ir.model,name:purchase_lot_tracking.model_stock_production_lot
73msgid "Serial Number"
74msgstr "Numéro de série"
75
76#. module: purchase_lot_tracking
77#: field:sale.order.line,maximum:0
78msgid "Max."
79msgstr "Max."
80
81#. module: purchase_lot_tracking
82#: field:account.analytic.account,estimated_tcu:0
83msgid "Estimated Total Cost per Unit"
84msgstr "Coût total estimé par unité"
85
86#. module: purchase_lot_tracking
87#: model:ir.model,name:purchase_lot_tracking.model_account_invoice
88msgid "Invoice"
89msgstr "Facture"
90
91#. module: purchase_lot_tracking
92#: field:account.analytic.account,total_cost_unit:0
93msgid "Total Cost Unit"
94msgstr "Coût total unitaire"
95
96#. module: purchase_lot_tracking
97#: model:ir.model,name:purchase_lot_tracking.model_purchase_order
98msgid "Purchase Order"
99msgstr "Bon de commande"
100
101#. module: purchase_lot_tracking
102#: model:ir.model,name:purchase_lot_tracking.model_sale_order_line
103msgid "Sales Order Line"
104msgstr "Ligne de bon d'achat"
105
106#. module: purchase_lot_tracking
107#: field:account.analytic.account,total_in_qty:0
108msgid "Total Received Quantity"
109msgstr "Quantité reçue totale"
0110
=== added file 'purchase_lot_tracking/i18n/purchase_lot_tracking.pot'
--- purchase_lot_tracking/i18n/purchase_lot_tracking.pot 1970-01-01 00:00:00 +0000
+++ purchase_lot_tracking/i18n/purchase_lot_tracking.pot 2014-08-27 19:22:25 +0000
@@ -0,0 +1,110 @@
1# Translation of OpenERP Server.
2# This file contains the translation of the following modules:
3# * purchase_lot_tracking
4#
5msgid ""
6msgstr ""
7"Project-Id-Version: OpenERP Server 7.0-20130811-231021\n"
8"Report-Msgid-Bugs-To: \n"
9"POT-Creation-Date: 2013-09-18 14:23+0000\n"
10"PO-Revision-Date: 2013-09-18 14:23+0000\n"
11"Last-Translator: <>\n"
12"Language-Team: \n"
13"MIME-Version: 1.0\n"
14"Content-Type: text/plain; charset=UTF-8\n"
15"Content-Transfer-Encoding: \n"
16"Plural-Forms: \n"
17
18#. module: purchase_lot_tracking
19#: field:sale.order.line,average:0
20msgid "Avg."
21msgstr ""
22
23#. module: purchase_lot_tracking
24#: model:ir.model,name:purchase_lot_tracking.model_product_category
25msgid "Product Category"
26msgstr ""
27
28#. module: purchase_lot_tracking
29#: model:ir.model,name:purchase_lot_tracking.model_stock_invoice_onshipping
30msgid "Stock Invoice Onshipping"
31msgstr ""
32
33#. module: purchase_lot_tracking
34#: field:sale.order.line,minimum:0
35msgid "Min."
36msgstr ""
37
38#. module: purchase_lot_tracking
39#: model:ir.model,name:purchase_lot_tracking.model_purchase_order_line
40msgid "Purchase Order Line"
41msgstr ""
42
43#. module: purchase_lot_tracking
44#: model:ir.model,name:purchase_lot_tracking.model_stock_partial_picking_line
45msgid "stock.partial.picking.line"
46msgstr ""
47
48#. module: purchase_lot_tracking
49#: field:product.category,account_id:0
50#: field:product.product,account_id:0
51msgid "Analytical Account"
52msgstr ""
53
54#. module: purchase_lot_tracking
55#: model:ir.model,name:purchase_lot_tracking.model_product_product
56msgid "Product"
57msgstr ""
58
59#. module: purchase_lot_tracking
60#: model:ir.model,name:purchase_lot_tracking.model_account_analytic_account
61#: view:product.category:0
62#: field:stock.production.lot,account_analytic_id:0
63msgid "Analytic Account"
64msgstr ""
65
66#. module: purchase_lot_tracking
67#: field:purchase.order.line,lot:0
68msgid "Lot Number"
69msgstr ""
70
71#. module: purchase_lot_tracking
72#: model:ir.model,name:purchase_lot_tracking.model_stock_production_lot
73msgid "Serial Number"
74msgstr ""
75
76#. module: purchase_lot_tracking
77#: field:sale.order.line,maximum:0
78msgid "Max."
79msgstr ""
80
81#. module: purchase_lot_tracking
82#: field:account.analytic.account,estimated_tcu:0
83msgid "Estimated Total Cost per Unit"
84msgstr ""
85
86#. module: purchase_lot_tracking
87#: model:ir.model,name:purchase_lot_tracking.model_account_invoice
88msgid "Invoice"
89msgstr ""
90
91#. module: purchase_lot_tracking
92#: field:account.analytic.account,total_cost_unit:0
93msgid "Total Cost Unit"
94msgstr ""
95
96#. module: purchase_lot_tracking
97#: model:ir.model,name:purchase_lot_tracking.model_purchase_order
98msgid "Purchase Order"
99msgstr ""
100
101#. module: purchase_lot_tracking
102#: model:ir.model,name:purchase_lot_tracking.model_sale_order_line
103msgid "Sales Order Line"
104msgstr ""
105
106#. module: purchase_lot_tracking
107#: field:account.analytic.account,total_in_qty:0
108msgid "Total Received Quantity"
109msgstr ""
110
0111
=== added file 'purchase_lot_tracking/product.py'
--- purchase_lot_tracking/product.py 1970-01-01 00:00:00 +0000
+++ purchase_lot_tracking/product.py 2014-08-27 19:22:25 +0000
@@ -0,0 +1,44 @@
1# -*- coding: utf-8 -*-
2##############################################################################
3#
4# OpenERP, Open Source Management Solution
5# Copyright (C) 2013 Savoir-faire Linux (<http://www.savoirfairelinux.com>).
6#
7# This program is free software: you can redistribute it and/or modify
8# it under the terms of the GNU Affero General Public License as
9# published by the Free Software Foundation, either version 3 of the
10# License, or (at your option) any later version.
11#
12# This program is distributed in the hope that it will be useful,
13# but WITHOUT ANY WARRANTY; without even the implied warranty of
14# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15# GNU Affero General Public License for more details.
16#
17# You should have received a copy of the GNU Affero General Public License
18# along with this program. If not, see <http://www.gnu.org/licenses/>.
19#
20##############################################################################
21
22from openerp.osv import orm, fields
23
24class product_category(orm.Model):
25 """
26 Adds an analytical account to a purchase category
27 """
28
29 _inherit = 'product.category'
30
31 _columns = {
32 'account_id': fields.many2one('account.analytic.account', 'Analytical Account', required=False)
33 }
34
35class product_product(orm.Model):
36 """
37 Adds an analytical account to a purchase category
38 """
39
40 _inherit = 'product.product'
41
42 _columns = {
43 'account_id': fields.many2one('account.analytic.account', 'Analytical Account', required=False)
44 }
045
=== added file 'purchase_lot_tracking/purchase.py'
--- purchase_lot_tracking/purchase.py 1970-01-01 00:00:00 +0000
+++ purchase_lot_tracking/purchase.py 2014-08-27 19:22:25 +0000
@@ -0,0 +1,265 @@
1# -*- coding: utf-8 -*-
2##############################################################################
3#
4# OpenERP, Open Source Management Solution
5# Copyright (C) 2013 Savoir-faire Linux (<http://www.savoirfairelinux.com>).
6#
7# This program is free software: you can redistribute it and/or modify
8# it under the terms of the GNU Affero General Public License as
9# published by the Free Software Foundation, either version 3 of the
10# License, or (at your option) any later version.
11#
12# This program is distributed in the hope that it will be useful,
13# but WITHOUT ANY WARRANTY; without even the implied warranty of
14# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15# GNU Affero General Public License for more details.
16#
17# You should have received a copy of the GNU Affero General Public License
18# along with this program. If not, see <http://www.gnu.org/licenses/>.
19#
20##############################################################################
21
22from openerp.osv import orm, fields
23from openerp import netsvc
24
25
26def assign_lot_number(pool, cr, uid, line_orders, context=None):
27 """
28 Manages and tracks a lot number for this production line
29
30 Generates a lot number, a stock.production.lot and an analytic
31 account for this purchase order line.
32 """
33 stock_prod_lot_obj = pool.get('stock.production.lot')
34 ir_sequence_obj = pool.get('ir.sequence')
35
36 for line_order in line_orders:
37 order_id = line_order.order_id.id
38
39 lot_number = ir_sequence_obj.get(cr, uid, 'ls.lot')
40 product = line_order.product_id
41
42 # Creates the analytic account
43 account_id = _analytic_account_from_product(pool,
44 cr,
45 uid,
46 order_id,
47 product,
48 lot_number,
49 context=context)
50
51 # Creates the stock.production.line
52 serial_number_data = {
53 'name': lot_number,
54 'product_id': product.id,
55 'account_analytic_id': account_id,
56 }
57
58 serial_number_id = stock_prod_lot_obj.create(cr, uid,
59 serial_number_data,
60 context=context)
61
62 return serial_number_id, account_id
63
64
65def _analytic_account_from_product(pool, cr, uid, order_id, product,
66 lot_number, context=None):
67 """
68 Creates an analytic account for the lot number and places it
69 as a children of the product's analytic account.
70
71 Assumes two variables in the context
72 - product: parent product id
73 - lot_number: lot_number to create analytic account for
74 """
75 account_analytic_obj = pool.get('account.analytic.account')
76 parent_account = product.account_id
77
78 account_values = {
79 'name': lot_number,
80 'complete_name': lot_number,
81 'purchase_order': order_id,
82 'code': lot_number,
83 'type': 'normal',
84 'parent_id': parent_account.id,
85 'balance': 0.0,
86 'debit': 0.0,
87 'credit': 0.0,
88 'quantity': 0.0,
89 'date_start': parent_account.date_start,
90 'date': parent_account.date,
91 'state': parent_account.state,
92 }
93
94 if parent_account.currency_id:
95 account_values['currency_id'] = parent_account.currency_id.id
96
97 analytic_account_id = account_analytic_obj.create(cr, uid,
98 account_values,
99 context=context)
100
101 return analytic_account_id
102
103
104class purchase_order_line(orm.Model):
105 """
106 Adds an analytical account to a product
107 """
108
109 _inherit = 'purchase.order.line'
110
111 def must_be_tracked(self, cr, uid, ids):
112 """
113 Determines if this purchase order line for this product must be tracked
114 """
115 return True
116
117
118
119
120 _columns = {
121 'lot': fields.char('Lot Number', size=64, required=False,
122 translate=True),
123 }
124
125
126class purchase_order(orm.Model):
127 _inherit = "purchase.order"
128
129 def _create_pickings(self, cr, uid, order, order_lines, picking_id=False,
130 context=None):
131 if not picking_id:
132 picking_id = self.pool.get('stock.picking').create(
133 cr, uid,
134 self._prepare_order_picking(cr, uid, order, context=context))
135
136 todo_moves = []
137 stock_move = self.pool.get('stock.move')
138 wf_service = netsvc.LocalService("workflow")
139
140 for order_line in order_lines:
141 if not order_line.product_id:
142 continue
143 if order_line.product_id.type in ('product', 'consu'):
144 move = stock_move.create(
145 cr, uid,
146 self._prepare_order_line_move(cr, uid, order, order_line,
147 picking_id, context=context))
148
149 if order_line.move_dest_id:
150 order_line.move_dest_id.write(
151 {'location_id': order.location_id.id})
152
153 todo_moves.append(move)
154
155 stock_move.action_confirm(cr, uid, todo_moves)
156 stock_move.force_assign(cr, uid, todo_moves)
157 wf_service.trg_validate(uid, 'stock.picking', picking_id,
158 'button_confirm', cr)
159
160 res = [picking_id]
161 pick_id = int(res[0])
162
163 invoice_obj = self.pool.get('account.invoice')
164 invoice_line_obj = self.pool.get('account.invoice.line')
165 journal_obj = self.pool.get('account.journal')
166 journal_ids = journal_obj.search(
167 cr, uid, [('type', '=', 'purchase'),
168 ('company_id', '=', order.company_id.id)], limit=1)
169
170 # Create the analytic account
171
172 stock_picking_id = self.pool.get('stock.picking.in').search(cr, uid, [
173 ('origin', 'like', order.name)])
174 stock_picking = \
175 self.pool.get('stock.picking.in').browse(cr, uid,
176 stock_picking_id)[0]
177
178 all_lines_tracked = True
179 total_pallets = 0.0
180
181 for po_line in order.order_line:
182 if not po_line.product_id.track_production:
183 all_lines_tracked = False
184 else:
185 lot_number, account_id = assign_lot_number(self.pool, cr, uid, [po_line], context=context)
186 matching_lines = [line for line in stock_picking.move_lines
187 if line.product_qty == po_line.product_qty
188 and line.product_id.id == po_line.product_id.id
189 and not line.prodlot_id]
190 if matching_lines:
191 matching_lines[0].write({'prodlot_id': lot_number})
192
193 po_line.write({'account_analytic_id': account_id})
194 po_line.refresh()
195 stock_picking.refresh()
196
197 total_pallets += po_line.nb_pallets
198
199 for order_cost in order.landed_cost_line_ids:
200 fiscal_position = False
201 if order.partner_id.property_account_position:
202 fiscal_position = order.partner_id.property_account_position.id
203
204 vals_inv = {
205 'partner_id': order_cost.partner_id.id,
206 'currency_id': order_cost.currency_id.id or order.company_id.currency_id.id,
207 'account_id': order_cost.partner_id.property_account_payable.id,
208 'type': 'in_invoice',
209 'origin': order.name,
210 'fiscal_position': fiscal_position,
211 'company_id': order.company_id.id,
212 'journal_id': len(journal_ids) and journal_ids[0] or False,
213 }
214
215 inv_id = invoice_obj.create(cr, uid, vals_inv, context=None)
216
217 if all_lines_tracked:
218 for po_line in order.order_line:
219 factor = 0.0
220
221 if order_cost.price_type == 'per_unit':
222 factor = po_line.product_qty / po_line.order_id.quantity_total
223
224 elif order_cost.price_type == 'value':
225 factor = po_line.price_subtotal / po_line.order_id.amount_total
226
227 elif order_cost.price_type == 'per_pallet':
228 factor = po_line.nb_pallets / total_pallets
229
230 else:
231 raise ValueError(
232 'Unknown price type (neither "per_unit", "value" nor "per_pallet")')
233
234 amount = order_cost.amount * factor
235 vals_line = {
236 'product_id': order_cost.product_id.id,
237 'name': order_cost.product_id.name,
238 'account_id': self._get_product_account_expense_id(
239 order_cost.product_id),
240 'partner_id': order_cost.partner_id.id,
241 'invoice_id': inv_id,
242 'origin': order.name,
243 'account_analytic_id': po_line.account_analytic_id.id,
244 'price_unit': amount,
245 'invoice_line_tax_id': [(6, 0, [x.id for x in
246 order_cost.product_id.supplier_taxes_id])],
247 }
248
249 invoice_line_obj.create(cr, uid, vals_line, context=None)
250 else:
251 vals_line = {
252 'product_id': order_cost.product_id.id,
253 'name': order_cost.product_id.name,
254 'account_id': self._get_product_account_expense_id(
255 order_cost.product_id),
256 'partner_id': order_cost.partner_id.id,
257 'invoice_id': inv_id,
258 'price_unit': order_cost.amount,
259 'invoice_line_tax_id': [(6, 0, [x.id for x in
260 order_cost.product_id.supplier_taxes_id])],
261 }
262
263 invoice_line_obj.create(cr, uid, vals_line, context=None)
264
265 return res
0266
=== added file 'purchase_lot_tracking/purchase_lot_tracking.py'
--- purchase_lot_tracking/purchase_lot_tracking.py 1970-01-01 00:00:00 +0000
+++ purchase_lot_tracking/purchase_lot_tracking.py 2014-08-27 19:22:25 +0000
@@ -0,0 +1,72 @@
1# -*- coding: utf-8 -*-
2##############################################################################
3#
4# OpenERP, Open Source Management Solution
5# Copyright (C) 2013 Savoir-faire Linux (<http://www.savoirfairelinux.com>).
6#
7# This program is free software: you can redistribute it and/or modify
8# it under the terms of the GNU Affero General Public License as
9# published by the Free Software Foundation, either version 3 of the
10# License, or (at your option) any later version.
11#
12# This program is distributed in the hope that it will be useful,
13# but WITHOUT ANY WARRANTY; without even the implied warranty of
14# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15# GNU Affero General Public License for more details.
16#
17# You should have received a copy of the GNU Affero General Public License
18# along with this program. If not, see <http://www.gnu.org/licenses/>.
19#
20##############################################################################
21
22from openerp.osv import orm, fields, osv
23from openerp import netsvc
24import openerp.addons.decimal_precision as dp
25
26from datetime import datetime
27
28
29
30
31#class stock_partial_picking(orm.Model):
32
33# _inherit = 'stock.picking.in'
34
35# def action_process(self, cr, uid, ids, context=None):
36
37# if context is None:
38# context = {}
39# """Open the partial picking wizard"""
40# context.update({
41# 'active_model': self._name,
42# 'active_ids': ids,
43# 'active_id': len(ids) and ids[0] or False
44# })
45#
46# for stock_picking in self.browse(cr, uid, ids):
47# import ipdb; ipdb.set_trace()
48# ref_po_id = self.pool.get('purchase.order').search(cr, uid, [('name', 'like', stock_picking.origin)])
49# ref_po = self.pool.get('purchase.order').browse(cr, uid, ref_po_id)[0]
50#
51# for stock_picking_line in stock_picking.move_lines:
52#
53# matching_line = [po_line for po_line in ref_po.order_line if\
54# po_line.product_qty == stock_picking_line.product_qty and \
55# po_line.product_id.id == stock_picking_line.product_id.id][0]
56#
57## matching_lot = self.pool.get('stock.production.lot').search(cr, uid, [('name', 'like', matching_line.lot)])[0]
58#
59# stock_picking_line.write({'prodlot_id': matching_lot})
60# stock_picking_line.refresh()
61
62
63
64# return {
65# 'view_type': 'form',
66# 'view_mode': 'form',
67# 'res_model': 'stock.partial.picking',
68# 'type': 'ir.actions.act_window',
69# 'target': 'new',
70# 'context': context,
71# 'nodestroy': True,
72# }
073
=== added file 'purchase_lot_tracking/purchase_lot_tracking_view.xml'
--- purchase_lot_tracking/purchase_lot_tracking_view.xml 1970-01-01 00:00:00 +0000
+++ purchase_lot_tracking/purchase_lot_tracking_view.xml 2014-08-27 19:22:25 +0000
@@ -0,0 +1,69 @@
1<?xml version="1.0" encoding="utf-8"?>
2<openerp>
3 <data>
4 <record id="purchase_lot_tracking_product" model="ir.ui.view">
5 <field name="name">purchase_lot_tracking.product.view</field>
6 <field name="model">product.product</field>
7 <field name="inherit_id" ref="product.product_normal_form_view"/>
8 <field name="arch" type="xml">
9 <field name="taxes_id" position="after">
10 <field name="account_id"/>
11 </field>
12 </field>
13 </record>
14
15 <record id="purchase_lot_tracking_product_category" model="ir.ui.view">
16 <field name="name">purchase_lot_tracking.product_category.view</field>
17 <field name="model">product.category</field>
18 <field name="inherit_id" ref="product.product_category_form_view"/>
19 <field name="arch" type="xml">
20 <field name="type" position="after">
21 <group name="analytic_account" string="Analytic Account" colspan="2">
22 <field name="account_id"/>
23 </group>
24 </field>
25 </field>
26 </record>
27
28 <record id="purchase_order_line_readonly_aa" model="ir.ui.view">
29 <field name="name">purchase.order.readonly.aa</field>
30 <field name="model">purchase.order</field>
31 <field name="inherit_id" ref="purchase.purchase_order_form" />
32 <field name="arch" type="xml">
33 <field name="account_analytic_id" position="replace">
34 <field
35 name="account_analytic_id"
36 colspan="2"
37 groups="purchase.group_analytic_accounting"
38 attrs="{'readonly': True}" />
39 </field>
40 </field>
41 </record>
42
43 <record id="purchase_lot_tracking_sale_order" model="ir.ui.view">
44 <field name="name">purchase_lot_tracking.sale.order.view</field>
45 <field name="model">sale.order</field>
46 <field name="inherit_id" ref="sale.view_order_form"/>
47 <field name="arch" type="xml">
48 <xpath expr="/form/sheet/notebook/page/field[@name='order_line']/tree/field[@name='price_unit']" position="before">
49 <field name="minimum" />
50 <field name="average" />
51 <field name="maximum" />
52 </xpath>
53 </field>
54 </record>
55
56 <!-- Sequence -->
57 <record id="seq_type_lot" model="ir.sequence.type">
58 <field name="name">ls.lot</field>
59 <field name="code">ls.lot</field>
60 </record>
61
62 <record id="seq_lot" model="ir.sequence">
63 <field name="name">ls.lot</field>
64 <field name="code">ls.lot</field>
65 <field name="prefix">LOT</field>
66 <field name="padding">6</field>
67 </record>
68 </data>
69</openerp>
070
=== added file 'purchase_lot_tracking/purchase_workflow.xml'
--- purchase_lot_tracking/purchase_workflow.xml 1970-01-01 00:00:00 +0000
+++ purchase_lot_tracking/purchase_workflow.xml 2014-08-27 19:22:25 +0000
@@ -0,0 +1,12 @@
1<?xml version="1.0" encoding="utf-8"?>
2<openerp>
3 <data>
4 <record id="act_confirmed" model="workflow.activity">
5 <field name="wkf_id" ref="purchase.purchase_order"/>
6 <field name="name">confirmed</field>
7 <field name="split_mode">OR</field>
8 <field name="kind">function</field>
9 <field name="action">wkf_confirm_order()</field>
10 </record>
11 </data>
12</openerp>
013
=== added file 'purchase_lot_tracking/sale.py'
--- purchase_lot_tracking/sale.py 1970-01-01 00:00:00 +0000
+++ purchase_lot_tracking/sale.py 2014-08-27 19:22:25 +0000
@@ -0,0 +1,95 @@
1# -*- coding: utf-8 -*-
2##############################################################################
3#
4# OpenERP, Open Source Management Solution
5# Copyright (C) 2013 Savoir-faire Linux (<http://www.savoirfairelinux.com>).
6#
7# This program is free software: you can redistribute it and/or modify
8# it under the terms of the GNU Affero General Public License as
9# published by the Free Software Foundation, either version 3 of the
10# License, or (at your option) any later version.
11#
12# This program is distributed in the hope that it will be useful,
13# but WITHOUT ANY WARRANTY; without even the implied warranty of
14# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15# GNU Affero General Public License for more details.
16#
17# You should have received a copy of the GNU Affero General Public License
18# along with this program. If not, see <http://www.gnu.org/licenses/>.
19#
20##############################################################################
21
22from openerp.osv import orm, fields
23import logging
24
25class sale(orm.Model):
26
27 _inherit = 'sale.order.line'
28 _logger = logging.Logger(__name__)
29
30 def _minimum(self, cr, uid, ids, name, arg, context=None):
31 res = {}
32
33 for order_line in self.browse(cr, uid, ids, context):
34 account = order_line.product_id.account_id
35 minimum = 0.0
36
37 if account:
38 values = [lot.estimated_tcu for lot in account.child_ids
39 if lot.total_in_qty != 0]
40
41 if values:
42 minimum = min(values)
43
44 res[order_line.id] = minimum
45
46 return res
47
48 def _average(self, cr, uid, ids, name, arg, context=None):
49 res = {}
50
51 for order_line in self.browse(cr, uid, ids, context):
52 account = order_line.product_id.account_id
53 average = 0.0
54
55 total_count = 0
56
57 if account:
58 for lot in account.child_ids:
59 quantity = lot.total_in_qty
60 tcu = lot.estimated_tcu
61
62 if quantity != 0:
63 average += quantity * tcu
64 total_count += quantity
65
66 if total_count == 0:
67 res[order_line.id] = 0
68 else:
69 res[order_line.id] = average / total_count
70
71 return res
72
73 def _maximum(self, cr, uid, ids, name, arg, context=None):
74 res = {}
75
76 for order_line in self.browse(cr, uid, ids, context):
77 account = order_line.product_id.account_id
78 maximum = 0.0
79
80 if account:
81 values = [lot.estimated_tcu for lot in account.child_ids
82 if lot.total_in_qty != 0]
83
84 if values:
85 maximum = max(values)
86
87 res[order_line.id] = maximum
88
89 return res
90
91 _columns = {
92 'minimum': fields.function(_minimum, string='Min.', type='float'),
93 'average': fields.function(_average, string='Avg.', type='float'),
94 'maximum': fields.function(_maximum, string='Max.', type='float')
95 }
096
=== added file 'purchase_lot_tracking/stock.py'
--- purchase_lot_tracking/stock.py 1970-01-01 00:00:00 +0000
+++ purchase_lot_tracking/stock.py 2014-08-27 19:22:25 +0000
@@ -0,0 +1,141 @@
1# -*- coding: utf-8 -*-
2##############################################################################
3#
4# OpenERP, Open Source Management Solution
5# Copyright (C) 2013 Savoir-faire Linux (<http://www.savoirfairelinux.com>).
6#
7# This program is free software: you can redistribute it and/or modify
8# it under the terms of the GNU Affero General Public License as
9# published by the Free Software Foundation, either version 3 of the
10# License, or (at your option) any later version.
11#
12# This program is distributed in the hope that it will be useful,
13# but WITHOUT ANY WARRANTY; without even the implied warranty of
14# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15# GNU Affero General Public License for more details.
16#
17# You should have received a copy of the GNU Affero General Public License
18# along with this program. If not, see <http://www.gnu.org/licenses/>.
19#
20##############################################################################
21
22from openerp.osv import orm, fields
23from openerp.tools.translate import _
24
25class stock_production_lot(orm.Model):
26
27 _inherit = 'stock.production.lot'
28
29 _columns = {
30 'account_analytic_id': fields.many2one('account.analytic.account', 'Analytic Account', required=False)
31 }
32
33
34class stock_invoice_onshipping(orm.TransientModel):
35
36 _inherit = 'stock.invoice.onshipping'
37
38 def retrieve_move_lines(self, cr, uid, ids, context=None):
39 """Retrieves all different move lines from the stock picking
40 """
41 move_lines = []
42 for pick in self.pool.get('stock.picking').browse(cr, uid,
43 context['active_ids'],
44 context=context):
45 move_lines += pick.move_lines
46
47 return move_lines
48
49 def _retrieve_invoice_lines(self, cr, uid, ids, context=None):
50 """Retrieves invoice lines of a newly created invoice
51
52 expects invoice_id to be passed in context
53 """
54 invoice = self.pool.get('account.invoice')\
55 .browse(cr,uid, context['invoice_id'])
56 return invoice.invoice_line
57
58 def _find_matching_move_line(self, invoice_line, move_lines):
59 """Finds the matching invoice line in the move lines list
60
61 It is considered matching if they have the same product quantity
62 and the same product id.
63 """
64 matching_move_lines = [line for line in move_lines if
65 line.product_qty == invoice_line.quantity and
66 line.product_id.id == invoice_line.product_id.id]
67
68 if matching_move_lines:
69 return matching_move_lines[0]
70 return None
71
72 def create_invoice(self, cr, uid, ids, context=None):
73 """
74 Creates an invoice when the delivery lots are confirmed
75
76 Iterates through all the lines of the invoice to specify
77 the proper analytic_account
78 """
79 prod_lot_pool = self.pool.get('stock.production.lot')
80 # creates the invoice properly
81 res = super(stock_invoice_onshipping, self)\
82 .create_invoice(cr, uid, ids, context=context)
83
84 context['invoice_id'] = res.values()[0]
85
86 # retrieve move lines of stock pickings
87 move_lines = self.retrieve_move_lines(cr, uid, ids, context=context)
88
89 # retrieve invoice lines of newly create invoice
90 invoice_lines = self._retrieve_invoice_lines(cr, uid, ids,
91 context=context)
92
93 # first iteration, check if matching
94 lst_match = []
95 for invoice_line in invoice_lines:
96 # don't add service to analytic account
97 if invoice_line.product_id.type == u'service':
98 continue
99 matching_move_line = self._find_matching_move_line(invoice_line,
100 move_lines)
101 name = invoice_line.name
102 if not matching_move_line:
103 msg = _("The item %s is not in stock picking." % name)
104 raise orm.except_orm(_("Missed line!"), msg)
105
106 # search account analytic
107 prod_lot_id = matching_move_line.prodlot_id
108 if not prod_lot_id:
109 msg = _("The item '%s' missed 'prodlot_id' on associated move \
110 item, origin %s." % (name, matching_move_line.origin))
111 raise orm.except_orm(_("Missed Serial Number!"), msg)
112
113 matching_prod_lot = prod_lot_pool.browse(cr, uid, prod_lot_id.id)
114 matching_account = matching_prod_lot.account_analytic_id.id
115
116 lst_match.append((invoice_line, matching_account))
117
118 # transaction
119 for invoice_line, matching_account in lst_match:
120 invoice_line.write({'account_analytic_id': matching_account})
121
122 return res
123
124
125class stock_picking_out(orm.Model):
126
127 _inherit = 'stock.picking.out'
128
129 def action_process(self, cr, uid, ids, context={}):
130 '''Check if tracked products have their lot number specified'''
131
132 picking = self.browse(cr, uid, ids, context=context)[0]
133
134 for line in picking.move_lines:
135 if line.product_id.track_production and not line.prodlot_id.id:
136 message = ' '.join([
137 _('Please specify a lot number for all products of type:'),
138 line.product_id.name_template])
139 raise orm.except_orm(_('Missing lot number'), message)
140
141 return super(stock_picking_out, self).action_process(cr, uid, ids, context)
0142
=== added directory 'purchase_lot_tracking/wizard'
=== added file 'purchase_lot_tracking/wizard/__init__.py'
--- purchase_lot_tracking/wizard/__init__.py 1970-01-01 00:00:00 +0000
+++ purchase_lot_tracking/wizard/__init__.py 2014-08-27 19:22:25 +0000
@@ -0,0 +1,1 @@
1import stock_partial_picking
02
=== added file 'purchase_lot_tracking/wizard/stock_partial_picking.py'
--- purchase_lot_tracking/wizard/stock_partial_picking.py 1970-01-01 00:00:00 +0000
+++ purchase_lot_tracking/wizard/stock_partial_picking.py 2014-08-27 19:22:25 +0000
@@ -0,0 +1,53 @@
1# -*- coding: utf-8 -*-
2##############################################################################
3#
4# OpenERP, Open Source Management Solution
5# Copyright (C) 2004-TODAY OpenERP SA (<http://openerp.com>).
6#
7# This program is free software: you can redistribute it and/or modify
8# it under the terms of the GNU Affero General Public License as
9# published by the Free Software Foundation, either version 3 of the
10# License, or (at your option) any later version.
11#
12# This program is distributed in the hope that it will be useful,
13# but WITHOUT ANY WARRANTY; without even the implied warranty of
14# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15# GNU Affero General Public License for more details.
16#
17# You should have received a copy of the GNU Affero General Public License
18# along with this program. If not, see <http://www.gnu.org/licenses/>.
19#
20##############################################################################
21
22import time
23from lxml import etree
24from openerp.osv import fields, osv
25from openerp.tools.misc import DEFAULT_SERVER_DATETIME_FORMAT
26from openerp.tools.float_utils import float_compare
27import openerp.addons.decimal_precision as dp
28from openerp.tools.translate import _
29
30class stock_partial_picking_line(osv.TransientModel):
31
32 def _tracking(self, cursor, user, ids, name, arg, context=None):
33 res = {}
34 for tracklot in self.browse(cursor, user, ids, context=context):
35 tracking = False
36 if (tracklot.move_id.picking_id.type == 'in' and tracklot.product_id.track_incoming == True) or \
37 (tracklot.move_id.picking_id.type == 'out' and tracklot.product_id.track_outgoing == True):
38 tracking = True
39 res[tracklot.id] = tracking
40 return res
41
42 _inherit = "stock.partial.picking.line"
43
44 def onchange_product_id(self, cr, uid, ids, product_id, context=None):
45
46 raise Exception()
47
48 uom_id = False
49 if product_id:
50 product = self.pool.get('product.product').browse(cr, uid, product_id, context=context)
51 uom_id = product.uom_id.id
52 return {'value': {'product_uom': uom_id}}
53
054
=== added directory 'purchase_order_pick_up_date'
=== added file 'purchase_order_pick_up_date/__init__.py'
--- purchase_order_pick_up_date/__init__.py 1970-01-01 00:00:00 +0000
+++ purchase_order_pick_up_date/__init__.py 2014-08-27 19:22:25 +0000
@@ -0,0 +1,22 @@
1# -*- coding: utf-8 -*-
2##############################################################################
3#
4# OpenERP, Open Source Management Solution
5# Copyright (C) 2013 Savoir-faire Linux (<http://www.savoirfairelinux.com>).
6#
7# This program is free software: you can redistribute it and/or modify
8# it under the terms of the GNU Affero General Public License as
9# published by the Free Software Foundation, either version 3 of the
10# License, or (at your option) any later version.
11#
12# This program is distributed in the hope that it will be useful,
13# but WITHOUT ANY WARRANTY; without even the implied warranty of
14# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15# GNU Affero General Public License for more details.
16#
17# You should have received a copy of the GNU Affero General Public License
18# along with this program. If not, see <http://www.gnu.org/licenses/>.
19#
20##############################################################################
21
22import purchase
023
=== added file 'purchase_order_pick_up_date/__openerp__.py'
--- purchase_order_pick_up_date/__openerp__.py 1970-01-01 00:00:00 +0000
+++ purchase_order_pick_up_date/__openerp__.py 2014-08-27 19:22:25 +0000
@@ -0,0 +1,44 @@
1# -*- coding: utf-8 -*-
2##############################################################################
3#
4# OpenERP, Open Source Management Solution
5# Copyright (C) 2013 Savoir-faire Linux (<http://www.savoirfairelinux.com>).
6#
7# This program is free software: you can redistribute it and/or modify
8# it under the terms of the GNU Affero General Public License as
9# published by the Free Software Foundation, either version 3 of the
10# License, or (at your option) any later version.
11#
12# This program is distributed in the hope that it will be useful,
13# but WITHOUT ANY WARRANTY; without even the implied warranty of
14# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15# GNU Affero General Public License for more details.
16#
17# You should have received a copy of the GNU Affero General Public License
18# along with this program. If not, see <http://www.gnu.org/licenses/>.
19#
20##############################################################################
21
22{
23 'name': 'Purchase Order Pick Up Date',
24 'version': '0.1',
25 'author': 'Savoir-faire Linux',
26 'maintainer': 'Savoir-faire Linux',
27 'website': 'http://www.savoirfairelinux.com',
28 'category': 'purchase',
29 'description': """
30Add a field for a purchase pick up date
31=======================================
32
33This module lets you specify a scheduled pick up date for a purchase order.
34""",
35 'depends': ['base', 'purchase'],
36 'data': [
37 'purchase_order_pick_up_date_report.xml',
38 'purchase_order_pick_up_date_view.xml',
39 ],
40 'demo': [],
41 'test': [],
42 'installable': True,
43 'active': False,
44}
045
=== added directory 'purchase_order_pick_up_date/i18n'
=== added file 'purchase_order_pick_up_date/i18n/fr.po'
--- purchase_order_pick_up_date/i18n/fr.po 1970-01-01 00:00:00 +0000
+++ purchase_order_pick_up_date/i18n/fr.po 2014-08-27 19:22:25 +0000
@@ -0,0 +1,31 @@
1# Translation of OpenERP Server.
2# This file contains the translation of the following modules:
3# * purchase_order_pick_up_date
4#
5msgid ""
6msgstr ""
7"Project-Id-Version: OpenERP Server 7.0-20130811-231021\n"
8"Report-Msgid-Bugs-To: \n"
9"POT-Creation-Date: 2013-09-18 14:24+0000\n"
10"PO-Revision-Date: 2013-09-18 14:24+0000\n"
11"Last-Translator: Alexandre Boily <alexandre.boily@savoirfairelinux.com>\n"
12"Language-Team: Savoir-faire Linux\n"
13"MIME-Version: 1.0\n"
14"Content-Type: text/plain; charset=UTF-8\n"
15"Content-Transfer-Encoding: \n"
16"Plural-Forms: \n"
17
18#. module: purchase_order_pick_up_date
19#: help:purchase.order,date_pick_up:0
20msgid "Scheduled date where the purchase will arrive at one of your warehouses"
21msgstr "Date prévue à laquelle l'achat arrivera à l'un de vos entrepôts"
22
23#. module: purchase_order_pick_up_date
24#: field:purchase.order,date_pick_up:0
25msgid "Pick Up Date"
26msgstr "Date de pick up"
27
28#. module: purchase_order_pick_up_date
29#: model:ir.model,name:purchase_order_pick_up_date.model_purchase_order
30msgid "Purchase Order"
31msgstr "Bon de commande"
032
=== added file 'purchase_order_pick_up_date/i18n/purchase_order_pick_up_date.pot'
--- purchase_order_pick_up_date/i18n/purchase_order_pick_up_date.pot 1970-01-01 00:00:00 +0000
+++ purchase_order_pick_up_date/i18n/purchase_order_pick_up_date.pot 2014-08-27 19:22:25 +0000
@@ -0,0 +1,32 @@
1# Translation of OpenERP Server.
2# This file contains the translation of the following modules:
3# * purchase_order_pick_up_date
4#
5msgid ""
6msgstr ""
7"Project-Id-Version: OpenERP Server 7.0-20130811-231021\n"
8"Report-Msgid-Bugs-To: \n"
9"POT-Creation-Date: 2013-09-18 14:24+0000\n"
10"PO-Revision-Date: 2013-09-18 14:24+0000\n"
11"Last-Translator: <>\n"
12"Language-Team: \n"
13"MIME-Version: 1.0\n"
14"Content-Type: text/plain; charset=UTF-8\n"
15"Content-Transfer-Encoding: \n"
16"Plural-Forms: \n"
17
18#. module: purchase_order_pick_up_date
19#: help:purchase.order,date_pick_up:0
20msgid "Scheduled date where the purchase will arrive at one of your warehouses"
21msgstr ""
22
23#. module: purchase_order_pick_up_date
24#: field:purchase.order,date_pick_up:0
25msgid "Pick Up Date"
26msgstr ""
27
28#. module: purchase_order_pick_up_date
29#: model:ir.model,name:purchase_order_pick_up_date.model_purchase_order
30msgid "Purchase Order"
31msgstr ""
32
033
=== added file 'purchase_order_pick_up_date/purchase.py'
--- purchase_order_pick_up_date/purchase.py 1970-01-01 00:00:00 +0000
+++ purchase_order_pick_up_date/purchase.py 2014-08-27 19:22:25 +0000
@@ -0,0 +1,33 @@
1# -*- coding: utf-8 -*-
2##############################################################################
3#
4# OpenERP, Open Source Management Solution
5# Copyright (C) 2013 Savoir-faire Linux (<http://www.savoirfairelinux.com>).
6#
7# This program is free software: you can redistribute it and/or modify
8# it under the terms of the GNU Affero General Public License as
9# published by the Free Software Foundation, either version 3 of the
10# License, or (at your option) any later version.
11#
12# This program is distributed in the hope that it will be useful,
13# but WITHOUT ANY WARRANTY; without even the implied warranty of
14# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15# GNU Affero General Public License for more details.
16#
17# You should have received a copy of the GNU Affero General Public License
18# along with this program. If not, see <http://www.gnu.org/licenses/>.
19#
20##############################################################################
21
22from openerp.osv import orm, fields
23
24class purchase_order(orm.Model):
25
26 _inherit = 'purchase.order'
27
28 _columns = {
29 'date_pick_up':
30 fields.date(
31 'Pick Up Date',
32 help='''Scheduled date where the purchase will arrive at one of your warehouses'''),
33 }
034
=== added file 'purchase_order_pick_up_date/purchase_order_pick_up_date_report.xml'
--- purchase_order_pick_up_date/purchase_order_pick_up_date_report.xml 1970-01-01 00:00:00 +0000
+++ purchase_order_pick_up_date/purchase_order_pick_up_date_report.xml 2014-08-27 19:22:25 +0000
@@ -0,0 +1,21 @@
1<?xml version="1.0" encoding="utf-8" ?>
2<openerp>
3 <data>
4 <report
5 auto="False"
6 id="purchase.report_purchase_quotation"
7 model="purchase.order"
8 name="purchase.quotation"
9 rml="purchase_order_pick_up_date/report/request_quotation.rml"
10 usage="default"
11 string="Request for Quotation" />
12
13 <report
14 auto="False"
15 id="purchase.report_purchase_order"
16 model="purchase.order"
17 name="purchase.order"
18 rml="purchase_order_pick_up_date/report/order.rml"
19 string="Purchase Order" />
20 </data>
21</openerp>
022
=== added file 'purchase_order_pick_up_date/purchase_order_pick_up_date_view.xml'
--- purchase_order_pick_up_date/purchase_order_pick_up_date_view.xml 1970-01-01 00:00:00 +0000
+++ purchase_order_pick_up_date/purchase_order_pick_up_date_view.xml 2014-08-27 19:22:25 +0000
@@ -0,0 +1,26 @@
1<?xml version="1.0" encoding="utf-8" ?>
2<openerp>
3 <data>
4 <record id="purchase_order_pick_up_date_tree" model="ir.ui.view">
5 <field name="name">purchase.order.pick.tree</field>
6 <field name="model">purchase.order</field>
7 <field name="inherit_id" ref="purchase.purchase_order_tree" />
8 <field name="arch" type="xml">
9 <field name="minimum_planned_date" position="after">
10 <field name="date_pick_up" />
11 </field>
12 </field>
13 </record>
14
15 <record id="purchase_order_pick_up_date_form" model="ir.ui.view">
16 <field name="name">purchase.order.pick.form</field>
17 <field name="model">purchase.order</field>
18 <field name="inherit_id" ref="purchase.purchase_order_form" />
19 <field name="arch" type="xml">
20 <field name="date_order" position="after">
21 <field name="date_pick_up" />
22 </field>
23 </field>
24 </record>
25 </data>
26</openerp>
027
=== added directory 'purchase_order_pick_up_date/report'
=== added file 'purchase_order_pick_up_date/report/order.rml'
--- purchase_order_pick_up_date/report/order.rml 1970-01-01 00:00:00 +0000
+++ purchase_order_pick_up_date/report/order.rml 2014-08-27 19:22:25 +0000
@@ -0,0 +1,335 @@
1<?xml version="1.0" encoding="utf-8" ?>
2<document filename="Purchase Order.pdf">
3 <template title="Purchase Order" author="Savoir-faire Linux (support@savoirfairelinux.com)" allowSplitting="20">
4 <pageTemplate id="first">
5 <frame id="first" x1="18.0" y1="42.0" width="535" height="758"/>
6 </pageTemplate>
7 </template>
8 <stylesheet>
9 <blockTableStyle id="Standard_Outline">
10 <blockAlignment value="LEFT"/>
11 <blockValign value="TOP"/>
12 </blockTableStyle>
13 <blockTableStyle id="Tableau1">
14 <blockAlignment value="LEFT"/>
15 <blockValign value="TOP"/>
16 </blockTableStyle>
17 <blockTableStyle id="Tableau2">
18 <blockAlignment value="LEFT"/>
19 <blockValign value="TOP"/>
20 </blockTableStyle>
21 <blockTableStyle id="Header_Order_Reference_Tbl">
22 <blockAlignment value="LEFT"/>
23 <blockValign value="TOP"/>
24 <lineStyle kind="LINEBEFORE" colorName="#e6e6e6" start="0,0" stop="0,-1"/>
25 <lineStyle kind="LINEABOVE" colorName="#e6e6e6" start="0,0" stop="0,0"/>
26 <lineStyle kind="LINEBELOW" colorName="#e6e6e6" start="0,-1" stop="0,-1"/>
27 <lineStyle kind="LINEBEFORE" colorName="#e6e6e6" start="1,0" stop="1,-1"/>
28 <lineStyle kind="LINEABOVE" colorName="#e6e6e6" start="1,0" stop="1,0"/>
29 <lineStyle kind="LINEBELOW" colorName="#e6e6e6" start="1,-1" stop="1,-1"/>
30 <lineStyle kind="LINEBEFORE" colorName="#e6e6e6" start="2,0" stop="2,-1"/>
31 <lineStyle kind="LINEABOVE" colorName="#e6e6e6" start="2,0" stop="2,0"/>
32 <lineStyle kind="LINEBELOW" colorName="#e6e6e6" start="2,-1" stop="2,-1"/>
33 <lineStyle kind="LINEBEFORE" colorName="#e6e6e6" start="3,0" stop="3,-1"/>
34 <lineStyle kind="LINEABOVE" colorName="#e6e6e6" start="3,0" stop="3,0"/>
35 <lineStyle kind="LINEBELOW" colorName="#e6e6e6" start="3,-1" stop="3,-1"/>
36 <lineStyle kind="LINEBEFORE" colorName="#e6e6e6" start="4,0" stop="4,-1"/>
37 <lineStyle kind="LINEAFTER" colorName="#e6e6e6" start="4,0" stop="4,-1"/>
38 <lineStyle kind="LINEABOVE" colorName="#e6e6e6" start="4,0" stop="4,0"/>
39 <lineStyle kind="LINEBELOW" colorName="#e6e6e6" start="4,-1" stop="4,-1"/>
40 </blockTableStyle>
41 <blockTableStyle id="Content_Order_Reference_Table">
42 <blockAlignment value="LEFT"/>
43 <blockValign value="TOP"/>
44 <lineStyle kind="LINEBEFORE" colorName="#e6e6e6" start="0,0" stop="0,-1"/>
45 <lineStyle kind="LINEABOVE" colorName="#e6e6e6" start="0,0" stop="0,0"/>
46 <lineStyle kind="LINEBELOW" colorName="#e6e6e6" start="0,-1" stop="0,-1"/>
47 <lineStyle kind="LINEBEFORE" colorName="#e6e6e6" start="1,0" stop="1,-1"/>
48 <lineStyle kind="LINEABOVE" colorName="#e6e6e6" start="1,0" stop="1,0"/>
49 <lineStyle kind="LINEBELOW" colorName="#e6e6e6" start="1,-1" stop="1,-1"/>
50 <lineStyle kind="LINEBEFORE" colorName="#e6e6e6" start="2,0" stop="2,-1"/>
51 <lineStyle kind="LINEABOVE" colorName="#e6e6e6" start="2,0" stop="2,0"/>
52 <lineStyle kind="LINEBELOW" colorName="#e6e6e6" start="2,-1" stop="2,-1"/>
53 <lineStyle kind="LINEBEFORE" colorName="#e6e6e6" start="3,0" stop="3,-1"/>
54 <lineStyle kind="LINEABOVE" colorName="#e6e6e6" start="3,0" stop="3,0"/>
55 <lineStyle kind="LINEBELOW" colorName="#e6e6e6" start="3,-1" stop="3,-1"/>
56 <lineStyle kind="LINEBEFORE" colorName="#e6e6e6" start="4,0" stop="4,-1"/>
57 <lineStyle kind="LINEAFTER" colorName="#e6e6e6" start="4,0" stop="4,-1"/>
58 <lineStyle kind="LINEABOVE" colorName="#e6e6e6" start="4,0" stop="4,0"/>
59 <lineStyle kind="LINEBELOW" colorName="#e6e6e6" start="4,-1" stop="4,-1"/>
60 </blockTableStyle>
61 <blockTableStyle id="Table_Header_Pur_ord_Line">
62 <blockAlignment value="LEFT"/>
63 <blockValign value="TOP"/>
64 <lineStyle kind="LINEBELOW" colorName="#000000" start="0,-1" stop="0,-1"/>
65 <lineStyle kind="LINEBELOW" colorName="#000000" start="1,-1" stop="1,-1"/>
66 <lineStyle kind="LINEBELOW" colorName="#000000" start="2,-1" stop="2,-1"/>
67 <lineStyle kind="LINEBELOW" colorName="#000000" start="3,-1" stop="3,-1"/>
68 <lineStyle kind="LINEBELOW" colorName="#000000" start="4,-1" stop="4,-1"/>
69 <lineStyle kind="LINEBELOW" colorName="#000000" start="5,-1" stop="5,-1"/>
70 </blockTableStyle>
71 <blockTableStyle id="Table_Order_Pur_line_Content">
72 <blockAlignment value="LEFT"/>
73 <blockValign value="TOP"/>
74 <lineStyle kind="LINEBELOW" colorName="#e6e6e6" start="0,-1" stop="0,-1"/>
75 <lineStyle kind="LINEBELOW" colorName="#e6e6e6" start="1,-1" stop="1,-1"/>
76 <lineStyle kind="LINEBELOW" colorName="#e6e6e6" start="2,-1" stop="2,-1"/>
77 <lineStyle kind="LINEBELOW" colorName="#e6e6e6" start="3,-1" stop="3,-1"/>
78 <lineStyle kind="LINEBELOW" colorName="#e6e6e6" start="4,-1" stop="4,-1"/>
79 <lineStyle kind="LINEBELOW" colorName="#e6e6e6" start="5,-1" stop="5,-1"/>
80 <lineStyle kind="LINEBELOW" colorName="#e6e6e6" start="0,-1" stop="0,-1"/>
81 <lineStyle kind="LINEBELOW" colorName="#e6e6e6" start="1,-1" stop="1,-1"/>
82 <lineStyle kind="LINEBELOW" colorName="#e6e6e6" start="2,-1" stop="2,-1"/>
83 <lineStyle kind="LINEBELOW" colorName="#e6e6e6" start="3,-1" stop="3,-1"/>
84 <lineStyle kind="LINEBELOW" colorName="#e6e6e6" start="4,-1" stop="4,-1"/>
85 <lineStyle kind="LINEBELOW" colorName="#e6e6e6" start="5,-1" stop="5,-1"/>
86 </blockTableStyle>
87 <blockTableStyle id="Table_All_Total_Detail">
88 <blockAlignment value="LEFT"/>
89 <blockValign value="TOP"/>
90 <lineStyle kind="LINEABOVE" colorName="#ffffff" start="0,0" stop="0,0"/>
91 <lineStyle kind="LINEABOVE" colorName="#000000" start="1,0" stop="1,0"/>
92 <lineStyle kind="LINEABOVE" colorName="#000000" start="2,0" stop="2,0"/>
93 <lineStyle kind="LINEABOVE" colorName="#000000" start="1,2" stop="1,2"/>
94 <lineStyle kind="LINEABOVE" colorName="#000000" start="2,2" stop="2,2"/>
95 </blockTableStyle>
96 <blockTableStyle id="Table_Outer_Notes">
97 <blockAlignment value="LEFT"/>
98 <blockValign value="TOP"/>
99 </blockTableStyle>
100 <initialize>
101 <paraStyle name="all" alignment="justify"/>
102 </initialize>
103 <paraStyle name="terp_header" fontSize="12.0" leading="15" alignment="LEFT" spaceBefore="12.0" spaceAfter="6.0"/>
104 <paraStyle name="terp_tblheader_General" fontSize="8.0" leading="10" alignment="LEFT" spaceBefore="6.0" spaceAfter="6.0"/>
105 <paraStyle name="terp_default_8" fontSize="8.0" leading="10" alignment="LEFT" spaceBefore="0.0" spaceAfter="0.0"/>
106 <paraStyle name="terp_tblheader_General_Centre" fontSize="8.0" leading="10" alignment="CENTER" spaceBefore="6.0" spaceAfter="6.0"/>
107 <paraStyle name="terp_tblheader_General_Right" fontSize="8.0" leading="10" alignment="RIGHT" spaceBefore="6.0" spaceAfter="6.0"/>
108 <paraStyle name="terp_default_Centre_8" fontSize="8.0" leading="10" alignment="CENTER" spaceBefore="0.0" spaceAfter="0.0"/>
109 <paraStyle name="terp_default_9" fontSize="9.0" leading="11" alignment="LEFT" spaceBefore="0.0" spaceAfter="0.0"/>
110 <paraStyle name="terp_default_Bold_9" fontSize="9.0" leading="11" alignment="LEFT" spaceBefore="0.0" spaceAfter="0.0"/>
111 <paraStyle name="terp_default_Right_9" fontSize="9.0" leading="11" alignment="RIGHT" spaceBefore="0.0" spaceAfter="0.0"/>
112 <paraStyle name="terp_default_Bold_9_Right" fontSize="9.0" leading="11" alignment="RIGHT" spaceBefore="0.0" spaceAfter="0.0"/>
113 <images/>
114 </stylesheet>
115 <story>
116 <pto>
117 <para style="terp_default_8">[[repeatIn(objects,'o')]]</para>
118 <para style="terp_default_8">[[ setLang(o.partner_id.lang) ]]</para>
119 <pto_header>
120 <blockTable colWidths="180.0,70.0,60.0,80.0,60.0,85.0" repeatRows="1" style="Table_Header_Pur_ord_Line">
121 <tr>
122 <td>
123 <para style="terp_tblheader_General"><b>Description</b></para>
124 </td>
125 <td>
126 <para style="terp_tblheader_General"><b>Taxes</b></para>
127 </td>
128 <td>
129 <para style="terp_tblheader_General"><b>Date Req.</b></para>
130 </td>
131 <td>
132 <para style="terp_tblheader_General_Right"><b>Qty</b></para>
133 </td>
134 <td>
135 <para style="terp_tblheader_General_Right"><b>Unit Price</b></para>
136 </td>
137 <td>
138 <para style="terp_tblheader_General_Right"><b>Net Price</b></para>
139 </td>
140 </tr>
141 </blockTable>
142 </pto_header>
143 <para style="terp_default_9">
144 <font color="white"> </font>
145 </para>
146 <blockTable colWidths="253.0,59.0,223.0" style="Tableau1">
147 <tr>
148 <td>
149 <blockTable colWidths="253.0" style="Tableau2">
150 <tr>
151 <td>
152 <para style="terp_default_Bold_9"><b>Shipping address :</b></para>
153 <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>
154 <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>
155 </td>
156 </tr>
157 </blockTable>
158 <para style="terp_default_9">
159 <font color="white"> </font>
160 </para>
161 </td>
162 <td>
163 <para style="terp_default_9">
164 <font color="white"> </font>
165 </para>
166 </td>
167 <td>
168 <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>
169 <para style="terp_default_9">[[ o.partner_id and display_address(o.partner_id) ]] </para>
170 <para style="terp_default_9">
171 <font color="white"> </font>
172 </para>
173 <para style="terp_default_9">Tel : [[ (o.partner_id.phone) or removeParentNode('para') ]]</para>
174 <para style="terp_default_9">Fax : [[ (o.partner_id.fax) or removeParentNode('para') ]]</para>
175 <para style="terp_default_9">TIN : [[ (o.partner_id.vat) or removeParentNode('para') ]]</para>
176 </td>
177 </tr>
178 </blockTable>
179 <para style="terp_default_9">
180 <font color="white"> </font>
181 </para>
182 <para style="terp_header"><b>[[ o.state=='draft' and removeParentNode('para') ]] Purchase Order Confirmation N° [[ o.name ]]</b></para>
183 <para style="terp_header"><b>[[ o.state&lt;&gt;'draft' and removeParentNode('para') ]] Request for Quotation N° [[ o.name ]]</b></para>
184 <para style="terp_default_8">
185 <font color="white"> </font>
186 </para>
187 <blockTable colWidths="106.8,106.8,106.8,106.8,106.8" style="Header_Order_Reference_Tbl">
188 <tr>
189 <td>
190 <para style="terp_tblheader_General_Centre"><b>Our Order Reference</b></para>
191 </td>
192 <td>
193 <para style="terp_tblheader_General_Centre"><b>Your Order Reference</b></para>
194 </td>
195 <td>
196 <para style="terp_tblheader_General_Centre"><b>Order Date</b></para>
197 </td>
198
199 <td>
200 <para style="terp_tblheader_General_Centre"><b>Pick Up Date</b></para>
201 </td>
202
203 <td>
204 <para style="terp_tblheader_General_Centre"><b>Validated By</b></para>
205 </td>
206 </tr>
207 </blockTable>
208 <blockTable colWidths="106.8,106.8,106.8,106.8,106.8" style="Content_Order_Reference_Table">
209 <tr>
210 <td>
211 <para style="terp_default_Centre_8">[[ o.name or '' ]]</para>
212 </td>
213 <td>
214 <para style="terp_default_Centre_8">[[ o.partner_ref or '' ]]</para>
215 </td>
216 <td>
217 <para style="terp_default_Centre_8">[[formatLang(o.date_order,date=True) ]]</para>
218 </td>
219
220 <td>
221 <para style="terp_default_Centre_8">[[ formatLang(o.date_pick_up, date=True) ]]</para>
222 </td>
223
224 <td>
225 <para style="terp_default_Centre_8">[[ (o.validator and o.validator.name) or '' ]]</para>
226 </td>
227 </tr>
228 </blockTable>
229 <para style="terp_default_9">
230 <font color="white"> </font>
231 </para>
232 <blockTable colWidths="180.0,70.0,60.0,80.0,60.0,85.0" repeatRows="1" style="Table_Header_Pur_ord_Line">
233 <tr>
234 <td>
235 <para style="terp_tblheader_General"><b>Description</b></para>
236 </td>
237 <td>
238 <para style="terp_tblheader_General"><b>Taxes</b></para>
239 </td>
240 <td>
241 <para style="terp_tblheader_General"><b>Date Req.</b></para>
242 </td>
243 <td>
244 <para style="terp_tblheader_General_Right"><b>Qty</b></para>
245 </td>
246 <td>
247 <para style="terp_tblheader_General_Right"><b>Unit Price</b></para>
248 </td>
249 <td>
250 <para style="terp_tblheader_General_Right"><b>Net Price</b></para>
251 </td>
252 </tr>
253 </blockTable>
254 <section>
255 <para style="terp_default_8">[[repeatIn(o.order_line,'line')]]</para>
256 <blockTable colWidths="180.0,70.0,60.0,80.0,60.0,85.0" style="Table_Order_Pur_line_Content">
257 <tr>
258 <td>
259 <para style="terp_default_9">[[ line.name ]]</para>
260 </td>
261 <td>
262 <para style="terp_default_9">[[ ', '.join(map(lambda x: x.name, line.taxes_id)) ]]</para>
263 </td>
264 <td>
265 <para style="terp_default_9">[[ formatLang( line.date_planned, date=True) ]]</para>
266 </td>
267 <td>
268 <para style="terp_default_Right_9">[[ formatLang(line.product_qty ) ]] [[ line.product_uom.name ]] </para>
269 </td>
270 <td>
271 <para style="terp_default_Right_9">[[ formatLang(line.price_unit, digits=get_digits(dp='Product Price') ) ]]</para>
272 </td>
273 <td>
274 <para style="terp_default_Right_9">[[ formatLang(line.price_subtotal, digits=get_digits(dp='Account'), currency_obj=o.pricelist_id.currency_id ) ]]</para>
275 </td>
276 </tr>
277 </blockTable>
278 </section>
279 <blockTable colWidths="375.0,60.0,100.0" style="Table_All_Total_Detail">
280 <tr>
281 <td>
282 <para style="terp_default_9">
283 <font color="white"> </font>
284 </para>
285 </td>
286 <td>
287 <para style="terp_default_9">Net Total :</para>
288 </td>
289 <td>
290 <para style="terp_default_Right_9">[[ formatLang(o.amount_untaxed, digits=get_digits(dp='Account'), currency_obj=o.pricelist_id.currency_id ) ]]</para>
291 </td>
292 </tr>
293 <tr>
294 <td>
295 <para style="terp_default_9">
296 <font color="white"> </font>
297 </para>
298 </td>
299 <td>
300 <para style="terp_default_9">Taxes :</para>
301 </td>
302 <td>
303 <para style="terp_default_Right_9">[[ formatLang(o.amount_tax, dp='Account', currency_obj=o.pricelist_id.currency_id) ]]</para>
304 </td>
305 </tr>
306 <tr>
307 <td>
308 <para style="terp_default_9">
309 <font color="white"> </font>
310 </para>
311 </td>
312 <td>
313 <para style="terp_default_Bold_9"><b>Total :</b></para>
314 </td>
315 <td>
316 <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>
317 </td>
318 </tr>
319 </blockTable>
320 <para style="terp_default_8">
321 <font color="white"> </font>
322 </para>
323 <blockTable colWidths="535.0" style="Table_Outer_Notes">
324 <tr>
325 <td>
326 <para style="terp_default_9">[[ format(o.notes or '') ]]</para>
327 </td>
328 </tr>
329 </blockTable>
330 <para style="terp_default_9">
331 <font color="white"> </font>
332 </para>
333 </pto>
334 </story>
335</document>
0336
=== added file 'purchase_order_pick_up_date/report/request_quotation.rml'
--- purchase_order_pick_up_date/report/request_quotation.rml 1970-01-01 00:00:00 +0000
+++ purchase_order_pick_up_date/report/request_quotation.rml 2014-08-27 19:22:25 +0000
@@ -0,0 +1,156 @@
1<?xml version="1.0" encoding="utf-8" ?>
2<document filename="requestforquotation.pdf">
3 <template pageSize="(595.0,842.0)" title="Test" author="Savoir-faire Linux (support@savoirfairelinux.com)" allowSplitting="20">
4 <pageTemplate id="first">
5 <frame id="first" x1="23.0" y1="43.0" width="530" height="799"/>
6 </pageTemplate>
7 </template>
8 <stylesheet>
9 <blockTableStyle id="Standard_Outline">
10 <blockAlignment value="LEFT"/>
11 <blockValign value="TOP"/>
12 </blockTableStyle>
13 <blockTableStyle id="Tableau1">
14 <blockAlignment value="LEFT"/>
15 <blockValign value="TOP"/>
16 </blockTableStyle>
17 <blockTableStyle id="Tableau2">
18 <blockAlignment value="LEFT"/>
19 <blockValign value="TOP"/>
20 </blockTableStyle>
21 <blockTableStyle id="Table_Product_Header_Title">
22 <blockAlignment value="LEFT"/>
23 <blockValign value="TOP"/>
24 <lineStyle kind="LINEBELOW" colorName="#000000" start="0,-1" stop="0,-1"/>
25 <lineStyle kind="LINEBELOW" colorName="#000000" start="1,-1" stop="1,-1"/>
26 <lineStyle kind="LINEBELOW" colorName="#000000" start="2,-1" stop="2,-1"/>
27 </blockTableStyle>
28 <blockTableStyle id="Table_Product_Line">
29 <blockAlignment value="LEFT"/>
30 <blockValign value="TOP"/>
31 <lineStyle kind="LINEBELOW" colorName="#e6e6e6" start="0,-1" stop="0,-1"/>
32 <lineStyle kind="LINEBELOW" colorName="#e6e6e6" start="1,-1" stop="1,-1"/>
33 <lineStyle kind="LINEBELOW" colorName="#e6e6e6" start="2,-1" stop="2,-1"/>
34 <lineStyle kind="LINEBELOW" colorName="#e6e6e6" start="3,-1" stop="3,-1"/>
35 </blockTableStyle>
36 <initialize>
37 <paraStyle name="all" alignment="justify"/>
38 </initialize>
39 <paraStyle name="P1" fontSize="9.0" leading="11" alignment="LEFT" spaceBefore="0.0" spaceAfter="0.0"/>
40 <paraStyle name="Standard"/>
41 <paraStyle name="terp_header" fontSize="12.0" leading="15" alignment="LEFT" spaceBefore="12.0" spaceAfter="6.0"/>
42 <paraStyle name="terp_tblheader_Details" fontSize="9.0" leading="11" alignment="LEFT" spaceBefore="6.0" spaceAfter="6.0"/>
43 <paraStyle name="terp_default_8" fontSize="8.0" leading="10" alignment="LEFT" spaceBefore="0.0" spaceAfter="0.0"/>
44 <paraStyle name="terp_tblheader_Details_Centre" fontSize="9.0" leading="11" alignment="CENTER" spaceBefore="6.0" spaceAfter="6.0"/>
45 <paraStyle name="terp_default_9" fontSize="9.0" leading="11" alignment="LEFT" spaceBefore="0.0" spaceAfter="0.0"/>
46 <paraStyle name="terp_default_Bold_9" fontSize="9.0" leading="11" alignment="LEFT" spaceBefore="0.0" spaceAfter="0.0"/>
47 <paraStyle name="terp_default_Centre_9" fontSize="9.0" leading="11" alignment="CENTER" spaceBefore="0.0" spaceAfter="0.0"/>
48 <paraStyle name="terp_default_Right_9" fontSize="9.0" leading="11" alignment="RIGHT" spaceBefore="0.0" spaceAfter="0.0"/>
49 <paraStyle name="Space bet user and signature" fontSize="4.0" leading="5" alignment="LEFT" spaceBefore="0.0" spaceAfter="0.0"/>
50 <images/>
51 </stylesheet>
52 <story>
53 <para style="terp_default_9">[[repeatIn(objects,'order')]]</para>
54 <para style="terp_default_9">[[ setLang(order.partner_id.lang) ]]</para>
55 <para style="terp_default_9">
56 <font color="white"> </font>
57 </para>
58 <blockTable colWidths="250.0,59.0,221.0" style="Tableau1">
59 <tr>
60 <td>
61 <blockTable colWidths="250.0" style="Tableau2">
62 <tr>
63 <td>
64 <para style="terp_default_Bold_9"><b>Expected Delivery address:</b></para>
65 <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>
66 <para style="P1">[[ order.dest_address_id and display_address(order.dest_address_id) ]]</para>
67 </td>
68 </tr>
69 </blockTable>
70 <para style="terp_default_9">
71 <font color="white"> </font>
72 </para>
73 </td>
74 <td>
75 <para style="terp_default_9">
76 <font color="white"> </font>
77 </para>
78 </td>
79 <td>
80 <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>
81 <para style="terp_default_9">[[ order.partner_id and display_address(order .partner_id) ]] </para>
82 <para style="terp_default_9">
83 <font color="white"> </font>
84 </para>
85 <para style="terp_default_9">Tel.: [[ (order.partner_id and order.partner_id.phone) or removeParentNode('para') ]]</para>
86 <para style="terp_default_9">Fax: [[ (order.partner_id and order.partner_id.fax) or removeParentNode('para') ]]</para>
87 <para style="P1">TVA: [[ (order.partner_id and order.partner_id.vat) or removeParentNode('para') ]]</para>
88 </td>
89 </tr>
90 </blockTable>
91 <para style="Standard">
92 <font color="white"> </font>
93 </para>
94
95 <blockTable colWidths="524.0" style="Tableau1">
96 <tr>
97 <td>
98 <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>
99 </td>
100 </tr>
101 </blockTable>
102 <para style="terp_header"><b>Request for Quotation : [[order.name]]</b></para>
103
104 <para style="terp_default_8">
105 <font color="white"> </font>
106 </para>
107
108 <blockTable colWidths="371.0,98.0,61.0" repeatRows="1" style="Table_Product_Header_Title">
109 <tr>
110 <td>
111 <para style="terp_tblheader_Details"><b>Description</b></para>
112 </td>
113 <td>
114 <para style="terp_tblheader_Details_Centre"><b>Expected Date</b></para>
115 </td>
116 <td>
117 <para style="terp_tblheader_Details_Centre"><b>Qty</b></para>
118 </td>
119 </tr>
120 </blockTable>
121 <section>
122 <para style="terp_default_9">[[ repeatIn(order.order_line,'order_line') ]]</para>
123 <blockTable colWidths="371.0,98.0,61.0" style="Table_Product_Line">
124 <tr>
125 <td>
126 <para style="terp_default_9">[[ order_line.name ]]</para>
127 </td>
128 <td>
129 <para style="terp_default_Centre_9">[[ formatLang(order_line.date_planned, date = True) ]]</para>
130 </td>
131 <td>
132 <para style="terp_default_Right_9">
133 [[ formatLang(order_line.product_qty )]]
134 <i>[[ (order_line.product_uom and order_line.product_uom.name) or '' ]]</i>
135 </para>
136 </td>
137 </tr>
138 </blockTable>
139 </section>
140 <para style="terp_default_9">
141 <font color="white"> </font>
142 </para>
143 <para style="terp_default_9">[[ format(order.notes or '') ]]</para>
144 <para style="terp_default_9">
145 <font color="white"> </font>
146 </para>
147 <para style="terp_default_9">Regards,</para>
148 <para style="terp_default_9">
149 <font color="white"> </font>
150 </para>
151 <para style="Space bet user and signature">
152 <font color="white"> </font>
153 </para>
154 <para style="terp_default_9">[[ user.signature or '' ]]</para>
155 </story>
156</document>
0157
=== added directory 'sale_improved_slip'
=== added file 'sale_improved_slip/__init__.py'
--- sale_improved_slip/__init__.py 1970-01-01 00:00:00 +0000
+++ sale_improved_slip/__init__.py 2014-08-27 19:22:25 +0000
@@ -0,0 +1,23 @@
1# -*- coding: utf-8 -*-
2##############################################################################
3#
4# OpenERP, Open Source Management Solution
5# Copyright (C) 2013 Savoir-faire Linux (<http://www.savoirfairelinux.com>).
6#
7# This program is free software: you can redistribute it and/or modify
8# it under the terms of the GNU Affero General Public License as
9# published by the Free Software Foundation, either version 3 of the
10# License, or (at your option) any later version.
11#
12# This program is distributed in the hope that it will be useful,
13# but WITHOUT ANY WARRANTY; without even the implied warranty of
14# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15# GNU Affero General Public License for more details.
16#
17# You should have received a copy of the GNU Affero General Public License
18# along with this program. If not, see <http://www.gnu.org/licenses/>.
19#
20##############################################################################
21
22import report
23import sale
024
=== added file 'sale_improved_slip/__openerp__.py'
--- sale_improved_slip/__openerp__.py 1970-01-01 00:00:00 +0000
+++ sale_improved_slip/__openerp__.py 2014-08-27 19:22:25 +0000
@@ -0,0 +1,47 @@
1# -*- coding: utf-8 -*-
2##############################################################################
3#
4# OpenERP, Open Source Management Solution
5# Copyright (C) 2013 Savoir-faire Linux (<http://www.savoirfairelinux.com>).
6#
7# This program is free software: you can redistribute it and/or modify
8# it under the terms of the GNU Affero General Public License as
9# published by the Free Software Foundation, either version 3 of the
10# License, or (at your option) any later version.
11#
12# This program is distributed in the hope that it will be useful,
13# but WITHOUT ANY WARRANTY; without even the implied warranty of
14# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15# GNU Affero General Public License for more details.
16#
17# You should have received a copy of the GNU Affero General Public License
18# along with this program. If not, see <http://www.gnu.org/licenses/>.
19#
20##############################################################################
21
22{
The diff has been truncated for viewing.

Subscribers

People subscribed via source and target branches