-
-
-
-
- Minimum Stock Rules
- stock.warehouse.orderpoint
- ir.actions.act_window
- form
-
-
-
-
-
-
-
-
-
-
button_cancel
-
+
-
-
- mrp.procurement.basic
- mrp.procurement
- True
-
-
-
-
- True
- draft
-
-
-
- cancel
- function
- action_cancel()
- True
-
-
-
- confirm
- function
- action_confirm()
-
-
-
- confirm_wait
- function
- write({'state':'exception'})
-
-
-
- confirm_mts
-
-
-
- confirm_mto
-
-
-
- make_to_stock
- function
- action_move_assigned()
-
-
+ producesubflowaction_produce_assign_product()
-
+ produce_check
-
+ produce_servicefunctionaction_produce_assign_service()
-
-
- buy
- subflow
-
- action_po_assign()
-
-
-
- ready
- function
- action_ready()
-
-
-
- wait_done
- function
- write({'state':'waiting'})
-
-
-
-
- True
- done
- function
- action_done()
-
-
-
-
-
- button_confirm
-
-
-
-
- button_wait_done
- True
-
-
-
-
- check_move_done()
- stock.move
- [move_id.id]
-
-
-
-
-
- button_check
- test_cancel()
-
-
-
-
- button_check
- not test_cancel()
-
-
-
-
- procure_method=='make_to_order'
-
-
-
-
- procure_method=='make_to_stock'
-
-
-
-
- button_cancel
-
-
-
-
- button_cancel
-
-
-
-
- button_restart
-
-
-
-
- button_cancel
-
-
-
-
- button_restart
-
-
-
-
- button_cancel
-
-
-
-
- check_make_to_stock()
-
+
-
+ check_produce()
-
-
-
- check_product()
- not check_product()
-
-
-
- check_buy()
-
-
-
-
- True
-
-
-
-
-
-
- subflow.cancel
-
+
-
+ subflow.cancel
-
-
-
- subflow.cancel
-
-
-
-
-
- subflow.done
-
-
+
-
+
-
-
-
- subflow.delivery_done
+
+
+
+
+ check_product()
-
-
-
- action_check_finnished()
+
+
+
+
+ subflow.cancel
-
-
-
- check_move_cancel()
+
+
+
+
+ subflow.done
+
+
diff --git a/addons/mrp/process/procurement_process.xml b/addons/mrp/process/procurement_process.xml
index 17d72a520f2..08d66570b1f 100644
--- a/addons/mrp/process/procurement_process.xml
+++ b/addons/mrp/process/procurement_process.xml
@@ -1,43 +1,16 @@
-
-
-
-
-
-
-
-
-
-
-
-
+
+
-
-
-
-
-
-
+
+
+
+
+
-
-
-
-
-
-
-
-
-
-
-
-
-
+
@@ -46,31 +19,31 @@
-
+
-
-
-
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
+
+
+
@@ -79,10 +52,22 @@
-
+
+
+
+
+
+
+
+
+
+
+
+
+
@@ -91,10 +76,22 @@
-
+
+
+
+
+
+
+
+
+
+
+
+
+
@@ -102,14 +99,14 @@
-
+
-
+
diff --git a/addons/mrp/security/ir.model.access.csv b/addons/mrp/security/ir.model.access.csv
index 48f27679435..d5e00b9cbda 100644
--- a/addons/mrp/security/ir.model.access.csv
+++ b/addons/mrp/security/ir.model.access.csv
@@ -1,7 +1,5 @@
"id","name","model_id:id","group_id:id","perm_read","perm_write","perm_create","perm_unlink"
"access_mrp_workcenter","mrp.workcenter","model_mrp_workcenter","mrp.group_mrp_user",1,0,0,0
-"access_mrp_property_group","mrp.property.group","model_mrp_property_group","mrp.group_mrp_user",1,0,0,0
-"access_mrp_property","mrp.property","model_mrp_property","mrp.group_mrp_user",1,0,0,0
"access_mrp_routing","mrp.routing","model_mrp_routing","mrp.group_mrp_user",1,0,0,0
"access_mrp_routing_workcenter","mrp.routing.workcenter","model_mrp_routing_workcenter","mrp.group_mrp_user",1,0,0,0
"access_mrp_bom","mrp.bom","model_mrp_bom","mrp.group_mrp_user",1,0,0,0
@@ -10,11 +8,7 @@
"access_mrp_production_workcenter_line","mrp.production.workcenter.line","model_mrp_production_workcenter_line","mrp.group_mrp_user",1,1,1,1
"access_mrp_production_product_line","mrp.production.product.line","model_mrp_production_product_line","mrp.group_mrp_user",1,1,1,1
"access_mrp_procurement","mrp.procurement","model_mrp_procurement","mrp.group_mrp_user",1,1,1,1
-"access_stock_warehouse_orderpoint","stock.warehouse.orderpoint","model_stock_warehouse_orderpoint","mrp.group_mrp_user",1,0,0,0
-"access_stock_warehouse_orderpoint_manager","stock.warehouse.orderpoint.manager","model_stock_warehouse_orderpoint","mrp.group_mrp_manager",1,1,1,1
"access_mrp_workcenter_manager","mrp.workcenter.manager","model_mrp_workcenter","mrp.group_mrp_user",1,1,1,1
-"access_mrp_property_group_manager","mrp.property.group.manager","model_mrp_property_group","mrp.group_mrp_user",1,1,1,1
-"access_mrp_property_manager","mrp.property.manager","model_mrp_property","mrp.group_mrp_user",1,1,1,1
"access_mrp_routing_manager","mrp.routing.manager","model_mrp_routing","mrp.group_mrp_manager",1,1,1,1
"access_mrp_routing_workcenter_manager","mrp.routing.workcenter.manager","model_mrp_routing_workcenter","mrp.group_mrp_manager",1,1,1,1
"access_mrp_bom_manager","mrp.bom.manager","model_mrp_bom","mrp.group_mrp_manager",1,1,1,1
@@ -32,10 +26,7 @@
"access_mrp_production_stock_worker","mrp.production stock_worker","model_mrp_production","stock.group_stock_user",1,0,0,0
"access_mrp_installer","mrp.installer","model_mrp_installer","mrp.group_mrp_user",1,0,0,0
"access_mrp_product_produce","mrp.product.produce","model_mrp_product_produce","mrp.group_mrp_user",1,0,0,0
-"access_mrp_make_procurement","make.procurement","model_make_procurement","mrp.group_mrp_user",1,0,0,0
"access_mrp_change_production_qty","change.production.qty","model_change_production_qty","mrp.group_mrp_user",1,0,0,0
-"access_mrp_procurement_compute_all","mrp.procurement.compute.all","model_mrp_procurement_compute_all","mrp.group_mrp_user",1,0,0,0
-"access_mrp_procurement_orderpoint_compute","mrp.procurement.orderpoint.compute","model_mrp_procurement_orderpoint_compute","mrp.group_mrp_user",1,0,0,0
"access_mrp_production_order","mrp.production.order","model_mrp_production_order","mrp.group_mrp_user",1,0,0,0
"access_report_workcenter_load","report.workcenter.load","model_report_workcenter_load","mrp.group_mrp_manager",1,0,0,0
"access_report_mrp_inout","report.mrp.inout","model_report_mrp_inout","mrp.group_mrp_manager",1,0,0,0
diff --git a/addons/mrp/security/mrp_security.xml b/addons/mrp/security/mrp_security.xml
index 955bdad2fdd..4d47e374e02 100644
--- a/addons/mrp/security/mrp_security.xml
+++ b/addons/mrp/security/mrp_security.xml
@@ -16,20 +16,6 @@
-
- mrp_procurement multi-company
-
-
- ['|',('company_id','child_of',[user.company_id.id]),('company_id','=',False)]
-
-
-
- stock_warehouse.orderpoint multi-company
-
-
- ['|',('company_id','child_of',[user.company_id.id]),('company_id','=',False)]
-
-
mrp_production multi-company
diff --git a/addons/mrp/stock.py b/addons/mrp/stock.py
index 4a35d6003cf..dcb7d4573c1 100644
--- a/addons/mrp/stock.py
+++ b/addons/mrp/stock.py
@@ -27,74 +27,6 @@ import ir
import netsvc
import time
-
-class stock_warehouse_orderpoint(osv.osv):
- """
- Defines Minimum stock rules.
- """
- _name = "stock.warehouse.orderpoint"
- _description = "Orderpoint minimum rule"
-
- _columns = {
- 'name': fields.char('Name', size=32, required=True),
- 'active': fields.boolean('Active', help="If the active field is set to true, it will allow you to hide the orderpoint without removing it."),
- 'logic': fields.selection([('max','Order to Max'),('price','Best price (not yet active!)')], 'Reordering Mode', required=True),
- 'warehouse_id': fields.many2one('stock.warehouse', 'Warehouse', required=True),
- 'location_id': fields.many2one('stock.location', 'Location', required=True),
- 'product_id': fields.many2one('product.product', 'Product', required=True, ondelete='cascade', domain=[('type','=','product')]),
- 'product_uom': fields.many2one('product.uom', 'Product UOM', required=True ),
- 'product_min_qty': fields.float('Min Quantity', required=True,
- help="When the virtual stock goes belong the Min Quantity, Open ERP generates "\
- "a procurement to bring the virtual stock to the Max Quantity."),
- 'product_max_qty': fields.float('Max Quantity', required=True,
- help="When the virtual stock goes belong the Min Quantity, Open ERP generates "\
- "a procurement to bring the virtual stock to the Max Quantity."),
- 'qty_multiple': fields.integer('Qty Multiple', required=True,
- help="The procurement quantity will by rounded up to this multiple."),
- 'procurement_id': fields.many2one('mrp.procurement', 'Latest procurement'),
- 'company_id': fields.many2one('res.company','Company',required=True),
- }
- _defaults = {
- 'active': lambda *a: 1,
- 'logic': lambda *a: 'max',
- 'qty_multiple': lambda *a: 1,
- 'name': lambda x,y,z,c: x.pool.get('ir.sequence').get(y,z,'mrp.warehouse.orderpoint') or '',
- 'product_uom': lambda sel, cr, uid, context: context.get('product_uom', False),
- 'company_id': lambda self, cr, uid, c: self.pool.get('res.company')._company_default_get(cr, uid, 'stock.warehouse.orderpoint', context=c)
- }
-
- def onchange_warehouse_id(self, cr, uid, ids, warehouse_id, context={}):
- """ Finds location id for changed warehouse.
- @param warehouse_id: Changed id of warehouse.
- @return: Dictionary of values.
- """
- if warehouse_id:
- w = self.pool.get('stock.warehouse').browse(cr, uid, warehouse_id, context)
- v = {'location_id': w.lot_stock_id.id}
- return {'value': v}
- return {}
-
- def onchange_product_id(self, cr, uid, ids, product_id, context={}):
- """ Finds UoM for changed product.
- @param product_id: Changed id of product.
- @return: Dictionary of values.
- """
- if product_id:
- prod = self.pool.get('product.product').browse(cr,uid,product_id)
- v = {'product_uom': prod.uom_id.id}
- return {'value': v}
- return {}
-
- def copy(self, cr, uid, id, default=None,context={}):
- if not default:
- default = {}
- default.update({
- 'name': self.pool.get('ir.sequence').get(cr, uid, 'mrp.warehouse.orderpoint') or '',
- })
- return super(stock_warehouse_orderpoint, self).copy(cr, uid, id, default, context)
-
-stock_warehouse_orderpoint()
-
class StockMove(osv.osv):
_inherit = 'stock.move'
diff --git a/addons/mrp/test/mrp_phantom_bom.yml b/addons/mrp/test/mrp_phantom_bom.yml
new file mode 100644
index 00000000000..df4ade1cb6e
--- /dev/null
+++ b/addons/mrp/test/mrp_phantom_bom.yml
@@ -0,0 +1,234 @@
+-
+ In order to test the mrp phantom bom type in OpenERP, I will create products
+ and then I will create Phantom bom structure for those products.
+-
+ I create the products required to produce some orange juices: Oranges, Sugar and Water.
+-
+ !record {model: product.uom, id: product_uom_litre0}:
+ category_id: product.product_uom_categ_kgm
+ factor: 1.0
+ name: Litre
+ rounding: 0.01
+-
+ !record {model: product.product, id: product_product_orangejuice0}:
+ categ_id: product.cat1
+ name: Orange Juice
+ procure_method: make_to_order
+ supply_method: produce
+ type: product
+ uom_id: product_uom_litre0
+ uom_po_id: product_uom_litre0
+-
+ !record {model: product.product, id: product_product_orange0}:
+ categ_id: product.cat1
+ name: Orange
+ procure_method: make_to_stock
+ seller_ids:
+ - delay: 1
+ name: base.res_partner_asus
+ qty: 1.0
+ supply_method: buy
+ type: product
+ uom_id: product.product_uom_kgm
+ uom_po_id: product.product_uom_kgm
+-
+ !record {model: product.product, id: product_product_sugar0}:
+ categ_id: product.cat1
+ name: Sugar
+ procure_method: make_to_stock
+ seller_ids:
+ - delay: 1
+ name: base.res_partner_desertic_hispafuentes
+ qty: 2.0
+ supply_method: buy
+ type: product
+ uom_id: product.product_uom_kgm
+ uom_po_id: product.product_uom_kgm
+-
+ !record {model: product.product, id: product_product_water0}:
+ categ_id: product.cat1
+ name: Water
+ procure_method: make_to_stock
+ supply_method: buy
+ type: consu
+ uom_id: product_uom_litre0
+ uom_po_id: product_uom_litre0
+-
+ I define the BoM to produce an orange juice
+-
+ !record {model: mrp.bom, id: mrp_bom_orangejuice0}:
+ company_id: base.main_company
+ name: Orange Juice
+ product_efficiency: 1.0
+ product_id: product_product_orangejuice0
+ product_qty: 1.0
+ product_uom: product_uom_litre0
+ type: phantom
+-
+ !record {model: mrp.bom, id: mrp_bom_orangejuice0}:
+ bom_lines:
+ - bom_id: mrp_bom_orangejuice0
+ company_id: base.main_company
+ name: Orange
+ product_efficiency: 1.0
+ product_id: product_product_orange0
+ product_qty: 0.5
+ product_uom: product.product_uom_kgm
+ type: normal
+ - bom_id: mrp_bom_orangejuice0
+ company_id: base.main_company
+ name: Sugar
+ product_efficiency: 1.0
+ product_id: product_product_sugar0
+ product_qty: 0.02
+ product_uom: product.product_uom_kgm
+ type: normal
+ - bom_id: mrp_bom_orangejuice0
+ company_id: base.main_company
+ name: Water
+ product_efficiency: 1.0
+ product_id: product_product_water0
+ product_qty: 0.80000000000000004
+ product_uom: product_uom_litre0
+ type: normal
+-
+ I define Minimum stock rules for my stockable products orange and sugar
+-
+ !record {model: stock.warehouse.orderpoint, id: stock_warehouse_orderpoint_op0}:
+ company_id: base.main_company
+ location_id: stock.stock_location_stock
+ logic: max
+ name: OP/00002
+ product_id: product_product_orange0
+ product_max_qty: 10.0
+ product_min_qty: 5.0
+ product_uom: product.product_uom_kgm
+ qty_multiple: 1
+ warehouse_id: stock.warehouse0
+-
+ !record {model: stock.warehouse.orderpoint, id: stock_warehouse_orderpoint_op1}:
+ company_id: base.main_company
+ location_id: stock.stock_location_stock
+ logic: max
+ name: OP/00003
+ product_id: product_product_sugar0
+ product_max_qty: 4.0
+ product_min_qty: 2.0
+ product_uom: product.product_uom_kgm
+ qty_multiple: 1
+ warehouse_id: stock.warehouse0
+-
+ I want to produce 100 litres of Orange juice. I am creating a manufacturing order for this.
+ I want to see how much quantities of sub products I need, to produce the Orange juice.
+-
+ I compute the data. I get the bill of material of Orange juice and list of
+ scheduled products according to my bom.
+-
+ !record {model: mrp.production, id: mrp_production_mo0}:
+ company_id: base.main_company
+ date_planned: '2010-04-16 15:53:36'
+ location_dest_id: stock.stock_location_output
+ location_src_id: stock.stock_location_stock
+ name: MO/00002
+ product_id: product_product_orangejuice0
+ product_qty: 100.0
+ product_uom: product_uom_litre0
+-
+ Creating an mrp.production record. Computing Bills of materials.
+-
+ !record {model: mrp.production, id: mrp_production_mo0}:
+ bom_id: mrp.mrp_bom_orangejuice0
+ company_id: base.main_company
+ date_planned: '2010-04-16 15:53:36'
+ location_dest_id: stock.stock_location_output
+ location_src_id: stock.stock_location_stock
+ name: MO/00002
+ product_id: mrp.product_product_orangejuice0
+ product_lines:
+ - name: Orange
+ product_id: mrp.product_product_orange0
+ product_qty: 50.0
+ product_uom: product.product_uom_kgm
+ production_id: mrp_production_mo0
+ - name: Sugar
+ product_id: mrp.product_product_sugar0
+ product_qty: 2.0
+ product_uom: product.product_uom_kgm
+ production_id: mrp_production_mo0
+ - name: Water
+ product_id: mrp.product_product_water0
+ product_qty: 80.0
+ product_uom: mrp.product_uom_litre0
+ production_id: mrp_production_mo0
+ product_qty: 100.0
+ product_uom: mrp.product_uom_litre0
+-
+ I confirm the order.
+-
+ !workflow {model: mrp.production, action: button_confirm, ref: mrp_production_mo0}
+-
+ I am checking Procurement orders. There are 3 orders generated for Oranges, Sugar and Water.
+-
+ !python {model: mrp.procurement}: |
+ from tools.translate import _
+ proc_ids = self.search(cr, uid, [('origin','=',':MO/00002')])
+ assert proc_ids, _('No Procurements!')
+-
+ The scheduler runs.
+-
+ !function {model: mrp.procurement, name: run_scheduler}:
+ - model: mrp.procurement
+ search: "[('origin','=',':MO/00002')]"
+-
+ I am checking Internal picking. I see one picking for Orange juice and its
+ stock moves for Oranges, Sugar and Water made correctly.
+-
+ !python {model: stock.picking}: |
+ from tools.translate import _
+ pick_ids = self.search(cr, uid, [('origin','=',':MO/00002'),('type','=','internal')])
+ assert pick_ids, _('No Internal Pickings!')
+-
+ According to minimum stock rules. I have 2 purchase orders for
+ Sugar with 6 Kg from Axelor and Orange 60 Kg from ASUStek.
+-
+ I confirm the purchase order of Sugar and Orange.
+-
+ !python {model: purchase.order}: |
+ from tools.translate import _
+ import netsvc
+ purch_ids = self.search(cr, uid, [('origin','in',['SCHEDULER','OP/00002','OP/00003'])])
+ assert purch_ids, _('No Purchase Orders were made!')
+ wf_service = netsvc.LocalService("workflow")
+ for p_id in purch_ids:
+ wf_service.trg_validate(uid, 'purchase.order', p_id, 'purchase_confirm', cr)
+-
+ I get the approval from both the suppliers. So I approve my purchase orders.
+-
+ !python {model: purchase.order}: |
+ from tools.translate import _
+ import netsvc
+ purch_ids = self.search(cr, uid, [('origin','in',['SCHEDULER','OP/00002','OP/00003']),('state','=','confirmed')])
+ assert purch_ids, _('No Confirmed Purchase Orders found!')
+ wf_service = netsvc.LocalService("workflow")
+ for p_id in purch_ids:
+ wf_service.trg_validate(uid, 'purchase.order', p_id, 'purchase_approve', cr)
+-
+ I see two incoming pickings for Orange and Sugar.
+-
+ !python {model: stock.picking}: |
+ from tools.translate import _
+ pick_ids = self.search(cr, uid, [('origin','in',['PO00001:SCHEDULER','PO00002:SCHEDULER','PO00003:OP/00002','PO00004:OP/00003']),('type','=','in')])
+ assert pick_ids, _('No Incoming Shipments found!')
+-
+ I receive both the products. My incoming pickings are done.
+-
+ !record {model: stock.partial.picking, id: stock_partial_picking0}:
+ date: '2010-04-30 16:53:36'
+ partner_id: base.res_partner_asus
+ address_id: base.res_partner_address_tang
+-
+ !python {model: stock.partial.picking}: |
+ pick_obj = self.pool.get('stock.picking')
+ picking_ids = pick_obj.search(cr, uid, [('origin','in',['PO00001:SCHEDULER','PO00002:SCHEDULER','PO00003:OP/00002','PO00004:OP/00003']),('type','=','in')])
+ self.do_partial(cr, uid, [1],context={'active_ids': picking_ids})
+
\ No newline at end of file
diff --git a/addons/mrp/test/mrp_production_order.yml b/addons/mrp/test/mrp_production_order.yml
new file mode 100644
index 00000000000..023a9f22f31
--- /dev/null
+++ b/addons/mrp/test/mrp_production_order.yml
@@ -0,0 +1,139 @@
+-
+ In order to test the manufacturing order working with procurements I will use
+ some products with different supply method and procurement method, also check
+ the bills of material for the products.
+-
+ I am creating one manufacturing order.
+-
+ !record {model: mrp.production, id: mrp_production_mo0}:
+ bom_id: mrp.mrp_bom_9
+ routing_id: mrp.mrp_routing_0
+ company_id: base.main_company
+ date_planned: '2010-05-06 14:55:52'
+ location_dest_id: stock.stock_location_stock
+ location_src_id: stock.stock_location_stock
+ name: MO/00004
+ product_id: product.product_product_pc1
+ product_qty: 5.0
+ product_uom: product.product_uom_unit
+ product_uos_qty: 0.0
+-
+ Creating a mrp.production.workcenter.line record
+-
+ !record {model: mrp.production.workcenter.line, id: mrp_production_workcenter_line_assemblyline0}:
+ cycle: 5.0
+ hour: 10.0
+ name: Assembly Line 1
+ production_id: mrp_production_mo0
+ sequence: 0.0
+ workcenter_id: mrp.mrp_workcenter_0
+-
+ Creating a mrp.production.product.line record
+-
+ !record {model: mrp.production.product.line, id: mrp_production_product_line_regularprocessorconfig0}:
+ name: Regular processor config
+ product_id: product.product_product_cpu_gen
+ product_qty: 5.0
+ product_uom: product.product_uom_unit
+ product_uos_qty: 0.0
+ production_id: mrp_production_mo0
+-
+ Creating a mrp.production.product.line record
+-
+ !record {model: mrp.production.product.line, id: mrp_production_product_line_hddseagategb0}:
+ name: HDD Seagate 7200.8 80GB
+ product_id: product.product_product_hdd1
+ product_qty: 5.0
+ product_uom: product.product_uom_unit
+ product_uos_qty: 0.0
+ production_id: mrp_production_mo0
+-
+ Creating a mrp.production.product.line record
+-
+ !record {model: mrp.production.product.line, id: mrp_production_product_line_atxmidsizetower0}:
+ name: ATX Mid-size Tower
+ product_id: product.product_product_tow1
+ product_qty: 5.0
+ product_uom: product.product_uom_unit
+ product_uos_qty: 0.0
+ production_id: mrp_production_mo0
+-
+ Creating a mrp.production.product.line record
+-
+ !record {model: mrp.production.product.line, id: mrp_production_product_line_mouse0}:
+ name: Mouse
+ product_id: product.product_product_25
+ product_qty: 5.0
+ product_uom: product.product_uom_unit
+ product_uos_qty: 0.0
+ production_id: mrp_production_mo0
+-
+ Creating a mrp.production.product.line record
+-
+ !record {model: mrp.production.product.line, id: mrp_production_product_line_keyboard0}:
+ name: Keyboard
+ product_id: product.product_product_24
+ product_qty: 5.0
+ product_uom: product.product_uom_unit
+ product_uos_qty: 0.0
+ production_id: mrp_production_mo0
+-
+ I confirm the order.
+-
+ !workflow {model: mrp.production, action: button_confirm, ref: mrp_production_mo0}
+-
+ I am checking Procurement orders.
+-
+ !python {model: mrp.procurement}: |
+ from tools.translate import _
+ proc_ids = self.search(cr, uid, [('origin','=',':MO/00004')])
+ assert proc_ids, _('No Procurements!')
+-
+ The scheduler runs.
+-
+ !function {model: mrp.procurement, name: run_scheduler}:
+ - model: mrp.procurement
+ search: "[('origin','=',':MO/00004')]"
+-
+ I am checking Internal picking.
+-
+ !python {model: stock.picking}: |
+ from tools.translate import _
+ pick_ids = self.search(cr, uid, [('origin','=',':MO/00004'),('type','=','internal')])
+ assert pick_ids, _('No Internal Pickings!')
+-
+ I see that there is a manufacturing order for the subproduct of PC1 with ready state.
+-
+ !python {model: mrp.production}: |
+ from tools.translate import _
+ order_ids = self.search(cr, uid, [('origin','=',':MO/00004'),('state','=','ready')])
+ assert order_ids, _('No manufacturing order!')
+-
+ I start producing that product first. So I marked it as started.
+-
+ !record {model: mrp.product.produce, id: mrp_product_produce0}:
+ product_qty: 5.00
+ mode: 'consume_produce'
+-
+ !python {model: mrp.product.produce}: |
+ prod_obj = self.pool.get('mrp.production')
+ prod_ids = prod_obj.search(cr, uid, [('origin','=',':MO/00004')])
+ self.do_produce(cr, uid, [1], context={'active_ids': prod_ids})
+-
+ Now the manufacturing order for subproduct CPU_GEN is done. And manufacturing
+ order for PC1 is in ready state.
+-
+ !python {model: mrp.production}: |
+ from tools.translate import _
+ prod_ids = self.search(cr, uid, [('origin','=',':MO/00004'),('state','=','done')])
+ assert prod_ids, _('Manufacturing order is yet not done!')
+-
+ I start producing the product PC1.
+-
+ !workflow {model: mrp.production, action: button_produce, ref: mrp_production_mo0}
+-
+ !python {model: mrp.product.produce}: |
+ from tools.translate import _
+ prod_obj = self.pool.get('mrp.production')
+ prod_ids = prod_obj.search(cr, uid, [('product_id.default_code','=','PC1')])
+ self.do_produce(cr, uid, [1], context={'active_ids': prod_ids})
diff --git a/addons/mrp/wizard/__init__.py b/addons/mrp/wizard/__init__.py
index 045d7f1bd71..aa4408e543e 100644
--- a/addons/mrp/wizard/__init__.py
+++ b/addons/mrp/wizard/__init__.py
@@ -20,14 +20,10 @@
##############################################################################
import mrp_product_produce
-import orderpoint_procurement
-import mrp_procurement
-import schedulers_all
import mrp_price
import mrp_workcenter_load
#import mrp_track_prod
import change_production_qty
-import make_procurement_product
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
diff --git a/addons/mrp/wizard/mrp_track_prod.py b/addons/mrp/wizard/mrp_track_prod.py
index 11e1ec32ec6..43929b47dc7 100644
--- a/addons/mrp/wizard/mrp_track_prod.py
+++ b/addons/mrp/wizard/mrp_track_prod.py
@@ -56,33 +56,35 @@ class mrp_track_move(osv.osv_memory):
"""
res = super(mrp_track_move, self).fields_view_get(cr, uid, view_id=view_id, view_type=view_type, context=context, toolbar=toolbar,submenu=False)
record_id = context and context.get('active_id', False) or False
- if record_id:
- prod_obj = self.pool.get('mrp.production')
- prod = prod_obj.browse(cr, uid, record_id)
- try:
- if prod.state != 'done':
- res['arch'] = '''
-
-
-
-
-
- '''
- else:
- arch_lst = ['
', '']
- for m in [line for line in prod.move_created_ids]:
- quantity = m.product_qty
- res['fields']['track%s' %m.id] = {'string' : m.product_id.name, 'type' : 'boolean', 'default' : lambda x,y,z: False}
- arch_lst.append('\n' %m.id)
- arch_lst.append('')
- arch_lst.append('')
- arch_lst.append('')
- arch_lst.append('')
- arch_lst.append('
')
- res['arch'] = '\n'.join(arch_lst)
- except Exception,e:
- return res
+ active_model = context.get('active_model')
+
+ if not record_id or (active_model and active_model != 'mrp.production'):
+ return res
+
+ prod_obj = self.pool.get('mrp.production')
+ prod = prod_obj.browse(cr, uid, record_id)
+ if prod.state != 'done':
+ res['arch'] = '''
+
+
+
+
+
+ '''
+ else:
+ arch_lst = ['
', '']
+ for m in [line for line in prod.move_created_ids]:
+ quantity = m.product_qty
+ res['fields']['track%s' %m.id] = {'string' : m.product_id.name, 'type' : 'boolean', 'default' : lambda x,y,z: False}
+ arch_lst.append('\n' %m.id)
+ arch_lst.append('')
+ arch_lst.append('')
+ arch_lst.append('')
+ arch_lst.append('')
+ arch_lst.append('
')
+ res['arch'] = '\n'.join(arch_lst)
+
return res
def track_lines(self, cr, uid, ids, context):
diff --git a/addons/mrp_procurement/__init__.py b/addons/mrp_procurement/__init__.py
new file mode 100644
index 00000000000..6cb8ad4027b
--- /dev/null
+++ b/addons/mrp_procurement/__init__.py
@@ -0,0 +1,25 @@
+# -*- coding: utf-8 -*-
+##############################################################################
+#
+# OpenERP, Open Source Management Solution
+# Copyright (C) 2004-2010 Tiny SPRL ().
+#
+# This program is free software: you can redistribute it and/or modify
+# it under the terms of the GNU Affero General Public License as
+# published by the Free Software Foundation, either version 3 of the
+# License, or (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU Affero General Public License for more details.
+#
+# You should have received a copy of the GNU Affero General Public License
+# along with this program. If not, see .
+#
+##############################################################################
+
+import mrp_procurement
+import wizard
+import schedulers
+import company
\ No newline at end of file
diff --git a/addons/mrp_procurement/__openerp__.py b/addons/mrp_procurement/__openerp__.py
new file mode 100644
index 00000000000..82c611c6c78
--- /dev/null
+++ b/addons/mrp_procurement/__openerp__.py
@@ -0,0 +1,52 @@
+# -*- coding: utf-8 -*-
+##############################################################################
+#
+# OpenERP, Open Source Management Solution
+# Copyright (C) 2004-2010 Tiny SPRL ().
+#
+# This program is free software: you can redistribute it and/or modify
+# it under the terms of the GNU Affero General Public License as
+# published by the Free Software Foundation, either version 3 of the
+# License, or (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU Affero General Public License for more details.
+#
+# You should have received a copy of the GNU Affero General Public License
+# along with this program. If not, see .
+#
+##############################################################################
+
+
+{
+ "name" : "Procurements",
+ "version" : "1.0",
+ "author" : "Tiny",
+ "website" : "http://www.openerp.com",
+ "category" : "Generic Modules/Production",
+ "depends" : ["base","process", "product", "stock"],
+ "description": """
+ This is the module for computing Procurements.
+ """,
+ 'init_xml': [],
+ 'update_xml': [
+ 'security/ir.model.access.csv',
+ 'security/mrp_procurement_security.xml',
+ 'mrp_procurement_data.xml',
+ 'wizard/make_procurement_view.xml',
+ 'wizard/mrp_procurement_view.xml',
+ 'wizard/orderpoint_procurement_view.xml',
+ 'mrp_procurement_view.xml',
+ 'wizard/schedulers_all_view.xml',
+ 'mrp_procurement_workflow.xml',
+ 'process/procurement_process.xml',
+ "company_view.xml",
+ ],
+# 'demo_xml': [],
+ 'installable': True,
+ 'active': False,
+ 'certificate': '',
+}
+# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
diff --git a/addons/mrp_procurement/company.py b/addons/mrp_procurement/company.py
new file mode 100644
index 00000000000..ce39ca9a684
--- /dev/null
+++ b/addons/mrp_procurement/company.py
@@ -0,0 +1,38 @@
+# -*- coding: utf-8 -*-
+##############################################################################
+#
+# OpenERP, Open Source Management Solution
+# Copyright (C) 2004-2010 Tiny SPRL ().
+#
+# This program is free software: you can redistribute it and/or modify
+# it under the terms of the GNU Affero General Public License as
+# published by the Free Software Foundation, either version 3 of the
+# License, or (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU Affero General Public License for more details.
+#
+# You should have received a copy of the GNU Affero General Public License
+# along with this program. If not, see .
+#
+##############################################################################
+
+from osv import osv,fields
+
+class company(osv.osv):
+ _inherit = 'res.company'
+ _columns = {
+ 'schedule_range': fields.float('Scheduler Range', required=True,
+ help="This is the time frame analysed by the scheduler when "\
+ "computing procurements. All procurements that are not between "\
+ "today and today+range are skipped for futur computation."),
+ }
+ _defaults = {
+ 'schedule_range': lambda *a: 80.0,
+ }
+company()
+
+
+# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
diff --git a/addons/mrp_procurement/company_view.xml b/addons/mrp_procurement/company_view.xml
new file mode 100644
index 00000000000..543e36fe02f
--- /dev/null
+++ b/addons/mrp_procurement/company_view.xml
@@ -0,0 +1,19 @@
+
+
+
+
+
+ res.company.mrp.config
+ res.company
+ form
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/addons/mrp_procurement/mrp_procurement.py b/addons/mrp_procurement/mrp_procurement.py
new file mode 100644
index 00000000000..bd5b223779f
--- /dev/null
+++ b/addons/mrp_procurement/mrp_procurement.py
@@ -0,0 +1,527 @@
+# -*- coding: utf-8 -*-
+##############################################################################
+#
+# OpenERP, Open Source Management Solution
+# Copyright (C) 2004-2010 Tiny SPRL ().
+#
+# This program is free software: you can redistribute it and/or modify
+# it under the terms of the GNU Affero General Public License as
+# published by the Free Software Foundation, either version 3 of the
+# License, or (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU Affero General Public License for more details.
+#
+# You should have received a copy of the GNU Affero General Public License
+# along with this program. If not, see .
+#
+##############################################################################
+
+from mx import DateTime
+from osv import osv, fields
+from tools.translate import _
+import netsvc
+import time
+
+
+class mrp_property_group(osv.osv):
+ """
+ Group of mrp properties.
+ """
+ _name = 'mrp.property.group'
+ _description = 'Property Group'
+ _columns = {
+ 'name': fields.char('Property Group', size=64, required=True),
+ 'description': fields.text('Description'),
+ }
+mrp_property_group()
+
+class mrp_property(osv.osv):
+ """
+ Properties of mrp.
+ """
+ _name = 'mrp.property'
+ _description = 'Property'
+ _columns = {
+ 'name': fields.char('Name', size=64, required=True),
+ 'composition': fields.selection([('min','min'),('max','max'),('plus','plus')], 'Properties composition', required=True, help="Not used in computations, for information purpose only."),
+ 'group_id': fields.many2one('mrp.property.group', 'Property Group', required=True),
+ 'description': fields.text('Description'),
+ }
+ _defaults = {
+ 'composition': lambda *a: 'min',
+ }
+mrp_property()
+
+# ------------------------------------------------------------------
+# Procurement
+# ------------------------------------------------------------------
+#
+# Produce, Buy or Find products and place a move
+# then wizard for picking lists & move
+#
+class mrp_procurement(osv.osv):
+ """
+ Procurement Orders
+ """
+ _name = "mrp.procurement"
+ _description = "Procurement"
+ _order = 'priority,date_planned'
+
+ _columns = {
+ 'name': fields.char('Reason', size=64, required=True, help='Procurement name.'),
+ 'origin': fields.char('Source Document', size=64,
+ help="Reference of the document that created this Procurement.\n"
+ "This is automatically completed by Open ERP."),
+ 'priority': fields.selection([('0','Not urgent'),('1','Normal'),('2','Urgent'),('3','Very Urgent')], 'Priority', required=True),
+ 'date_planned': fields.datetime('Scheduled date', required=True),
+ 'date_close': fields.datetime('Date Closed'),
+ 'product_id': fields.many2one('product.product', 'Product', required=True, states={'draft':[('readonly',False)]}, readonly=True),
+ 'product_qty': fields.float('Quantity', required=True, states={'draft':[('readonly',False)]}, readonly=True),
+ 'product_uom': fields.many2one('product.uom', 'Product UoM', required=True, states={'draft':[('readonly',False)]}, readonly=True),
+ 'product_uos_qty': fields.float('UoS Quantity', states={'draft':[('readonly',False)]}, readonly=True),
+ 'product_uos': fields.many2one('product.uom', 'Product UoS', states={'draft':[('readonly',False)]}, readonly=True),
+ 'move_id': fields.many2one('stock.move', 'Reservation', ondelete='set null'),
+ 'close_move': fields.boolean('Close Move at end', required=True),
+ 'location_id': fields.many2one('stock.location', 'Location', required=True, states={'draft':[('readonly',False)]}, readonly=True),
+ 'procure_method': fields.selection([('make_to_stock','from stock'),('make_to_order','on order')], 'Procurement Method', states={'draft':[('readonly',False)], 'confirmed':[('readonly',False)]},
+ readonly=True, required=True, help="If you encode manually a Procurement, you probably want to use" \
+ " a make to order method."),
+
+ 'note': fields.text('Note'),
+
+ 'property_ids': fields.many2many('mrp.property', 'mrp_procurement_property_rel', 'procurement_id','property_id', 'Properties'),
+
+ 'message': fields.char('Latest error', size=64, help="Exception occurred while computing procurement orders."),
+ 'state': fields.selection([
+ ('draft','Draft'),
+ ('confirmed','Confirmed'),
+ ('exception','Exception'),
+ ('running','Running'),
+ ('cancel','Cancel'),
+ ('ready','Ready'),
+ ('done','Done'),
+ ('waiting','Waiting')], 'State', required=True,
+ help='When a procurement is created the state is set to \'Draft\'.\n If the procurement is confirmed, the state is set to \'Confirmed\'.\
+ \nAfter confirming the state is set to \'Running\'.\n If any exception arises in the order then the state is set to \'Exception\'.\n Once the exception is removed the state becomes \'Ready\'.\n It is in \'Waiting\'. state when the procurement is waiting for another one to finish.'),
+ 'note': fields.text('Note'),
+ 'company_id': fields.many2one('res.company','Company',required=True),
+ }
+ _defaults = {
+ 'state': lambda *a: 'draft',
+ 'priority': lambda *a: '1',
+ 'date_planned': lambda *a: time.strftime('%Y-%m-%d %H:%M:%S'),
+ 'close_move': lambda *a: 0,
+ 'procure_method': lambda *a: 'make_to_order',
+ 'company_id': lambda self, cr, uid, c: self.pool.get('res.company')._company_default_get(cr, uid, 'mrp.procurement', context=c)
+ }
+
+ def unlink(self, cr, uid, ids, context=None):
+ procurements = self.read(cr, uid, ids, ['state'])
+ unlink_ids = []
+ for s in procurements:
+ if s['state'] in ['draft','cancel']:
+ unlink_ids.append(s['id'])
+ else:
+ raise osv.except_osv(_('Invalid action !'), _('Cannot delete Procurement Order(s) which are in %s State!' % s['state']))
+ return osv.osv.unlink(self, cr, uid, unlink_ids, context=context)
+
+ def onchange_product_id(self, cr, uid, ids, product_id, context={}):
+ """ Finds UoM and UoS of changed product.
+ @param product_id: Changed id of product.
+ @return: Dictionary of values.
+ """
+ if product_id:
+ w = self.pool.get('product.product').browse(cr, uid, product_id, context)
+ v = {
+ 'product_uom': w.uom_id.id,
+ 'product_uos': w.uos_id and w.uos_id.id or w.uom_id.id
+ }
+ return {'value': v}
+ return {}
+
+ def check_product(self, cr, uid, ids):
+ """ Checks product type.
+ @return: True or False
+ """
+ for procurement in self.browse(cr, uid, ids):
+ if procurement.product_id.type in ('product', 'consu'):
+ return True
+ return False
+
+ def check_move_cancel(self, cr, uid, ids, context={}):
+ """ Checks if move is cancelled or not.
+ @return: True or False.
+ """
+ res = True
+ ok = False
+ for procurement in self.browse(cr, uid, ids, context):
+ if procurement.move_id:
+ ok = True
+ if not procurement.move_id.state == 'cancel':
+ res = False
+ return res and ok
+
+ def check_move_done(self, cr, uid, ids, context={}):
+ """ Checks if move is done or not.
+ @return: True or False.
+ """
+ res = True
+ for proc in self.browse(cr, uid, ids, context):
+ if proc.move_id:
+ if not proc.move_id.state == 'done':
+ res = False
+ return res
+
+ #
+ # This method may be overrided by objects that override mrp.procurment
+ # for computing their own purpose
+ #
+ def _quantity_compute_get(self, cr, uid, proc, context={}):
+ """ Finds sold quantity of product.
+ @param proc: Current procurement.
+ @return: Quantity or False.
+ """
+ if proc.product_id.type == 'product':
+ if proc.move_id.product_uos:
+ return proc.move_id.product_uos_qty
+ return False
+
+ def _uom_compute_get(self, cr, uid, proc, context={}):
+ """ Finds UoS if product is Stockable Product.
+ @param proc: Current procurement.
+ @return: UoS or False.
+ """
+ if proc.product_id.type == 'product':
+ if proc.move_id.product_uos:
+ return proc.move_id.product_uos.id
+ return False
+
+ #
+ # Return the quantity of product shipped/produced/served, wich may be
+ # different from the planned quantity
+ #
+ def quantity_get(self, cr, uid, id, context={}):
+ """ Finds quantity of product used in procurement.
+ @return: Quantity of product.
+ """
+ proc = self.browse(cr, uid, id, context)
+ result = self._quantity_compute_get(cr, uid, proc, context)
+ if not result:
+ result = proc.product_qty
+ return result
+
+ def uom_get(self, cr, uid, id, context=None):
+ """ Finds UoM of product used in procurement.
+ @return: UoM of product.
+ """
+ proc = self.browse(cr, uid, id, context)
+ result = self._uom_compute_get(cr, uid, proc, context)
+ if not result:
+ result = proc.product_uom.id
+ return result
+
+ def check_waiting(self, cr, uid, ids, context=[]):
+ """ Checks state of move.
+ @return: True or False
+ """
+ for procurement in self.browse(cr, uid, ids, context=context):
+ if procurement.move_id and procurement.move_id.state == 'auto':
+ return True
+ return False
+
+ def check_produce_service(self, cr, uid, procurement, context=[]):
+ return True
+
+ def check_produce_product(self, cr, uid, procurement, context=[]):
+ """ Finds BoM of a product if not found writes exception message.
+ @param procurement: Current procurement.
+ @return: True or False.
+ """
+ return True
+
+ def check_make_to_stock(self, cr, uid, ids, context={}):
+ """ Checks product type.
+ @return: True or False
+ """
+ ok = True
+ for procurement in self.browse(cr, uid, ids, context=context):
+ if procurement.product_id.type == 'service':
+ ok = ok and self._check_make_to_stock_service(cr, uid, procurement, context)
+ else:
+ ok = ok and self._check_make_to_stock_product(cr, uid, procurement, context)
+ return ok
+
+ def check_produce(self, cr, uid, ids, context={}):
+ """ Checks product type.
+ @return: True or Product Id.
+ """
+ res = True
+ user = self.pool.get('res.users').browse(cr, uid, uid)
+ for procurement in self.browse(cr, uid, ids):
+ if procurement.product_id.product_tmpl_id.supply_method <> 'produce':
+ if procurement.product_id.seller_ids:
+ partner = procurement.product_id.seller_ids[0].name
+ if user.company_id and user.company_id.partner_id:
+ if partner.id == user.company_id.partner_id.id:
+ return True
+ return False
+ if procurement.product_id.product_tmpl_id.type=='service':
+ res = res and self.check_produce_service(cr, uid, procurement, context)
+ else:
+ res = res and self.check_produce_product(cr, uid, procurement, context)
+ if not res:
+ return False
+ return res
+
+ def check_buy(self, cr, uid, ids):
+ """ Checks product type.
+ @return: True or Product Id.
+ """
+ user = self.pool.get('res.users').browse(cr, uid, uid)
+ partner_obj = self.pool.get('res.partner')
+ for procurement in self.browse(cr, uid, ids):
+ if procurement.product_id.product_tmpl_id.supply_method <> 'buy':
+ return False
+ if not procurement.product_id.seller_ids:
+ cr.execute('update mrp_procurement set message=%s where id=%s', (_('No supplier defined for this product !'), procurement.id))
+ return False
+ partner = procurement.product_id.seller_ids[0].name
+ if user.company_id and user.company_id.partner_id:
+ if partner.id == user.company_id.partner_id.id:
+ return False
+ address_id = partner_obj.address_get(cr, uid, [partner.id], ['delivery'])['delivery']
+ if not address_id:
+ cr.execute('update mrp_procurement set message=%s where id=%s', (_('No address defined for the supplier'), procurement.id))
+ return False
+ return True
+
+ def test_cancel(self, cr, uid, ids):
+ """ Tests whether state of move is cancelled or not.
+ @return: True or False
+ """
+ for record in self.browse(cr, uid, ids):
+ if record.move_id and record.move_id.state == 'cancel':
+ return True
+ return False
+
+ def action_confirm(self, cr, uid, ids, context={}):
+ """ Confirms procurement and writes exception message if any.
+ @return: True
+ """
+ move_obj = self.pool.get('stock.move')
+ for procurement in self.browse(cr, uid, ids):
+ if procurement.product_qty <= 0.00:
+ raise osv.except_osv(_('Data Insufficient !'), _('Please check the Quantity of Procurement Order(s), it should not be less than 1!'))
+ if procurement.product_id.type in ('product', 'consu'):
+ if not procurement.move_id:
+ source = procurement.location_id.id
+ if procurement.procure_method == 'make_to_order':
+ source = procurement.product_id.product_tmpl_id.property_stock_procurement.id
+ id = move_obj.create(cr, uid, {
+ 'name': 'PROC:' + procurement.name,
+ 'location_id': source,
+ 'location_dest_id': procurement.location_id.id,
+ 'product_id': procurement.product_id.id,
+ 'product_qty': procurement.product_qty,
+ 'product_uom': procurement.product_uom.id,
+ 'date_planned': procurement.date_planned,
+ 'state': 'confirmed',
+ 'company_id': procurement.company_id.id,
+ })
+ self.write(cr, uid, [procurement.id], {'move_id': id, 'close_move': 1})
+ else:
+ # TODO: check this
+ if procurement.procure_method == 'make_to_stock' and procurement.move_id.state in ('waiting',):
+ id = move_obj.write(cr, uid, [procurement.move_id.id], {'state':'confirmed'})
+ self.write(cr, uid, ids, {'state': 'confirmed', 'message': ''})
+ return True
+
+ def action_move_assigned(self, cr, uid, ids, context={}):
+ """ Changes procurement state to Running and writes message.
+ @return: True
+ """
+ self.write(cr, uid, ids, {'state': 'running', 'message': _('from stock: products assigned.')})
+ return True
+
+ def _check_make_to_stock_service(self, cr, uid, procurement, context={}):
+ return True
+
+ def _check_make_to_stock_product(self, cr, uid, procurement, context={}):
+ """ Checks procurement move state.
+ @param procurement: Current procurement.
+ @return: True or move id.
+ """
+ ok = True
+ if procurement.move_id:
+ id = procurement.move_id.id
+ if not (procurement.move_id.state in ('done','assigned','cancel')):
+ ok = ok and self.pool.get('stock.move').action_assign(cr, uid, [id])
+ cr.execute('select count(id) from stock_warehouse_orderpoint where product_id=%s', (procurement.product_id.id,))
+ if not cr.fetchone()[0]:
+ cr.execute('update mrp_procurement set message=%s where id=%s', (_('from stock and no minimum orderpoint rule defined'), procurement.id))
+ return ok
+
+ def action_produce_assign_service(self, cr, uid, ids, context={}):
+ """ Changes procurement state to Running.
+ @return: True
+ """
+ for procurement in self.browse(cr, uid, ids):
+ self.write(cr, uid, [procurement.id], {'state': 'running'})
+ return True
+
+ def action_produce_assign_product(self, cr, uid, ids, context={}):
+ """ This is action which call from workflow to assign production order to procurements
+ @return: True
+ """
+ return 0
+
+
+ def action_po_assign(self, cr, uid, ids, context={}):
+ """ This is action which call from workflow to assign purchase order to procurements
+ @return: True
+ """
+ return 0
+
+ def action_cancel(self, cr, uid, ids):
+ """ Cancels procurement and writes move state to Assigned.
+ @return: True
+ """
+ todo = []
+ todo2 = []
+ move_obj = self.pool.get('stock.move')
+ for proc in self.browse(cr, uid, ids):
+ if proc.close_move:
+ if proc.move_id.state not in ('done', 'cancel'):
+ todo2.append(proc.move_id.id)
+ else:
+ if proc.move_id and proc.move_id.state == 'waiting':
+ todo.append(proc.move_id.id)
+ if len(todo2):
+ move_obj.action_cancel(cr, uid, todo2)
+ if len(todo):
+ move_obj.write(cr, uid, todo, {'state': 'assigned'})
+ self.write(cr, uid, ids, {'state': 'cancel'})
+ wf_service = netsvc.LocalService("workflow")
+ for id in ids:
+ wf_service.trg_trigger(uid, 'mrp.procurement', id, cr)
+ return True
+
+ def action_check_finnished(self, cr, uid, ids):
+ return self.check_move_done(cr, uid, ids)
+
+ def action_check(self, cr, uid, ids):
+ """ Checks procurement move state whether assigned or done.
+ @return: True
+ """
+ ok = False
+ for procurement in self.browse(cr, uid, ids):
+ if procurement.move_id.state == 'assigned' or procurement.move_id.state == 'done':
+ self.action_done(cr, uid, [procurement.id])
+ ok = True
+ return ok
+
+ def action_ready(self, cr, uid, ids):
+ """ Changes procurement state to Ready.
+ @return: True
+ """
+ res = self.write(cr, uid, ids, {'state': 'ready'})
+ return res
+
+ def action_done(self, cr, uid, ids):
+ """ Changes procurement state to Done and writes Closed date.
+ @return: True
+ """
+ move_obj = self.pool.get('stock.move')
+ for procurement in self.browse(cr, uid, ids):
+ if procurement.move_id:
+ if procurement.close_move and (procurement.move_id.state <> 'done'):
+ move_obj.action_done(cr, uid, [procurement.move_id.id])
+ res = self.write(cr, uid, ids, {'state': 'done', 'date_close': time.strftime('%Y-%m-%d')})
+ wf_service = netsvc.LocalService("workflow")
+ for id in ids:
+ wf_service.trg_trigger(uid, 'mrp.procurement', id, cr)
+ return res
+
+ def run_scheduler(self, cr, uid, automatic=False, use_new_cursor=False, context=None):
+ ''' Runs through scheduler.
+ @param use_new_cursor: False or the dbname
+ '''
+ if not context:
+ context={}
+ self._procure_confirm(cr, uid, use_new_cursor=use_new_cursor, context=context)
+ self._procure_orderpoint_confirm(cr, uid, automatic=automatic,\
+ use_new_cursor=use_new_cursor, context=context)
+
+mrp_procurement()
+
+
+class stock_warehouse_orderpoint(osv.osv):
+ """
+ Defines Minimum stock rules.
+ """
+ _name = "stock.warehouse.orderpoint"
+ _description = "Orderpoint minimum rule"
+
+ _columns = {
+ 'name': fields.char('Name', size=32, required=True),
+ 'active': fields.boolean('Active', help="If the active field is set to true, it will allow you to hide the orderpoint without removing it."),
+ 'logic': fields.selection([('max','Order to Max'),('price','Best price (not yet active!)')], 'Reordering Mode', required=True),
+ 'warehouse_id': fields.many2one('stock.warehouse', 'Warehouse', required=True),
+ 'location_id': fields.many2one('stock.location', 'Location', required=True),
+ 'product_id': fields.many2one('product.product', 'Product', required=True, ondelete='cascade', domain=[('type','=','product')]),
+ 'product_uom': fields.many2one('product.uom', 'Product UOM', required=True ),
+ 'product_min_qty': fields.float('Min Quantity', required=True,
+ help="When the virtual stock goes belong the Min Quantity, Open ERP generates "\
+ "a procurement to bring the virtual stock to the Max Quantity."),
+ 'product_max_qty': fields.float('Max Quantity', required=True,
+ help="When the virtual stock goes belong the Min Quantity, Open ERP generates "\
+ "a procurement to bring the virtual stock to the Max Quantity."),
+ 'qty_multiple': fields.integer('Qty Multiple', required=True,
+ help="The procurement quantity will by rounded up to this multiple."),
+ 'procurement_id': fields.many2one('mrp.procurement', 'Latest procurement'),
+ 'company_id': fields.many2one('res.company','Company',required=True),
+ }
+ _defaults = {
+ 'active': lambda *a: 1,
+ 'logic': lambda *a: 'max',
+ 'qty_multiple': lambda *a: 1,
+ 'name': lambda x,y,z,c: x.pool.get('ir.sequence').get(y,z,'mrp.warehouse.orderpoint') or '',
+ 'product_uom': lambda sel, cr, uid, context: context.get('product_uom', False),
+ 'company_id': lambda self, cr, uid, c: self.pool.get('res.company')._company_default_get(cr, uid, 'stock.warehouse.orderpoint', context=c)
+ }
+
+ def onchange_warehouse_id(self, cr, uid, ids, warehouse_id, context={}):
+ """ Finds location id for changed warehouse.
+ @param warehouse_id: Changed id of warehouse.
+ @return: Dictionary of values.
+ """
+ if warehouse_id:
+ w = self.pool.get('stock.warehouse').browse(cr, uid, warehouse_id, context)
+ v = {'location_id': w.lot_stock_id.id}
+ return {'value': v}
+ return {}
+
+ def onchange_product_id(self, cr, uid, ids, product_id, context={}):
+ """ Finds UoM for changed product.
+ @param product_id: Changed id of product.
+ @return: Dictionary of values.
+ """
+ if product_id:
+ prod = self.pool.get('product.product').browse(cr,uid,product_id)
+ v = {'product_uom': prod.uom_id.id}
+ return {'value': v}
+ return {}
+
+ def copy(self, cr, uid, id, default=None,context={}):
+ if not default:
+ default = {}
+ default.update({
+ 'name': self.pool.get('ir.sequence').get(cr, uid, 'mrp.warehouse.orderpoint') or '',
+ })
+ return super(stock_warehouse_orderpoint, self).copy(cr, uid, id, default, context)
+
+stock_warehouse_orderpoint()
+# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
diff --git a/addons/mrp_procurement/mrp_procurement_data.xml b/addons/mrp_procurement/mrp_procurement_data.xml
new file mode 100644
index 00000000000..256472bd2fd
--- /dev/null
+++ b/addons/mrp_procurement/mrp_procurement_data.xml
@@ -0,0 +1,19 @@
+
+
+
+
+
+ Run mrp scheduler
+
+
+ 1
+ days
+ -1
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/addons/mrp_procurement/mrp_procurement_view.xml b/addons/mrp_procurement/mrp_procurement_view.xml
new file mode 100644
index 00000000000..84b47ee516d
--- /dev/null
+++ b/addons/mrp_procurement/mrp_procurement_view.xml
@@ -0,0 +1,251 @@
+
+
+
+
+
+
+ mrp.procurement.tree
+ mrp.procurement
+ tree
+
+
+
+
+
+
+
+
+
+
+
+
+
+ mrp.procurement.form
+ mrp.procurement
+ form
+
+
+
+
+
+
+ Minimum Stock Rules
+ stock.warehouse.orderpoint
+ ir.actions.act_window
+ form
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/addons/mrp_procurement/mrp_procurement_workflow.xml b/addons/mrp_procurement/mrp_procurement_workflow.xml
new file mode 100644
index 00000000000..46c4a10fffc
--- /dev/null
+++ b/addons/mrp_procurement/mrp_procurement_workflow.xml
@@ -0,0 +1,196 @@
+
+
+
+
+
+
+
+ mrp.procurement.basic
+ mrp.procurement
+ True
+
+
+
+
+ True
+ draft
+
+
+
+ cancel
+ function
+ action_cancel()
+ True
+
+
+
+ confirm
+ function
+ action_confirm()
+
+
+
+ confirm_wait
+ function
+ write({'state':'exception'})
+
+
+
+ confirm_mts
+
+
+
+ confirm_mto
+
+
+
+ make_to_stock
+ function
+ action_move_assigned()
+
+
+
+
+
+
+
+
+
+
+
+
+
+ ready
+ function
+ action_ready()
+
+
+
+ wait_done
+ function
+ write({'state':'waiting'})
+
+
+
+
+ True
+ done
+ function
+ action_done()
+
+
+
+
+
+ button_confirm
+
+
+
+
+ button_wait_done
+ True
+
+
+
+
+ check_move_done()
+ stock.move
+ [move_id.id]
+
+
+
+
+
+ button_check
+ test_cancel()
+
+
+
+
+ button_check
+ not test_cancel()
+
+
+
+
+ procure_method=='make_to_order'
+
+
+
+
+ procure_method=='make_to_stock'
+
+
+
+
+ button_cancel
+
+
+
+
+ button_cancel
+
+
+
+
+ button_restart
+
+
+
+
+ button_cancel
+
+
+
+
+ button_restart
+
+
+
+
+ button_cancel
+
+
+
+
+ check_make_to_stock()
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ True
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ action_check_finnished()
+
+
+
+
+ check_move_cancel()
+
+
+
+
diff --git a/addons/mrp_procurement/process/procurement_process.xml b/addons/mrp_procurement/process/procurement_process.xml
new file mode 100644
index 00000000000..21f953c6a6f
--- /dev/null
+++ b/addons/mrp_procurement/process/procurement_process.xml
@@ -0,0 +1,21 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/addons/mrp/schedulers.py b/addons/mrp_procurement/schedulers.py
similarity index 99%
rename from addons/mrp/schedulers.py
rename to addons/mrp_procurement/schedulers.py
index cc482d95c52..7a89723e5ca 100644
--- a/addons/mrp/schedulers.py
+++ b/addons/mrp_procurement/schedulers.py
@@ -238,4 +238,5 @@ class mrp_procurement(osv.osv):
cr.close()
return {}
mrp_procurement()
+
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
diff --git a/addons/mrp/scripts/scheduler.py b/addons/mrp_procurement/scripts/scheduler.py
similarity index 100%
rename from addons/mrp/scripts/scheduler.py
rename to addons/mrp_procurement/scripts/scheduler.py
diff --git a/addons/mrp_procurement/security/ir.model.access.csv b/addons/mrp_procurement/security/ir.model.access.csv
new file mode 100644
index 00000000000..ce022a730b0
--- /dev/null
+++ b/addons/mrp_procurement/security/ir.model.access.csv
@@ -0,0 +1,9 @@
+"id","name","model_id:id","group_id:id","perm_read","perm_write","perm_create","perm_unlink"
+"access_mrp_property_group","mrp.property.group","model_mrp_property_group",,1,0,0,0
+"access_mrp_property","mrp.property","model_mrp_property",,1,0,0,0
+"access_mrp_procurement","mrp.procurement","model_mrp_procurement",,1,0,0,0
+"access_stock_warehouse_orderpoint","stock.warehouse.orderpoint","model_stock_warehouse_orderpoint",,1,0,0,0
+"access_mrp_procurement_compute_all","mrp.procurement.compute.all","model_mrp_procurement_compute_all",,1,0,0,0
+"access_mrp_procurement_orderpoint_compute","mrp.procurement.orderpoint.compute","model_mrp_procurement_orderpoint_compute",,1,0,0,0
+"access_mrp_make_procurement","make.procurement","model_make_procurement",,1,0,0,0
+"access_mrp_make_procurement","mrp.procurement.compute","model_mrp_procurement_compute",,1,0,0,0
diff --git a/addons/mrp_procurement/security/mrp_procurement_security.xml b/addons/mrp_procurement/security/mrp_procurement_security.xml
new file mode 100644
index 00000000000..a0f2ef431bf
--- /dev/null
+++ b/addons/mrp_procurement/security/mrp_procurement_security.xml
@@ -0,0 +1,20 @@
+
+
+
+
+
+ mrp_procurement multi-company
+
+
+ ['|',('company_id','child_of',[user.company_id.id]),('company_id','=',False)]
+
+
+
+ stock_warehouse.orderpoint multi-company
+
+
+ ['|',('company_id','child_of',[user.company_id.id]),('company_id','=',False)]
+
+
+
+
\ No newline at end of file
diff --git a/addons/mrp_procurement/wizard/__init__.py b/addons/mrp_procurement/wizard/__init__.py
new file mode 100644
index 00000000000..ae70ffbf941
--- /dev/null
+++ b/addons/mrp_procurement/wizard/__init__.py
@@ -0,0 +1,27 @@
+# -*- coding: utf-8 -*-
+##############################################################################
+#
+# OpenERP, Open Source Management Solution
+# Copyright (C) 2004-2010 Tiny SPRL ().
+#
+# This program is free software: you can redistribute it and/or modify
+# it under the terms of the GNU Affero General Public License as
+# published by the Free Software Foundation, either version 3 of the
+# License, or (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU Affero General Public License for more details.
+#
+# You should have received a copy of the GNU Affero General Public License
+# along with this program. If not, see .
+#
+##############################################################################
+
+import orderpoint_procurement
+import mrp_procurement
+import schedulers_all
+import make_procurement_product
+
+# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
diff --git a/addons/mrp/wizard/make_procurement_product.py b/addons/mrp_procurement/wizard/make_procurement_product.py
similarity index 96%
rename from addons/mrp/wizard/make_procurement_product.py
rename to addons/mrp_procurement/wizard/make_procurement_product.py
index a2dd62327bb..96f00b89eb4 100644
--- a/addons/mrp/wizard/make_procurement_product.py
+++ b/addons/mrp_procurement/wizard/make_procurement_product.py
@@ -83,8 +83,8 @@ class make_procurement(osv.osv_memory):
wf_service.trg_validate(uid, 'mrp.procurement', procure_id, 'button_confirm', cr)
- id2 = data_obj._get_id(cr, uid, 'mrp', 'mrp_procurement_tree_view')
- id3 = data_obj._get_id(cr, uid, 'mrp', 'mrp_procurement_form_view')
+ id2 = data_obj._get_id(cr, uid, 'mrp_procurement', 'mrp_procurement_tree_view')
+ id3 = data_obj._get_id(cr, uid, 'mrp_procurement', 'mrp_procurement_form_view')
if id2:
id2 = data_obj.browse(cr, uid, id2, context=context).res_id
diff --git a/addons/mrp/wizard/make_procurement_view.xml b/addons/mrp_procurement/wizard/make_procurement_view.xml
similarity index 95%
rename from addons/mrp/wizard/make_procurement_view.xml
rename to addons/mrp_procurement/wizard/make_procurement_view.xml
index c60f2818ab2..e98f1c013a0 100644
--- a/addons/mrp/wizard/make_procurement_view.xml
+++ b/addons/mrp_procurement/wizard/make_procurement_view.xml
@@ -33,7 +33,8 @@
view_mode="form"
target="new"
key2="client_action_multi"
- id="act_make_procurement"/>
+ id="act_make_procurement"
+ groups="base.group_extended"/>
diff --git a/addons/mrp/wizard/mrp_procurement.py b/addons/mrp_procurement/wizard/mrp_procurement.py
similarity index 100%
rename from addons/mrp/wizard/mrp_procurement.py
rename to addons/mrp_procurement/wizard/mrp_procurement.py
diff --git a/addons/mrp/wizard/mrp_procurement_view.xml b/addons/mrp_procurement/wizard/mrp_procurement_view.xml
similarity index 100%
rename from addons/mrp/wizard/mrp_procurement_view.xml
rename to addons/mrp_procurement/wizard/mrp_procurement_view.xml
diff --git a/addons/mrp/wizard/orderpoint_procurement.py b/addons/mrp_procurement/wizard/orderpoint_procurement.py
similarity index 100%
rename from addons/mrp/wizard/orderpoint_procurement.py
rename to addons/mrp_procurement/wizard/orderpoint_procurement.py
diff --git a/addons/mrp/wizard/orderpoint_procurement_view.xml b/addons/mrp_procurement/wizard/orderpoint_procurement_view.xml
similarity index 100%
rename from addons/mrp/wizard/orderpoint_procurement_view.xml
rename to addons/mrp_procurement/wizard/orderpoint_procurement_view.xml
diff --git a/addons/mrp/wizard/schedulers_all.py b/addons/mrp_procurement/wizard/schedulers_all.py
similarity index 100%
rename from addons/mrp/wizard/schedulers_all.py
rename to addons/mrp_procurement/wizard/schedulers_all.py
diff --git a/addons/mrp/wizard/schedulers_all_view.xml b/addons/mrp_procurement/wizard/schedulers_all_view.xml
similarity index 84%
rename from addons/mrp/wizard/schedulers_all_view.xml
rename to addons/mrp_procurement/wizard/schedulers_all_view.xml
index b8b465e03e9..33861287278 100644
--- a/addons/mrp/wizard/schedulers_all_view.xml
+++ b/addons/mrp_procurement/wizard/schedulers_all_view.xml
@@ -30,8 +30,5 @@
key2="client_action_multi"
id="action_compute_schedulers"/>
-
-
-
diff --git a/addons/mrp_repair/mrp_repair_view.xml b/addons/mrp_repair/mrp_repair_view.xml
index 9f629ad8a46..667e9763827 100644
--- a/addons/mrp_repair/mrp_repair_view.xml
+++ b/addons/mrp_repair/mrp_repair_view.xml
@@ -115,7 +115,7 @@
-
+
diff --git a/addons/mrp_repair/wizard/cancel_repair.py b/addons/mrp_repair/wizard/cancel_repair.py
index 371b7ba82e3..ecc88ef6aae 100644
--- a/addons/mrp_repair/wizard/cancel_repair.py
+++ b/addons/mrp_repair/wizard/cancel_repair.py
@@ -57,23 +57,24 @@ class repair_cancel(osv.osv_memory):
@param context: A standard dictionary
@return: New arch of view.
"""
- record_id = context and context.get('active_id', False) or False
res = super(repair_cancel, self).fields_view_get(cr, uid, view_id=view_id, view_type=view_type, context=context, toolbar=toolbar,submenu=False)
- if record_id:
- try:
- repair_order = self.pool.get('mrp.repair').browse(cr, uid, record_id)
- if not repair_order.invoiced:
- res['arch'] = """
-
-
-
-
-
-
-
- """
- except:
- return res
+ record_id = context and context.get('active_id', False) or False
+ active_model = context.get('active_model')
+
+ if not record_id or (active_model and active_model != 'mrp.repair'):
+ return res
+
+ repair_order = self.pool.get('mrp.repair').browse(cr, uid, record_id)
+ if not repair_order.invoiced:
+ res['arch'] = """
+
+
+
+
+
+
+
+ """
return res
repair_cancel()
diff --git a/addons/multi_company/i18n/et.po b/addons/multi_company/i18n/et.po
index 43847a0c724..960a121dbda 100644
--- a/addons/multi_company/i18n/et.po
+++ b/addons/multi_company/i18n/et.po
@@ -8,13 +8,13 @@ msgstr ""
"Project-Id-Version: openobject-addons\n"
"Report-Msgid-Bugs-To: FULL NAME \n"
"POT-Creation-Date: 2009-12-08 11:46+0000\n"
-"PO-Revision-Date: 2010-01-26 11:01+0000\n"
-"Last-Translator: FULL NAME \n"
+"PO-Revision-Date: 2010-05-07 15:09+0000\n"
+"Last-Translator: lyyser \n"
"Language-Team: Estonian \n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
-"X-Launchpad-Export-Date: 2010-04-17 04:21+0000\n"
+"X-Launchpad-Export-Date: 2010-05-08 04:05+0000\n"
"X-Generator: Launchpad (build Unknown)\n"
#. module: multi_company
@@ -27,22 +27,24 @@ msgstr ""
msgid ""
"The Object name must start with x_ and not contain any special character !"
msgstr ""
+"Objekti nimi peab algama x_'ga ja ei tohi sisaldada ühtegi erisümbolit !"
#. module: multi_company
#: constraint:product.template:0
msgid ""
"Error: The default UOM and the purchase UOM must be in the same category."
msgstr ""
+"Viga: vaikimisi mõõtühik ja ostu mõõtühik peavad olema samast kategooriast."
#. module: multi_company
#: constraint:res.partner:0
msgid "The VAT doesn't seem to be correct."
-msgstr ""
+msgstr "Käibemaksukohuslase numbris on viga"
#. module: multi_company
#: constraint:ir.actions.act_window:0
msgid "Invalid model name in the action definition."
-msgstr ""
+msgstr "Vigane mudeli nimi toimingu definitsioonis."
#. module: multi_company
#: model:res.company,overdue_msg:multi_company.res_company_odoo
@@ -64,7 +66,7 @@ msgstr ""
#. module: multi_company
#: field:multi_company.default,object_id:0
msgid "Object"
-msgstr ""
+msgstr "Objekt"
#. module: multi_company
#: model:ir.module.module,shortdesc:multi_company.module_meta_information
@@ -83,12 +85,12 @@ msgstr ""
#. module: multi_company
#: field:multi_company.default,company_id:0
msgid "Main Company"
-msgstr ""
+msgstr "Emaettevõte"
#. module: multi_company
#: view:multi_company.default:0
msgid "Condition"
-msgstr ""
+msgstr "Tingimus"
#. module: multi_company
#: help:multi_company.default,company_dest_id:0
@@ -98,17 +100,17 @@ msgstr ""
#. module: multi_company
#: constraint:ir.ui.view:0
msgid "Invalid XML for View Architecture!"
-msgstr ""
+msgstr "Vigane XML vaate arhitektuurile!"
#. module: multi_company
#: field:multi_company.default,name:0
msgid "Name"
-msgstr ""
+msgstr "Nimi"
#. module: multi_company
#: constraint:product.template:0
msgid "Error: UOS must be in a different category than the UOM"
-msgstr ""
+msgstr "Viga: TÜ kategooria peab erinema MÜ kategooriast"
#. module: multi_company
#: model:product.category,name:multi_company.Odoo1
@@ -118,7 +120,7 @@ msgstr ""
#. module: multi_company
#: constraint:res.company:0
msgid "Error! You can not create recursive companies."
-msgstr ""
+msgstr "Viga! Sa ei saa luua rekursiivseid ettevõtteid."
#. module: multi_company
#: help:multi_company.default,name:0
@@ -148,7 +150,7 @@ msgstr ""
#. module: multi_company
#: field:multi_company.default,expression:0
msgid "Expression"
-msgstr ""
+msgstr "Avaldis"
#. module: multi_company
#: model:product.template,name:multi_company.product_product_odoo1_product_template
@@ -158,17 +160,17 @@ msgstr ""
#. module: multi_company
#: field:multi_company.default,sequence:0
msgid "Sequence"
-msgstr ""
+msgstr "Tsükkel"
#. module: multi_company
#: constraint:product.category:0
msgid "Error ! You can not create recursive categories."
-msgstr ""
+msgstr "Viga! Sa ei saa luua rekursiivseid kategooriaid."
#. module: multi_company
#: constraint:product.product:0
msgid "Error: Invalid ean code"
-msgstr ""
+msgstr "Viga: Vigane EAN kood"
#. module: multi_company
#: help:multi_company.default,expression:0
@@ -184,9 +186,9 @@ msgstr ""
#: code:addons/multi_company/multi_company.py:0
#, python-format
msgid " (copy)"
-msgstr ""
+msgstr " (koopia)"
#. module: multi_company
#: view:multi_company.default:0
msgid "Matching"
-msgstr ""
+msgstr "Sobitamine"
diff --git a/addons/multi_company/multi_company_demo.xml b/addons/multi_company/multi_company_demo.xml
index 592e63d5ed2..a56b596f7e1 100644
--- a/addons/multi_company/multi_company_demo.xml
+++ b/addons/multi_company/multi_company_demo.xml
@@ -64,6 +64,7 @@
OpenERP Editoreditor_demo
+
@@ -71,6 +72,7 @@
OpenERP Salesman USsales_demo_us
+
@@ -78,6 +80,7 @@
OpenERP Salesman BEsales_demo_be
+
@@ -85,6 +88,7 @@
OpenERP Salesman INsales_demo_in
+
@@ -92,6 +96,7 @@
Odooodoo_demo
+
diff --git a/addons/olap/i18n/et.po b/addons/olap/i18n/et.po
new file mode 100644
index 00000000000..eb09fd894ba
--- /dev/null
+++ b/addons/olap/i18n/et.po
@@ -0,0 +1,1400 @@
+# Estonian translation for openobject-addons
+# Copyright (c) 2010 Rosetta Contributors and Canonical Ltd 2010
+# This file is distributed under the same license as the openobject-addons package.
+# FIRST AUTHOR , 2010.
+#
+msgid ""
+msgstr ""
+"Project-Id-Version: openobject-addons\n"
+"Report-Msgid-Bugs-To: FULL NAME \n"
+"POT-Creation-Date: 2009-11-26 05:24+0000\n"
+"PO-Revision-Date: 2010-05-07 10:06+0000\n"
+"Last-Translator: lyyser \n"
+"Language-Team: Estonian \n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+"X-Launchpad-Export-Date: 2010-05-08 04:05+0000\n"
+"X-Generator: Launchpad (build Unknown)\n"
+
+#. module: olap
+#: view:olap.database.columns:0
+#: view:olap.database.tables:0
+msgid "Hide"
+msgstr "Peida"
+
+#. module: olap
+#: model:ir.actions.act_window,name:olap.action_olap_saved_query_form
+#: model:ir.ui.menu,name:olap.menu_action_olap_saved_query_form
+#: view:olap.saved.query:0
+msgid "Olap Saved Query"
+msgstr ""
+
+#. module: olap
+#: field:olap.query.logs,time:0
+#: field:olap.saved.query,time:0
+msgid "Time"
+msgstr "Aeg"
+
+#. module: olap
+#: view:bi.auto.configure.wizard:0
+msgid "Auto Configure Structure"
+msgstr ""
+
+#. module: olap
+#: view:olap.fact.database:0
+msgid "Olap fact database"
+msgstr ""
+
+#. module: olap
+#: help:olap.measure,value_sql:0
+msgid ""
+"You can provide valid sql expression. Make sure it have function with fully "
+"qualified column name like (sum,avg ...)(tablename.columnname (+,- ...) "
+"tablename.columnname)"
+msgstr ""
+
+#. module: olap
+#: field:olap.cube.table,schema_id:0
+msgid "Schema id"
+msgstr ""
+
+#. module: olap
+#: field:olap.schema,database_id:0
+msgid "Database Connection"
+msgstr "Andmebaasiühendus"
+
+#. module: olap
+#: selection:olap.fact.database,type:0
+msgid "MySQL"
+msgstr "MySQL"
+
+#. module: olap
+#: field:olap.fact.database,db_password:0
+msgid "Database password"
+msgstr "Andmebaasi parool"
+
+#. module: olap
+#: view:olap.database.tables:0
+msgid "Olap database tables"
+msgstr ""
+
+#. module: olap
+#: view:olap.fact.database:0
+msgid "Connection url"
+msgstr ""
+
+#. module: olap
+#: view:olap.application.table:0
+msgid "Olap Application Table"
+msgstr ""
+
+#. module: olap
+#: field:olap.parameters.config.wizard,host_name:0
+msgid "Server Name"
+msgstr "Serveri nimi"
+
+#. module: olap
+#: help:olap.fact.database,db_password:0
+msgid "Password for the login."
+msgstr "Salasõna logimiseks"
+
+#. module: olap
+#: field:olap.application.field,application_id:0
+#: field:olap.application.table,application_id:0
+msgid "Application Id"
+msgstr ""
+
+#. module: olap
+#: model:ir.actions.todo,note:olap.config_auto_directory
+msgid "This wizard will configure the URL of the web client"
+msgstr ""
+
+#. module: olap
+#: model:ir.actions.act_window,name:olap.action_view_olap_fact_database_form
+#: model:ir.ui.menu,name:olap.menu_bi_conf_fact
+msgid "Fact Databases"
+msgstr ""
+
+#. module: olap
+#: model:ir.ui.menu,name:olap.menu_browser_url
+msgid "Cube Browser"
+msgstr ""
+
+#. module: olap
+#: model:ir.ui.menu,name:olap.menu_action_olap_dimension_form
+msgid "Olap Dimension"
+msgstr ""
+
+#. module: olap
+#: model:ir.model,name:olap.model_olap_database_columns
+msgid "Olap Database Columns"
+msgstr ""
+
+#. module: olap
+#: view:olap.parameters.config.wizard:0
+msgid "BI Web Client."
+msgstr ""
+
+#. module: olap
+#: help:olap.fact.database,db_port:0
+msgid " Port to be used in connection"
+msgstr ""
+
+#. module: olap
+#: field:olap.database.columns,primary_key:0
+msgid "Primary Key"
+msgstr "Primaarvõti"
+
+#. module: olap
+#: field:olap.database.columns,table_id:0
+msgid "Table Id"
+msgstr ""
+
+#. module: olap
+#: view:olap.parameters.config.wizard:0
+msgid "This wizard will automatically configure the web client for BI."
+msgstr ""
+
+#. module: olap
+#: field:olap.fact.database,type:0
+msgid "Database type"
+msgstr "Andmebaasi tüüp"
+
+#. module: olap
+#: wizard_view:olap.query_builder,back:0
+#: wizard_view:olap.query_builder,init:0
+msgid "Cube Fetcher"
+msgstr ""
+
+#. module: olap
+#: wizard_view:olap.load.table,info:0
+#: wizard_view:olap.load.table,ok:0
+msgid "Your database structure has been correctly loaded"
+msgstr "Teie andmebaasi struktuuri on õigesti laetud"
+
+#. module: olap
+#: model:ir.model,name:olap.model_olap_parameters_config_wizard
+msgid "Olap Server Parameters"
+msgstr ""
+
+#. module: olap
+#: model:ir.actions.act_window,name:olap.action_olap_cube_table_form
+msgid "Olap Cube Tables"
+msgstr ""
+
+#. module: olap
+#: field:olap.measure,formatstring:0
+msgid "Format string"
+msgstr ""
+
+#. module: olap
+#: wizard_button:olap.query_builder,exec,exec:0
+#: wizard_button:olap.query_builder,ok,exec:0
+msgid "Execute"
+msgstr ""
+
+#. module: olap
+#: wizard_button:olap.application.configuration,configure,end:0
+#: wizard_button:olap.fact.database.test_connection,init,end:0
+#: wizard_button:olap.load.table,info,end:0
+#: wizard_button:olap.query.logs.clear,info,end:0
+#: wizard_button:olap.query.logs.clear,ok,end:0
+#: view:olap.warehouse.wizard:0
+msgid "Ok"
+msgstr ""
+
+#. module: olap
+#: model:ir.ui.menu,name:olap.menu_bi_conf_known_application
+msgid "Known Application"
+msgstr ""
+
+#. module: olap
+#: wizard_field:olap.query_builder,exec,level:0
+#: wizard_field:olap.query_builder,ok,level:0
+msgid "Level"
+msgstr ""
+
+#. module: olap
+#: field:olap.level,column_id_name:0
+#: field:olap.measure,value_column_id_name:0
+msgid "Column ID"
+msgstr ""
+
+#. module: olap
+#: view:bi.load.db.wizard:0
+msgid ""
+"We will load the complete structure of the database by introspection, so "
+"that you will be able to work on it, and specify a better structure "
+"according to your reporting needs."
+msgstr ""
+
+#. module: olap
+#: model:ir.actions.act_window,name:olap.action_view_olap_application_form
+msgid "Olap Applicatiion"
+msgstr ""
+
+#. module: olap
+#: field:olap.saved.query,name:0
+msgid "Query Name"
+msgstr ""
+
+#. module: olap
+#: wizard_field:olap.query_builder,exec,mdx_query:0
+#: wizard_field:olap.query_builder,ok,mdx_query:0
+msgid "MDX Query"
+msgstr ""
+
+#. module: olap
+#: model:ir.model,name:olap.model_bi_auto_configure_wizard
+msgid "bi.auto.configure.wizard"
+msgstr ""
+
+#. module: olap
+#: field:olap.hierarchy,primary_key:0
+msgid "Primary key"
+msgstr "Primaarvõti"
+
+#. module: olap
+#: model:ir.actions.act_window,name:olap.act_bi_auto_configure
+msgid "Auto Configuration"
+msgstr ""
+
+#. module: olap
+#: field:olap.schema,note:0
+msgid "Schema description"
+msgstr ""
+
+#. module: olap
+#: model:ir.actions.act_window,name:olap.act_bi_load_db_wizard
+msgid "Load database Structure"
+msgstr ""
+
+#. module: olap
+#: model:ir.model,name:olap.model_olap_level
+#: view:olap.level:0
+msgid "Olap level"
+msgstr ""
+
+#. module: olap
+#: selection:olap.measure,formatstring:0
+msgid "None (0000.00)"
+msgstr ""
+
+#. module: olap
+#: field:olap.fact.database,db_host:0
+msgid "Database host"
+msgstr "Andmebaasi host"
+
+#. module: olap
+#: model:ir.model,name:olap.model_olap_fact_database
+msgid "Olap Fact Database"
+msgstr ""
+
+#. module: olap
+#: view:bi.auto.configure.wizard:0
+msgid "Auto Congifuring Tables"
+msgstr ""
+
+#. module: olap
+#: field:olap.application,name:0
+msgid "Application name"
+msgstr "Rakenduse nimi"
+
+#. module: olap
+#: field:olap.cube.table,column_link_id:0
+msgid "Relational Column"
+msgstr ""
+
+#. module: olap
+#: field:olap.level,type:0
+msgid "Level class"
+msgstr ""
+
+#. module: olap
+#: field:olap.cube,name:0
+msgid "Cube name"
+msgstr ""
+
+#. module: olap
+#: model:ir.actions.act_window,name:olap.action_view_olap_application_table_form
+msgid "Olap Applicatiion Table"
+msgstr ""
+
+#. module: olap
+#: model:ir.model,name:olap.model_olap_saved_query
+msgid "olap.saved.query"
+msgstr ""
+
+#. module: olap
+#: field:olap.level,column_name:0
+msgid "Columns Name"
+msgstr ""
+
+#. module: olap
+#: model:ir.actions.act_window,name:olap.action_olap_hierarchy_form
+msgid "Olap Hierarchies"
+msgstr ""
+
+#. module: olap
+#: field:olap.schema,ready:0
+msgid "Ready"
+msgstr "Valmis"
+
+#. module: olap
+#: selection:olap.measure,measure_type:0
+#: field:olap.measure,value_column:0
+msgid "Fact Table Column"
+msgstr ""
+
+#. module: olap
+#: model:ir.ui.menu,name:olap.menu_view_olap_database_tables_form
+#: field:olap.application,table_ids:0
+#: view:olap.fact.database:0
+#: field:olap.fact.database,table_ids:0
+msgid "Tables"
+msgstr "Tabelid"
+
+#. module: olap
+#: model:ir.model,name:olap.model_olap_application
+msgid "Olap application"
+msgstr ""
+
+#. module: olap
+#: constraint:ir.actions.act_window:0
+msgid "Invalid model name in the action definition."
+msgstr "Vigane mudeli nimi toimingu definitsioonis."
+
+#. module: olap
+#: selection:olap.schema,state:0
+msgid "Schema is ready to use"
+msgstr "Skeem on kasutamiseks valmis"
+
+#. module: olap
+#: model:ir.ui.menu,name:olap.menu_designer_url
+msgid "Cube Designer"
+msgstr ""
+
+#. module: olap
+#: field:olap.fact.database,db_login:0
+msgid "Database login"
+msgstr ""
+
+#. module: olap
+#: model:ir.ui.menu,name:olap.menu_view_olap_application_table_form
+msgid "Application Table"
+msgstr "Rakenduse tabel"
+
+#. module: olap
+#: wizard_view:olap.query.logs.clear,info:0
+#: wizard_view:olap.query.logs.clear,ok:0
+msgid "Logs Cleared successfully"
+msgstr ""
+
+#. module: olap
+#: model:ir.model,name:olap.model_olap_schema
+#: model:ir.ui.menu,name:olap.menu_action_olap_schema_form
+#: view:olap.schema:0
+msgid "Olap Schema"
+msgstr ""
+
+#. module: olap
+#: model:ir.ui.menu,name:olap.menu_view_olap_application_form
+msgid "Application"
+msgstr "Rakendus"
+
+#. module: olap
+#: wizard_field:olap.query_builder,exec,mdx_query_output:0
+#: wizard_field:olap.query_builder,ok,mdx_query_output:0
+msgid "MDX Query Output"
+msgstr ""
+
+#. module: olap
+#: field:olap.hierarchy,primary_key_table:0
+msgid "Primary key table"
+msgstr ""
+
+#. module: olap
+#: help:olap.measure,table_name:0
+msgid ""
+"The name of the table on which the column is defined. If False, take the "
+"table from the cube."
+msgstr ""
+
+#. module: olap
+#: view:olap.warehouse.wizard:0
+msgid "Warehouse"
+msgstr "Ladu"
+
+#. module: olap
+#: model:ir.actions.act_window,name:olap.action_olap_dimension_form
+msgid "Olap Dimensions"
+msgstr ""
+
+#. module: olap
+#: field:olap.query.logs,user_id:0
+msgid "Tiny ERP User"
+msgstr ""
+
+#. module: olap
+#: model:ir.actions.wizard,name:olap.bi_application_configuration
+msgid "Configure from Application"
+msgstr ""
+
+#. module: olap
+#: field:olap.fact.database,db_port:0
+msgid "Database port"
+msgstr "Andmebaasi port"
+
+#. module: olap
+#: help:olap.parameters.config.wizard,host_port:0
+msgid ""
+"Put the port for the server. Put 8080 if its not clear."
+msgstr ""
+
+#. module: olap
+#: selection:olap.schema,state:0
+msgid "The Structure is Loaded"
+msgstr ""
+
+#. module: olap
+#: field:olap.dimension,cube_id:0
+#: field:olap.measure,cube_id:0
+#: field:olap.query.logs,cube_id:0
+#: field:olap.saved.query,cube_id:0
+msgid "Cube"
+msgstr "Kuubik"
+
+#. module: olap
+#: field:olap.cube.table,available_table_ids:0
+msgid "Available Tables"
+msgstr ""
+
+#. module: olap
+#: view:olap.schema:0
+msgid "Configure Manually"
+msgstr ""
+
+#. module: olap
+#: field:olap.database.columns,related_to:0
+msgid "Related To"
+msgstr ""
+
+#. module: olap
+#: view:olap.database.columns:0
+#: view:olap.database.tables:0
+msgid "Olap database columns"
+msgstr ""
+
+#. module: olap
+#: field:olap.cube.table.line,field_id:0
+msgid "Link Field"
+msgstr ""
+
+#. module: olap
+#: view:olap.schema:0
+msgid "Mark as Configured"
+msgstr ""
+
+#. module: olap
+#: view:olap.application.field:0
+msgid "Olap Application Field"
+msgstr ""
+
+#. module: olap
+#: selection:olap.measure,formatstring:0
+msgid "Comma Seperator (0,000)"
+msgstr ""
+
+#. module: olap
+#: field:olap.measure,agregator:0
+msgid "Agregator"
+msgstr ""
+
+#. module: olap
+#: wizard_view:olap.application.configuration,configure:0
+msgid "Your database structure (Open ERP) has been sucessfully configured."
+msgstr ""
+
+#. module: olap
+#: model:ir.ui.menu,name:olap.menu_bi_configuration
+msgid "Configuration"
+msgstr "Seadistamine"
+
+#. module: olap
+#: constraint:ir.ui.view:0
+msgid "Invalid XML for View Architecture!"
+msgstr "Vigane XML vaate arhitektuurile!"
+
+#. module: olap
+#: help:olap.parameters.config.wizard,host_name:0
+msgid ""
+"Put here the server address or IP Put localhost if its not "
+"clear."
+msgstr ""
+
+#. module: olap
+#: view:olap.database.tables:0
+msgid "Database tables"
+msgstr ""
+
+#. module: olap
+#: view:olap.schema:0
+msgid "Reload Structure"
+msgstr ""
+
+#. module: olap
+#: wizard_view:olap.application.configuration,init:0
+msgid "This will Auto Configure Application"
+msgstr ""
+
+#. module: olap
+#: view:bi.load.db.wizard:0
+msgid "Load Data Structure"
+msgstr ""
+
+#. module: olap
+#: view:bi.auto.configure.wizard:0
+#: view:bi.load.db.wizard:0
+#: wizard_button:olap.application.configuration,init,end:0
+#: wizard_button:olap.load.table,init,end:0
+#: view:olap.parameters.config.wizard:0
+#: wizard_button:olap.query.logs.clear,init,end:0
+#: wizard_button:olap.query_builder,exec,end:0
+#: wizard_button:olap.query_builder,ok,end:0
+msgid "Cancel"
+msgstr "Katkesta"
+
+#. module: olap
+#: view:bi.load.db.wizard:0
+msgid ""
+"After having loaded the structure, you will be able to hide/show or rename "
+"tables and columns to simplify end-users interface. The following database "
+"will be loaded:"
+msgstr ""
+
+#. module: olap
+#: model:ir.actions.act_window,name:olap.action_olap_level_form
+#: model:ir.ui.menu,name:olap.menu_action_olap_level_form
+#: view:olap.level:0
+msgid "Olap Level"
+msgstr ""
+
+#. module: olap
+#: field:olap.fact.database,loaded:0
+msgid "Loaded"
+msgstr "Laaditud"
+
+#. module: olap
+#: help:olap.fact.database,db_name:0
+msgid "Name of the database to be used for analysis."
+msgstr ""
+
+#. module: olap
+#: help:olap.fact.database,db_login:0
+msgid "Login for the database name specified."
+msgstr ""
+
+#. module: olap
+#: field:olap.hierarchy,dimension_id:0
+#: wizard_field:olap.query_builder,exec,dimension:0
+#: wizard_field:olap.query_builder,ok,dimension:0
+msgid "Dimension"
+msgstr "Mõõtmed"
+
+#. module: olap
+#: model:ir.model,name:olap.model_olap_application_table
+msgid "Olap application table"
+msgstr ""
+
+#. module: olap
+#: wizard_view:olap.load.table,init:0
+msgid ""
+"We will load the complete structure of the database by introspection, "
+"so that you will be able to work on it, and specify a better structure "
+"according to your reporting needs."
+msgstr ""
+
+#. module: olap
+#: field:olap.saved.query,axis_keys:0
+msgid "Axis Keys"
+msgstr ""
+
+#. module: olap
+#: field:olap.cube,query_log:0
+msgid "Query Logging"
+msgstr ""
+
+#. module: olap
+#: field:olap.measure,measure_type:0
+msgid "Measure Type"
+msgstr "Mõõdu tüüp"
+
+#. module: olap
+#: field:olap.database.tables,fact_database_id:0
+msgid "Database Id"
+msgstr ""
+
+#. module: olap
+#: help:olap.fact.database,db_host:0
+msgid "Give hostname to make connection to the database."
+msgstr ""
+
+#. module: olap
+#: field:olap.level,hierarchy_id:0
+msgid "Hierarchy"
+msgstr "Hierarhia"
+
+#. module: olap
+#: selection:olap.schema,state:0
+msgid "The Structure is Configured."
+msgstr ""
+
+#. module: olap
+#: model:ir.actions.act_window,name:olap.action_olap_schema_form
+msgid "Olap Schemas"
+msgstr ""
+
+#. module: olap
+#: field:olap.cube,table_id:0
+msgid "Fact table"
+msgstr ""
+
+#. module: olap
+#: view:bi.auto.configure.wizard:0
+msgid ""
+"This will Auto Configure Application. This will help to increase the "
+"readability of the tables and columns by giving it meaningful and easy to "
+"comprehend name. You can hides particular data and columns by reconfiguring "
+"the structure option."
+msgstr ""
+
+#. module: olap
+#: model:ir.actions.act_window,name:olap.action_view_olap_application_field_form
+msgid "Olap Applicatiion Field"
+msgstr ""
+
+#. module: olap
+#: field:olap.query.logs,query:0
+#: field:olap.saved.query,query:0
+#: view:olap.warehouse.wizard:0
+#: field:olap.warehouse.wizard,query:0
+msgid "Query"
+msgstr "Päring"
+
+#. module: olap
+#: view:olap.schema:0
+msgid "Auto Application Configuration"
+msgstr ""
+
+#. module: olap
+#: selection:olap.measure,formatstring:0
+msgid "Postfix Default Currency(0000.00 EUR)"
+msgstr ""
+
+#. module: olap
+#: field:bi.load.db.wizard,db_name:0
+#: wizard_field:olap.load.table,init,db_name:0
+msgid "Database Name"
+msgstr "Andmebaasi nimi"
+
+#. module: olap
+#: field:olap.cube,measure_ids:0
+msgid "Measures"
+msgstr ""
+
+#. module: olap
+#: model:ir.actions.wizard,name:olap.bi_conf_cube_query_builder
+#: wizard_view:olap.query_builder,exec:0
+#: wizard_view:olap.query_builder,ok:0
+msgid "Query Builder"
+msgstr ""
+
+#. module: olap
+#: field:olap.cube,dimension_ids:0
+msgid "Dimensions"
+msgstr "Dimensioonid"
+
+#. module: olap
+#: model:ir.model,name:olap.model_olap_cube
+#: view:olap.cube:0
+msgid "Olap cube"
+msgstr ""
+
+#. module: olap
+#: model:ir.actions.act_window,name:olap.action_olap_warehouse
+#: model:ir.model,name:olap.model_olap_warehouse_wizard
+#: model:ir.ui.menu,name:olap.menu_bi_warehouse
+msgid "Olap Warehouse"
+msgstr ""
+
+#. module: olap
+#: model:ir.ui.menu,name:olap.menu_view_olap_application_field_form
+msgid "Application Field"
+msgstr "Rakenduse väli"
+
+#. module: olap
+#: model:ir.model,name:olap.model_olap_dimension
+#: view:olap.dimension:0
+msgid "Olap dimension"
+msgstr ""
+
+#. module: olap
+#: field:olap.application.field,name:0
+msgid "Application field name"
+msgstr "Rakkenduse välja nimi"
+
+#. module: olap
+#: view:olap.fact.database:0
+msgid "Connection parameters"
+msgstr ""
+
+#. module: olap
+#: field:bi.auto.configure.wizard,name:0
+#: field:bi.load.db.wizard,fact_table:0
+#: wizard_field:olap.load.table,init,fact_table:0
+msgid "Fact Name"
+msgstr ""
+
+#. module: olap
+#: view:olap.database.columns:0
+msgid "Database columns"
+msgstr ""
+
+#. module: olap
+#: field:olap.application.table,table_name:0
+#: field:olap.cube.table,name:0
+#: field:olap.level,table_name:0
+#: field:olap.measure,table_name:0
+msgid "Table name"
+msgstr ""
+
+#. module: olap
+#: help:olap.measure,measure_type:0
+msgid "Select between auto column or sql expression for the measures"
+msgstr ""
+
+#. module: olap
+#: model:ir.actions.wizard,name:olap.bi_load_column
+msgid "Open Columns"
+msgstr "Ava veerud"
+
+#. module: olap
+#: model:ir.ui.menu,name:olap.menu_view_olap_database_columns_form
+#: field:olap.database.tables,columns:0
+msgid "Columns"
+msgstr "Veerud"
+
+#. module: olap
+#: model:ir.actions.wizard,name:olap.bi_test_connection
+#: view:olap.fact.database:0
+msgid "Test Connection"
+msgstr "Testi ühendust"
+
+#. module: olap
+#: model:ir.actions.act_window,name:olap.action_olap_measure_form
+#: model:ir.ui.menu,name:olap.menu_action_olap_measure_form
+msgid "Olap Measures"
+msgstr ""
+
+#. module: olap
+#: wizard_button:olap.application.configuration,init,configure:0
+#: view:olap.parameters.config.wizard:0
+msgid "Configure"
+msgstr "Seadista"
+
+#. module: olap
+#: wizard_view:olap.load.table,init:0
+msgid ""
+"After having loaded the structure, you will be able to hide/show or "
+"rename tables and columns to simplify end-users interface. The following "
+"database will be loaded:"
+msgstr ""
+
+#. module: olap
+#: constraint:ir.model:0
+msgid ""
+"The Object name must start with x_ and not contain any special character !"
+msgstr ""
+"Objekti nimi peab algama x_'ga ja ei tohi sisaldada ühtegi erisümbolit !"
+
+#. module: olap
+#: wizard_field:olap.query_builder,exec,hierarchy:0
+#: wizard_field:olap.query_builder,ok,hierarchy:0
+msgid "Hiearchy"
+msgstr ""
+
+#. module: olap
+#: selection:olap.measure,measure_type:0
+#: field:olap.measure,value_sql:0
+msgid "SQL Expression"
+msgstr ""
+
+#. module: olap
+#: model:ir.actions.wizard,name:olap.bi_menu_olap_load_table
+msgid "Load Tables"
+msgstr ""
+
+#. module: olap
+#: field:olap.hierarchy,level_ids:0
+msgid "Levels"
+msgstr "Tasemed"
+
+#. module: olap
+#: model:ir.model,name:olap.model_olap_application_field
+msgid "Olap application field"
+msgstr ""
+
+#. module: olap
+#: model:ir.actions.act_window,name:olap.action_view_olap_database_columns_form
+msgid "Database Columns"
+msgstr ""
+
+#. module: olap
+#: field:olap.database.columns,active:0
+#: field:olap.database.tables,active:0
+msgid "Active"
+msgstr "Aktiivne"
+
+#. module: olap
+#: selection:olap.measure,datatype:0
+msgid "Integer"
+msgstr "Täisarv"
+
+#. module: olap
+#: wizard_view:olap.application.configuration,init:0
+msgid " Auto Configure "
+msgstr ""
+
+#. module: olap
+#: selection:olap.measure,agregator:0
+msgid "Sum"
+msgstr "Kokku"
+
+#. module: olap
+#: wizard_field:olap.query.logs.clear,init,user_name:0
+#: field:olap.saved.query,user_id:0
+msgid "User"
+msgstr "Kasutaja"
+
+#. module: olap
+#: field:olap.query.logs,count:0
+msgid "Count"
+msgstr "Arv"
+
+#. module: olap
+#: field:olap.database.tables,name:0
+msgid "End-User Name"
+msgstr ""
+
+#. module: olap
+#: selection:olap.measure,formatstring:0
+msgid "Postfix Default Currency with comma seperator (0,000.00 EUR)"
+msgstr ""
+
+#. module: olap
+#: field:olap.measure,datatype:0
+msgid "Datatype"
+msgstr "Andmetüüp"
+
+#. module: olap
+#: wizard_button:olap.query_builder,back,ok:0
+#: wizard_button:olap.query_builder,init,ok:0
+msgid "Fetch Data"
+msgstr ""
+
+#. module: olap
+#: selection:olap.measure,formatstring:0
+msgid "Prefix Default Currency with comma seperator (EUR 0,000.00)"
+msgstr ""
+
+#. module: olap
+#: wizard_view:olap.load.table,info:0
+#: wizard_view:olap.load.table,ok:0
+#: wizard_view:olap.query.logs.clear,info:0
+#: wizard_view:olap.query.logs.clear,ok:0
+msgid "Load Data"
+msgstr ""
+
+#. module: olap
+#: field:olap.cube,query_ids:0
+msgid "Queries"
+msgstr "Päringud"
+
+#. module: olap
+#: selection:olap.fact.database,type:0
+msgid "Oracle"
+msgstr ""
+
+#. module: olap
+#: model:ir.actions.act_window,name:olap.action_olap_cube_form
+#: model:ir.ui.menu,name:olap.menu_action_olap_cube_form
+#: model:ir.ui.menu,name:olap.menu_bi_conf_cubes
+msgid "Olap Cubes"
+msgstr ""
+
+#. module: olap
+#: model:ir.ui.menu,name:olap.menu_action_olap_cube_table_form
+msgid "Olap Cubes Table"
+msgstr ""
+
+#. module: olap
+#: field:olap.measure,name:0
+msgid "Measure name"
+msgstr ""
+
+#. module: olap
+#: selection:olap.fact.database,connection_type:0
+msgid "Socket"
+msgstr "Pesa"
+
+#. module: olap
+#: field:olap.fact.database,connection_type:0
+msgid "Connection type"
+msgstr "Ühenduse tüüp"
+
+#. module: olap
+#: selection:olap.measure,agregator:0
+msgid "count"
+msgstr ""
+
+#. module: olap
+#: field:olap.fact.database,db_name:0
+msgid "Database name"
+msgstr "Andmebaasi nimi"
+
+#. module: olap
+#: field:olap.database.columns,type:0
+msgid "Type"
+msgstr "Tüüp"
+
+#. module: olap
+#: view:olap.database.columns:0
+#: view:olap.database.tables:0
+msgid "Show"
+msgstr "Näita"
+
+#. module: olap
+#: wizard_button:olap.query_builder,exec,back:0
+#: wizard_button:olap.query_builder,ok,back:0
+msgid "Change cube"
+msgstr ""
+
+#. module: olap
+#: model:ir.actions.act_window,name:olap.action_view_olap_database_tables_form
+#: view:olap.cube.table:0
+#: field:olap.cube.table,line_ids:0
+msgid "Database Tables"
+msgstr ""
+
+#. module: olap
+#: help:olap.level,table_name:0
+msgid ""
+"The name of the table on which the column is defined. If False, take the "
+"table from the hierarchy."
+msgstr ""
+
+#. module: olap
+#: selection:olap.schema,state:0
+msgid "Nothing has been Configured"
+msgstr ""
+
+#. module: olap
+#: field:olap.dimension,name:0
+msgid "Dimension name"
+msgstr ""
+
+#. module: olap
+#: wizard_button:olap.load.table,ok,end:0
+msgid "Continue and Configure Structure"
+msgstr ""
+
+#. module: olap
+#: model:ir.model,name:olap.model_olap_measure
+#: view:olap.measure:0
+msgid "Olap measure"
+msgstr ""
+
+#. module: olap
+#: help:olap.cube,table_id:0
+msgid "Table(s) for cube."
+msgstr ""
+
+#. module: olap
+#: wizard_field:olap.query_builder,exec,measure:0
+#: wizard_field:olap.query_builder,ok,measure:0
+msgid "Measure"
+msgstr "Mõõda"
+
+#. module: olap
+#: field:olap.database.columns,column_db_name:0
+msgid "Column DBName"
+msgstr ""
+
+#. module: olap
+#: selection:olap.schema,state:0
+msgid "We Can Start building Cube"
+msgstr ""
+
+#. module: olap
+#: field:olap.cube.table.line,table_id:0
+msgid "Database Table"
+msgstr ""
+
+#. module: olap
+#: field:olap.schema,name:0
+msgid "Schema name"
+msgstr ""
+
+#. module: olap
+#: model:ir.actions.act_window,name:olap.action_olap_query_logs_my_form
+#: model:ir.ui.menu,name:olap.menu_action_olap_query_logs_my_form
+#: view:olap.query.logs:0
+msgid "My Logs"
+msgstr ""
+
+#. module: olap
+#: view:olap.fact.database:0
+msgid "Information"
+msgstr "Info"
+
+#. module: olap
+#: wizard_field:olap.query_builder,back,cube_schema:0
+#: wizard_field:olap.query_builder,init,cube_schema:0
+msgid "Select Cube"
+msgstr ""
+
+#. module: olap
+#: field:olap.hierarchy,table_id:0
+msgid "Fact table(s)"
+msgstr ""
+
+#. module: olap
+#: model:ir.actions.url,name:olap.menu_url_cube_designer
+msgid "name_menu_url_cube_designer"
+msgstr ""
+
+#. module: olap
+#: model:ir.actions.act_window,name:olap.action_config_bi_parameters
+msgid "Parameters Configuration"
+msgstr ""
+
+#. module: olap
+#: view:olap.schema:0
+msgid "Connect to Database"
+msgstr ""
+
+#. module: olap
+#: selection:olap.schema,state:0
+msgid "Database Connected"
+msgstr ""
+
+#. module: olap
+#: field:olap.application.field,table_name:0
+#: field:olap.application.table,name:0
+msgid "Application table name"
+msgstr ""
+
+#. module: olap
+#: help:olap.hierarchy,table_id:0
+msgid "Table(s) to make hierarchy on the cube."
+msgstr ""
+
+#. module: olap
+#: view:olap.fact.database:0
+msgid "General information"
+msgstr "Üldine info"
+
+#. module: olap
+#: field:olap.application,query:0
+msgid "Application Query"
+msgstr ""
+
+#. module: olap
+#: help:olap.cube,query_log:0
+msgid "Enabling this will log all the queries in the browser"
+msgstr ""
+
+#. module: olap
+#: field:olap.saved.query,mdx_id:0
+msgid "Module"
+msgstr "Moodul"
+
+#. module: olap
+#: field:olap.application.field,is_hidden:0
+#: field:olap.application.table,is_hidden:0
+#: field:olap.database.columns,hide:0
+#: field:olap.database.tables,hide:0
+msgid "Hidden"
+msgstr "Varjatud"
+
+#. module: olap
+#: field:olap.dimension,hierarchy_ids:0
+msgid "Hierarchies"
+msgstr ""
+
+#. module: olap
+#: field:olap.query.logs,result_size:0
+msgid "Result Size"
+msgstr ""
+
+#. module: olap
+#: view:olap.application:0
+msgid "Olap Application"
+msgstr ""
+
+#. module: olap
+#: model:ir.model,name:olap.model_olap_database_tables
+msgid "Olap Database Tables"
+msgstr ""
+
+#. module: olap
+#: selection:olap.measure,formatstring:0
+msgid "Prefix Default Currency (EUR 0000.00)"
+msgstr ""
+
+#. module: olap
+#: view:olap.cube.table:0
+msgid "Olap cube_table"
+msgstr ""
+
+#. module: olap
+#: view:olap.parameters.config.wizard:0
+msgid "Parameters Configure"
+msgstr ""
+
+#. module: olap
+#: model:ir.model,name:olap.model_olap_hierarchy
+#: view:olap.hierarchy:0
+msgid "Olap hierarchy"
+msgstr ""
+
+#. module: olap
+#: model:ir.model,name:olap.model_olap_cube_table
+#: model:ir.model,name:olap.model_olap_cube_table_line
+msgid "Olap cube table"
+msgstr ""
+
+#. module: olap
+#: field:olap.application.field,field_name:0
+msgid "Field name"
+msgstr "Välja nimi"
+
+#. module: olap
+#: model:ir.model,name:olap.model_olap_query_logs
+msgid "Olap query logs"
+msgstr ""
+
+#. module: olap
+#: field:olap.fact.database,name:0
+msgid "Fact name"
+msgstr ""
+
+#. module: olap
+#: help:olap.measure,formatstring:0
+msgid " Let you specify how the measure to be displayed in cube browser"
+msgstr ""
+
+#. module: olap
+#: model:ir.ui.menu,name:olap.menu_bi_server_parameters
+msgid "Server Parameters"
+msgstr ""
+
+#. module: olap
+#: wizard_view:olap.load.table,init:0
+#: wizard_button:olap.load.table,init,ok:0
+#: view:olap.schema:0
+msgid "Load Database Structure"
+msgstr ""
+
+#. module: olap
+#: field:olap.level,name:0
+msgid "Level name"
+msgstr ""
+
+#. module: olap
+#: field:olap.cube,schema_id:0
+#: field:olap.query.logs,schema_id:0
+#: field:olap.saved.query,schema_id:0
+msgid "Schema"
+msgstr "Skeem"
+
+#. module: olap
+#: field:olap.fact.database,connection_url:0
+#: field:olap.schema,app_detect:0
+msgid "Connection URL"
+msgstr ""
+
+#. module: olap
+#: field:olap.schema,cube_ids:0
+msgid "Cubes"
+msgstr "Kuubid"
+
+#. module: olap
+#: view:olap.schema:0
+msgid "ReConfigure Structure"
+msgstr ""
+
+#. module: olap
+#: field:olap.application,field_ids:0
+msgid "Fields"
+msgstr "Väljad"
+
+#. module: olap
+#: selection:olap.measure,agregator:0
+msgid "Average"
+msgstr "Keskmine"
+
+#. module: olap
+#: view:bi.load.db.wizard:0
+msgid "Load Database Tables"
+msgstr ""
+
+#. module: olap
+#: model:ir.ui.menu,name:olap.menu_action_olap_hierarchy_form
+msgid "Olap Hierarchy"
+msgstr ""
+
+#. module: olap
+#: field:olap.cube.table.line,cube_table_id:0
+msgid "Cube Table"
+msgstr ""
+
+#. module: olap
+#: model:ir.ui.menu,name:olap.menu_bi
+msgid "Businesss Intelligence"
+msgstr ""
+
+#. module: olap
+#: model:ir.model,name:olap.model_bi_load_db_wizard
+msgid "bi.load.db.wizard"
+msgstr ""
+
+#. module: olap
+#: model:ir.actions.url,name:olap.menu_url_cube_browser
+msgid "name_menu_url_cube_browser"
+msgstr ""
+
+#. module: olap
+#: model:ir.ui.menu,name:olap.menu_view_olap_fact_database_form
+msgid "Databases"
+msgstr "Andmebaasid"
+
+#. module: olap
+#: field:olap.hierarchy,name:0
+msgid "Hierarchy name"
+msgstr ""
+
+#. module: olap
+#: model:ir.module.module,description:olap.module_meta_information
+msgid ""
+"\n"
+" Base module to manage Olap schemas. Cube designer.\n"
+" "
+msgstr ""
+
+#. module: olap
+#: view:olap.cube.table:0
+msgid "Joined Tables"
+msgstr ""
+
+#. module: olap
+#: field:olap.schema,loaded:0
+msgid "Loading Datastructure"
+msgstr ""
+
+#. module: olap
+#: view:olap.cube.table:0
+msgid "Joined Table"
+msgstr ""
+
+#. module: olap
+#: selection:olap.fact.database,type:0
+msgid "PostgreSQL"
+msgstr ""
+
+#. module: olap
+#: wizard_view:olap.query.logs.clear,init:0
+msgid " To Load Data"
+msgstr ""
+
+#. module: olap
+#: field:olap.hierarchy,sequence:0
+#: field:olap.level,sequence:0
+msgid "Sequence"
+msgstr "Tsükkel"
+
+#. module: olap
+#: model:ir.ui.menu,name:olap.menu_bi_conf_tools
+msgid "Tools"
+msgstr "Tööriistad"
+
+#. module: olap
+#: field:olap.schema,state:0
+msgid "Schema State"
+msgstr ""
+
+#. module: olap
+#: selection:olap.measure,datatype:0
+msgid "Float"
+msgstr "Ujuvaks"
+
+#. module: olap
+#: model:ir.actions.act_window,name:olap.action_olap_query_logs_form
+#: model:ir.ui.menu,name:olap.menu_action_olap_query_logs_form
+#: view:olap.query.logs:0
+msgid "All Logs"
+msgstr ""
+
+#. module: olap
+#: selection:olap.fact.database,connection_type:0
+#: field:olap.parameters.config.wizard,host_port:0
+msgid "Port"
+msgstr "Port"
+
+#. module: olap
+#: view:olap.fact.database:0
+msgid "Fact database"
+msgstr ""
+
+#. module: olap
+#: model:ir.module.module,shortdesc:olap.module_meta_information
+msgid "olap"
+msgstr ""
+
+#. module: olap
+#: field:olap.database.columns,name:0
+msgid "Column Name"
+msgstr "Veeru nimi"
+
+#. module: olap
+#: field:olap.database.tables,table_db_name:0
+msgid "Table Name"
+msgstr ""
+
+#. module: olap
+#: wizard_view:olap.application.configuration,configure:0
+msgid "Auto Configure"
+msgstr "Automaatne seadistamine"
+
+#. module: olap
+#: field:olap.schema,configure:0
+msgid "Configuring Datastructure"
+msgstr ""
+
+#. module: olap
+#: model:ir.actions.wizard,name:olap.bi_load_configuration_table
+msgid "Open Configuration"
+msgstr ""
+
+#. module: olap
+#: view:olap.schema:0
+msgid "Configure Automatically "
+msgstr ""
+
+#. module: olap
+#: model:ir.actions.wizard,name:olap.bi_clear_logs
+#: model:ir.ui.menu,name:olap.menu_bi_clear_logs
+#: wizard_button:olap.query.logs.clear,init,ok:0
+msgid "Clear Logs"
+msgstr ""
diff --git a/addons/olap_extract/i18n/et.po b/addons/olap_extract/i18n/et.po
new file mode 100644
index 00000000000..8c1cc7cffa4
--- /dev/null
+++ b/addons/olap_extract/i18n/et.po
@@ -0,0 +1,56 @@
+# Estonian translation for openobject-addons
+# Copyright (c) 2010 Rosetta Contributors and Canonical Ltd 2010
+# This file is distributed under the same license as the openobject-addons package.
+# FIRST AUTHOR , 2010.
+#
+msgid ""
+msgstr ""
+"Project-Id-Version: openobject-addons\n"
+"Report-Msgid-Bugs-To: FULL NAME \n"
+"POT-Creation-Date: 2009-11-26 05:29+0000\n"
+"PO-Revision-Date: 2010-05-05 21:38+0000\n"
+"Last-Translator: lyyser \n"
+"Language-Team: Estonian \n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+"X-Launchpad-Export-Date: 2010-05-06 04:04+0000\n"
+"X-Generator: Launchpad (build Unknown)\n"
+
+#. module: olap_extract
+#: model:ir.module.module,shortdesc:olap_extract.module_meta_information
+msgid "olap_extract"
+msgstr ""
+
+#. module: olap_extract
+#: wizard_button:olap.extract.schema,init,ok:0
+msgid "OK"
+msgstr "OK"
+
+#. module: olap_extract
+#: model:ir.actions.wizard,name:olap_extract.bi_olap_extract_schema
+msgid "Olap Extract"
+msgstr ""
+
+#. module: olap_extract
+#: model:ir.module.module,description:olap_extract.module_meta_information
+msgid ""
+"\n"
+" Extracts the schema structure.\n"
+" "
+msgstr ""
+
+#. module: olap_extract
+#: wizard_field:olap.extract.schema,init,module_name:0
+msgid "Module Name"
+msgstr "Mooduli nimi"
+
+#. module: olap_extract
+#: wizard_button:olap.extract.schema,init,end:0
+msgid "Cancel"
+msgstr "Katkesta"
+
+#. module: olap_extract
+#: wizard_view:olap.extract.schema,init:0
+msgid "New Module Name"
+msgstr "Uus mooduli nimi"
diff --git a/addons/olap_sale/i18n/es.po b/addons/olap_sale/i18n/es.po
index 320a945f712..96e1c14f176 100644
--- a/addons/olap_sale/i18n/es.po
+++ b/addons/olap_sale/i18n/es.po
@@ -8,13 +8,13 @@ msgstr ""
"Project-Id-Version: openobject-addons\n"
"Report-Msgid-Bugs-To: FULL NAME \n"
"POT-Creation-Date: 2009-11-26 05:29+0000\n"
-"PO-Revision-Date: 2010-04-28 19:27+0000\n"
-"Last-Translator: Shay \n"
+"PO-Revision-Date: 2010-05-06 08:51+0000\n"
+"Last-Translator: Juan Miguel Boyero Corral \n"
"Language-Team: Spanish \n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
-"X-Launchpad-Export-Date: 2010-04-29 03:52+0000\n"
+"X-Launchpad-Export-Date: 2010-05-07 04:03+0000\n"
"X-Generator: Launchpad (build Unknown)\n"
#. module: olap_sale
@@ -31,4 +31,4 @@ msgstr ""
#. module: olap_sale
#: model:ir.module.module,shortdesc:olap_sale.module_meta_information
msgid "olap_sale"
-msgstr ""
+msgstr "olap_sale"
diff --git a/addons/partner_crm/__init__.py b/addons/partner_infotab/__init__.py
similarity index 97%
rename from addons/partner_crm/__init__.py
rename to addons/partner_infotab/__init__.py
index 4dd1f496527..a0a034ec9c5 100644
--- a/addons/partner_crm/__init__.py
+++ b/addons/partner_infotab/__init__.py
@@ -19,7 +19,7 @@
#
##############################################################################
-import partner_crm
+import partner_infotab
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
diff --git a/addons/partner_crm/__openerp__.py b/addons/partner_infotab/__openerp__.py
similarity index 94%
rename from addons/partner_crm/__openerp__.py
rename to addons/partner_infotab/__openerp__.py
index d5bc49b1e5c..db44ac70762 100644
--- a/addons/partner_crm/__openerp__.py
+++ b/addons/partner_infotab/__openerp__.py
@@ -21,7 +21,7 @@
{
- 'name': 'Detailed info on partner form',
+ 'name': 'Detailed information on partner form',
'version': '1.0',
'category': 'Generic Modules/Base',
'description': """
@@ -44,7 +44,7 @@ It adds the following fields on the partner form:
'init_xml': [],
'update_xml': [
'security/ir.model.access.csv',
- 'partner_crm_view.xml'
+ 'partner_infotab_view.xml'
],
'demo_xml': [],
'installable': True,
diff --git a/addons/partner_crm/partner_crm.py b/addons/partner_infotab/partner_infotab.py
similarity index 91%
rename from addons/partner_crm/partner_crm.py
rename to addons/partner_infotab/partner_infotab.py
index 2162f850115..f448919c2ea 100644
--- a/addons/partner_crm/partner_crm.py
+++ b/addons/partner_infotab/partner_infotab.py
@@ -33,6 +33,8 @@ class res_partner(osv.osv):
'invoice_ids': fields.one2many('account.invoice.line', 'partner_id', 'Invoices'),
'contract_ids': fields.one2many('account.analytic.account', \
'partner_id', 'Contracts'),
+ 'account_line_ids': fields.one2many('hr.analytic.timesheet', \
+ 'partner_id', 'Anaylitic account lines '),
}
res_partner()
diff --git a/addons/partner_crm/partner_crm_view.xml b/addons/partner_infotab/partner_infotab_view.xml
similarity index 61%
rename from addons/partner_crm/partner_crm_view.xml
rename to addons/partner_infotab/partner_infotab_view.xml
index ab75f5c58ed..8aabbb242e9 100644
--- a/addons/partner_crm/partner_crm_view.xml
+++ b/addons/partner_infotab/partner_infotab_view.xml
@@ -11,19 +11,19 @@
-
-
-
-
+
+
+
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
diff --git a/addons/partner_crm/security/ir.model.access.csv b/addons/partner_infotab/security/ir.model.access.csv
similarity index 100%
rename from addons/partner_crm/security/ir.model.access.csv
rename to addons/partner_infotab/security/ir.model.access.csv
diff --git a/addons/point_of_sale/__init__.py b/addons/point_of_sale/__init__.py
index 1a83d3f3b44..0baf4639019 100644
--- a/addons/point_of_sale/__init__.py
+++ b/addons/point_of_sale/__init__.py
@@ -21,11 +21,11 @@
##############################################################################
import pos
+import account_bank_statement
+import pos_account_bank_statement
import stock
import wizard
import report
-import pos_account_bank_statement
-import account_bank_statement
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
diff --git a/addons/point_of_sale/__openerp__.py b/addons/point_of_sale/__openerp__.py
index 95228bb044c..111702c2e74 100644
--- a/addons/point_of_sale/__openerp__.py
+++ b/addons/point_of_sale/__openerp__.py
@@ -37,7 +37,6 @@ Main features :
""",
'author': 'Tiny',
'depends': ['sale', 'delivery'],
-# 'depends': ['sale', 'purchase', 'account', 'account_tax_include','board','mrp','board_manufacturing','delivery','profile_manufacturing','account','multi_company'],
'init_xml': [],
'update_xml': [
@@ -63,8 +62,9 @@ Main features :
'wizard/pos_payment_report.xml',
'wizard/pos_payment.xml',
'wizard/pos_scan_product_view.xml',
+ 'wizard/pos_return_view.xml',
'pos_report.xml',
- 'pos_wizard.xml',
+ # 'pos_wizard.xml',
'pos_view.xml',
'pos_sequence.xml',
'posrule_data.xml',
@@ -73,7 +73,6 @@ Main features :
'statement_view.xml',
'statement_report.xml',
'statement_data.xml',
- 'statement_wizard.xml',
],
'demo_xml': ['pos_demo.xml','singer_statement_demo.xml','multi_company_stock_data.xml'],
'installable': True,
diff --git a/addons/point_of_sale/multi_company_demo.xml b/addons/point_of_sale/multi_company_demo.xml
index dfc59cc09c8..e0e58ad75d7 100644
--- a/addons/point_of_sale/multi_company_demo.xml
+++ b/addons/point_of_sale/multi_company_demo.xml
@@ -2,11 +2,10 @@
- Tiny Editor
+ OpenERP Editor
-
- Tiny Editor
+ OpenERP EditorFree Business Solutions
@@ -15,24 +14,19 @@
-
- Tiny Integrator
+ OpenERP Integrator
- Tiny Integrator
+ OpenERP IntegratorFree Business SolutionsWeb: http://tiny.be - Tel: (+32).81.81.37.00 - Bank: CPH 126-2013269-07IBAN: BE74 1262 0132 6907 - SWIFT: GKCCBEBB - VAT: BE0477.472.701
-
-
-
-
diff --git a/addons/point_of_sale/multi_company_stock_data.xml b/addons/point_of_sale/multi_company_stock_data.xml
index 539a27ff1a2..a74ea0a56e9 100644
--- a/addons/point_of_sale/multi_company_stock_data.xml
+++ b/addons/point_of_sale/multi_company_stock_data.xml
@@ -2,104 +2,6 @@
-
-
-
- property_product_pricelist
-
-
-
-
-
-
property_stock_account_output
diff --git a/addons/point_of_sale/pos.py b/addons/point_of_sale/pos.py
index c87efa486b3..ede0f7bd15c 100644
--- a/addons/point_of_sale/pos.py
+++ b/addons/point_of_sale/pos.py
@@ -28,7 +28,7 @@ from tools.translate import _
from decimal import Decimal
import tools
import re
-
+import decimal_precision as dp
class pos_config_journal(osv.osv):
@@ -43,40 +43,14 @@ class pos_config_journal(osv.osv):
}
pos_config_journal()
-
-class res_mode_contact(osv.osv):
-
- """ Contact mode for Partner """
-
- _name = "res.mode.contact"
- _description = "Contact mode"
-
- _columns={
- 'name': fields.char('Mode', size=64, select=1),
- 'active': fields.boolean('Active', select=2),
- }
-res_mode_contact()
-
-class contact_mode_partner(osv.osv):
-
-
- _inherit = 'res.partner'
- _columns = {
- 'contact_mode_id': fields.many2one('res.mode.contact','Contact Mode'),
- }
-contact_mode_partner()
-
-
class pos_company_discount(osv.osv):
""" Company Discount and Cashboxes """
_inherit = 'res.company'
_columns = {
- 'company_discount': fields.float('Max Discount(%)', digits=(16,2)),
- 'max_diff': fields.float('Max Difference for Cashboxes', digits=(16,2)),
- 'account_receivable': fields.many2one('account.account',
- 'Default Receivable', states={'draft': [('readonly', False)]}),
+ 'company_discount': fields.float('Max Discount(%)', digits_compute= dp.get_precision('Point Of Sale')),
+ 'max_diff': fields.float('Max Difference for Cashboxes', digits_compute= dp.get_precision('Point Of Sale Discount')),
}
pos_company_discount()
@@ -149,7 +123,7 @@ class pos_order(osv.osv):
tot =0.0
val=None
for order in self.browse(cr, uid, ids):
- cr.execute("select date_payment2 from pos_order where id=%d"%(order.id))
+ cr.execute("select date_payment from pos_order where id=%d"%(order.id))
date_p=cr.fetchone()
date_p=date_p and date_p[0] or None
if date_p:
@@ -176,7 +150,7 @@ class pos_order(osv.osv):
tot =0.0
val=None
for order in self.browse(cr, uid, ids):
- cr.execute("select date_payment from pos_order where id=%d"%(order.id))
+ cr.execute("select date_validation from pos_order where id=%d"%(order.id))
date_p=cr.fetchone()
date_p=date_p and date_p[0] or None
if date_p:
@@ -199,65 +173,35 @@ class pos_order(osv.osv):
res[order.id]=val
return res
- def _amount_tax(self, cr, uid, ids, field_name, arg, context):
-
- """ Calculates Taxes of order
- @return: Dictionary of values """
-
- res = {}
- tax_obj = self.pool.get('account.tax')
+ def _amount_all(self, cr, uid, ids, name, args, context=None):
+ tax_obj = self.pool.get('account.tax')
+ res={}
for order in self.browse(cr, uid, ids):
- val = 0.0
+ res[order.id] = {
+ 'amount_paid': 0.0,
+ 'amount_return':0.0,
+ 'amount_tax':0.0,
+ }
+ for payment in order.statement_ids:
+ res[order.id]['amount_paid'] += payment.amount
+ for payment in order.payments:
+ res[order.id]['amount_return'] += (payment.amount < 0 and payment.amount or 0)
for line in order.lines:
if order.price_type!='tax_excluded':
- val = reduce(lambda x, y: x+round(y['amount'], 2),
+ res[order.id]['amount_tax'] = reduce(lambda x, y: x+round(y['amount'], 2),
tax_obj.compute_inv(cr, uid, line.product_id.taxes_id,
line.price_unit * \
(1-(line.discount or 0.0)/100.0), line.qty),
- val)
+ res[order.id]['amount_tax'])
else:
- val = reduce(lambda x, y: x+round(y['amount'], 2),
+ res[order.id]['amount_tax'] = reduce(lambda x, y: x+round(y['amount'], 2),
tax_obj.compute(cr, uid, line.product_id.taxes_id,
line.price_unit * \
(1-(line.discount or 0.0)/100.0), line.qty),
- val)
-
- res[order.id] = val
+ res[order.id]['amount_tax'])
return res
-
- def _total_payment(self, cr, uid, ids, field_name, arg, context):
- """ Calculates Total payment of order
- @return: Dictionary of values """
-
- res = {}
- i=0
- for order in self.browse(cr, uid, ids):
- val = 0.0
- for payment in order.statement_ids:
- val += payment.amount
- res[order.id] = val
- return res
- return {order.id:val}
- def _total_return(self, cr, uid, ids, field_name, arg, context):
-
- """ Calculates Total Returned from the order
- @return: Dictionary of values """
-
- res = {}
- for order in self.browse(cr, uid, ids):
- val = 0.0
- for payment in order.payments:
- val += (payment.amount < 0 and payment.amount or 0)
- res[order.id] = val
- return res
-
-# def payment_get(self, cr, uid, ids, context=None):
-# """ Calculates Total Returned from the order
-# @return: Dictionary of values """
-# cr.execute("select id from pos_payment where order_id =ANY(%s)",(ids,))
-# return [i[0] for i in cr.fetchall()]
def _sale_journal_get(self, cr, uid, context):
@@ -279,13 +223,10 @@ class pos_order(osv.osv):
company = self.pool.get('res.users').browse(cr, uid, uid, context).company_id
res = self.pool.get('sale.shop').search(cr, uid, [])
- # res = self.pool.get('sale.shop').search(cr, uid, [('company_id', '=', company.id)])
if res:
return res[0]
else:
return False
-
-
def copy(self, cr, uid, id, default=None, context={}):
if not default:
@@ -342,16 +283,16 @@ class pos_order(osv.osv):
'shop_id': fields.many2one('sale.shop', 'Shop', required=True,
states={'draft': [('readonly', False)]}, readonly=True),
'date_order': fields.datetime('Date Ordered', readonly=True),
- 'date_payment': fields.function(_get_date_payment, method=True, string='Validation Date', type='date', store=True),
- 'date_payment2': fields.function(_get_date_payment2, method=True, string='Payment Date', type='date', store=True),
+ 'date_validation': fields.function(_get_date_payment, method=True, string='Validation Date', type='date', store=True),
+ 'date_payment': fields.function(_get_date_payment2, method=True, string='Payment Date', type='date', store=True),
'date_validity': fields.date('Validity Date', required=True),
'user_id': fields.many2one('res.users', 'Connected Salesman', readonly=True),
- 'user_id1': fields.many2one('res.users', 'Salesman', required=True),
- 'user_id2': fields.many2one('res.users', 'Salesman Manager'),
- 'amount_tax': fields.function(_amount_tax, method=True, string='Taxes'),
+ 'user_salesman_id': fields.many2one('res.users', 'Salesman', required=True),
+ 'sale_manager': fields.many2one('res.users', 'Salesman Manager'),
+ 'amount_tax': fields.function(_amount_all, method=True, string='Taxes',digits_compute=dp.get_precision('Point Of Sale'), multi='all'),
'amount_total': fields.function(_amount_total, method=True, string='Total'),
- 'amount_paid': fields.function(_total_payment, 'Paid', states={'draft': [('readonly', False)]}, readonly=True, method=True),
- 'amount_return': fields.function(_total_return, 'Returned', method=True),
+ 'amount_paid': fields.function(_amount_all, 'Paid', states={'draft': [('readonly', False)]}, readonly=True, method=True,digits_compute=dp.get_precision('Point Of Sale'), multi='all'),
+ 'amount_return': fields.function(_amount_all, 'Returned', method=True,digits_compute=dp.get_precision('Point Of Sale'), multi='all'),
'lines': fields.one2many('pos.order.line', 'order_id', 'Order Lines', states={'draft': [('readonly', False)]}, readonly=True),
'price_type': fields.selection([
('tax_excluded','Tax excluded')
@@ -371,19 +312,9 @@ class pos_order(osv.osv):
'first_name': fields.char('First Name', size=64),
'state_2': fields.function(_get_v,type='selection',selection=[('to_verify', 'To Verify'), ('accepted', 'Accepted'),
('refused', 'Refused')], string='State', readonly=True, method=True, store=True),
-
- # 'last_name': fields.char('Last Name', size=64),
- # 'street': fields.char('Street', size=64),
- # 'zip2': fields.char('Zip', size=64),
- # 'city': fields.char('City', size=64),
- # 'mobile': fields.char('Mobile', size=64),
- # 'email': fields.char('Email', size=64),
'note': fields.text('Internal Notes'),
'nb_print': fields.integer('Number of Print', readonly=True),
'sale_journal': fields.many2one('account.journal', 'Journal', required=True, states={'draft': [('readonly', False)]}, readonly=True, ),
- # 'account_receivable': fields.many2one('account.account',
- # 'Default Receivable', required=True, states={'draft': [('readonly', False)]},
- # readonly=True, ),
'invoice_wanted': fields.boolean('Create Invoice'),
'note_2': fields.char('Customer Note',size=64),
'type_rec': fields.char('Type of Receipt',size=64),
@@ -419,7 +350,7 @@ class pos_order(osv.osv):
_defaults = {
'user_id': lambda self, cr, uid, context: uid,
- 'user_id2': lambda self, cr, uid, context: uid,
+ 'sale_manager': lambda self, cr, uid, context: uid,
'state': lambda *a: 'draft',
'price_type': lambda *a: 'tax_excluded',
'state_2': lambda *a: 'to_verify',
@@ -565,12 +496,12 @@ class pos_order(osv.osv):
if line.product_id and line.product_id.type=='service':
continue
prop_ids = self.pool.get("ir.property").search(cr, uid, [('name', '=', 'property_stock_customer')])
- val = self.pool.get("ir.property").browse(cr, uid, prop_ids[0]).value
+ val = self.pool.get("ir.property").browse(cr, uid, prop_ids[0]).value_reference
cr.execute("select s.id from stock_location s, stock_warehouse w where w.lot_stock_id=s.id and w.id= %d "%(order.shop_id.warehouse_id.id))
res=cr.fetchone()
location_id=res and res[0] or None
# location_id = order and order.shop_id and order.shop_id.warehouse_id and order.shop_id.warehouse_id.lot_stock_id.id or None
- stock_dest_id = int(val.split(',')[1])
+ stock_dest_id = val.id
if line.qty < 0:
location_id, stock_dest_id = stock_dest_id, location_id
@@ -626,7 +557,7 @@ class pos_order(osv.osv):
def button_validate(self, cr, uid, ids, *args):
- """ Check the access for the sale order and update the date_payment
+ """ Check the access for the sale order and update the date_validation
@return: True
"""
res_obj = self.pool.get('res.company')
@@ -637,12 +568,12 @@ class pos_order(osv.osv):
if part_company:
raise osv.except_osv(_('Error'), _('You don\'t have enough access to validate this sale!'))
for order in self.browse(cr, uid, ids):
- if not order.date_payment:
+ if not order.date_validation:
cr.execute("select max(date) from account_bank_statement_line where pos_statement_id=%d"%(order.id))
val=cr.fetchone()
val=val and val[0] or None
if val:
- cr.execute("Update pos_order set date_payment='%s' where id = %d"%(val, order.id))
+ cr.execute("Update pos_order set date_validation='%s' where id = %d"%(val, order.id))
return True
@@ -679,7 +610,7 @@ class pos_order(osv.osv):
if 'payment_name' in data.keys():
args['name'] = data['payment_name'] + ' ' +order.name
account_def = self.pool.get('ir.property').get(cr, uid, 'property_account_receivable', 'res.partner', context=context)
- args['account_id'] = order.partner_id and order.partner_id.property_account_receivable and order.partner_id.property_account_receivable.id or account_def or curr_c.account_receivable.id
+ args['account_id'] = order.partner_id and order.partner_id.property_account_receivable and order.partner_id.property_account_receivable.id or account_def.id or curr_c.account_receivable.id
if data.get('is_acc',False):
args['is_acc']=data['is_acc']
args['account_id']= prod_obj.browse(cr,uid, data['product_id']).property_account_income and prod_obj.browse(cr,uid, data['product_id']).property_account_income.id
@@ -772,7 +703,7 @@ class pos_order(osv.osv):
inv_ids = []
for order in self.browse(cr, uid, ids, context):
- curr_c = order.user_id1.company_id
+ curr_c = order.user_salesman_id.company_id
if order.invoice_id:
inv_ids.append(order.invoice_id.id)
continue
@@ -780,9 +711,7 @@ class pos_order(osv.osv):
if not order.partner_id:
raise osv.except_osv(_('Error'), _('Please provide a partner for the sale.'))
- cr.execute('select a.id from account_account a, res_company p where p.account_receivable=a.id and p.id=%s', (curr_c.id, ))
- res=cr.fetchone()
- acc=res and res[0] or None
+ acc= order.partner_id.property_account_receivable.id
inv = {
'name': 'Invoice from POS: '+order.name,
'origin': order.name,
@@ -834,15 +763,17 @@ class pos_order(osv.osv):
account_move_line_obj = self.pool.get('account.move.line')
account_period_obj = self.pool.get('account.period')
account_tax_obj = self.pool.get('account.tax')
+ res_obj=self.pool.get('res.users')
+ property_obj=self.pool.get('ir.property')
period = account_period_obj.find(cr, uid, context=context)[0]
for order in self.browse(cr, uid, ids, context=context):
- curr_c = self.pool.get('res.users').browse(cr, uid, uid).company_id
- comp_id = self.pool.get('res.users').browse(cr, order.user_id.id, order.user_id.id).company_id
+ curr_c =res_obj.browse(cr, uid, uid).company_id
+ comp_id = res_obj.browse(cr, order.user_id.id, order.user_id.id).company_id
comp_id=comp_id and comp_id.id or False
to_reconcile = []
group_tax = {}
- account_def = self.pool.get('ir.property').get(cr, uid, 'property_account_receivable', 'res.partner', context=context)
+ account_def = property_obj.get(cr, uid, 'property_account_receivable', 'res.partner', context=context)
order_account = order.partner_id and order.partner_id.property_account_receivable and order.partner_id.property_account_receivable.id or account_def or curr_c.account_receivable.id
# Create an entry for the sale
@@ -1028,9 +959,8 @@ class pos_order(osv.osv):
'statement_id': False,
'account_id':order_account
})
- # account_move_obj.button_validate(cr, uid, [move_id, payment_move_id], context=context)
+
self.write(cr,uid,order.id,{'state':'done'})
- # account_move_line_obj.reconcile(cr, uid, to_reconcile, type='manual', context=context)
return True
def cancel_picking(self, cr, uid, ids, context=None):
@@ -1042,6 +972,7 @@ class pos_order(osv.osv):
def action_payment(self, cr, uid, ids, context=None):
vals = {'state': 'payment'}
+ sequence_obj=self.pool.get('ir.sequence')
for pos in self.browse(cr, uid, ids):
create_contract_nb = False
for line in pos.lines:
@@ -1049,8 +980,8 @@ class pos_order(osv.osv):
create_contract_nb = True
break
if create_contract_nb:
- seq = self.pool.get('ir.sequence').get(cr, uid, 'pos.user_%s' % pos.user_id1.login)
- vals['contract_number'] ='%s-%s' % (pos.user_id1.login, seq)
+ seq = sequence_obj.get(cr, uid, 'pos.user_%s' % pos.user_salesman_id.login)
+ vals['contract_number'] ='%s-%s' % (pos.user_salesman_id.login, seq)
self.write(cr, uid, ids, vals)
def action_paid(self, cr, uid, ids, context=None):
@@ -1071,7 +1002,6 @@ class pos_order(osv.osv):
for order in self.browse(cr, uid, ids, context=context):
if not order.journal_entry:
self.create_account_move(cr, uid, ids, context={})
- #self.write(cr, uid, ids, {'state': 'done'})
return True
def compute_state(self, cr, uid, id):
@@ -1145,7 +1075,6 @@ class pos_order_line(osv.osv):
price = self.price_by_product(cr, uid, ids, line.order_id.pricelist_id.id, line.product_id.id, line.qty, line.order_id.partner_id.id)
if line.discount!=0.0:
res[line.id] = line.price_unit * line.qty * (1 - (line.discount or 0.0) / 100.0)
-# res[line.id] = price * line.qty * (1 - (line.discount or 0.0) / 100.0)
else:
res[line.id]=line.price_unit*line.qty
return res
@@ -1181,7 +1110,7 @@ class pos_order_line(osv.osv):
disc=0.0
if (disc != 0.0 or prod_id) and price_f>0:
disc=100-(price/price_f*100)
- return {'value':{'discount':disc, 'price_unit':price_f}}#,'notice':''}}#, 'price_subtotal':(price_f*qty*(1-disc))}}
+ return {'value':{'discount':disc, 'price_unit':price_f}}
return {}
def onchange_ded(self, cr, uid,ids, val_ded,price_u,*a):
@@ -1218,11 +1147,9 @@ class pos_order_line(osv.osv):
'company_id':fields.many2one('res.company', 'Company', required=True),
'notice': fields.char('Discount Notice', size=128, required=True),
'serial_number': fields.char('Serial Number', size=128),
-# 'contract_number': fields.char('Contract Number', size=512),
'product_id': fields.many2one('product.product', 'Product', domain=[('sale_ok', '=', True)], required=True, change_default=True),
-# 'price_unit': fields.float('Unit Price'),
'price_unit': fields.function(_get_amount, method=True, string='Unit Price', store=True),
- 'price_ded': fields.float('Discount(Amount)'),
+ 'price_ded': fields.float('Discount(Amount)',digits_compute=dp.get_precision('Point Of Sale')),
'qty': fields.float('Quantity'),
'qty_rfd': fields.float('Refunded Quantity'),
'price_subtotal': fields.function(_amount_line, method=True, string='Subtotal w/o Tax'),
@@ -1283,7 +1210,7 @@ class pos_order_line(osv.osv):
}
line_id = self.create(cr, uid, vals)
if not line_id:
- raise wizard.except_wizard(_('Error'), _('Create line failed !'))
+ raise osv.except_osv(_('Error'), _('Create line failed !'))
else:
vals = {
'qty': qty,
@@ -1348,226 +1275,8 @@ class pos_payment(osv.osv):
pos_payment()
-
-class report_transaction_pos(osv.osv):
- _name = "report.transaction.pos"
- _description = "transaction for the pos"
- _auto = False
- _columns = {
- 'date_create': fields.char('Date', size=16, readonly=True),
- 'journal_id': fields.many2one('account.journal', 'Sales Journal', readonly=True),
- 'jl_id': fields.many2one('account.journal', 'Cash Journals', readonly=True),
- 'user_id': fields.many2one('res.users', 'User', readonly=True),
- 'no_trans': fields.float('Number of Transaction', readonly=True),
- 'amount': fields.float('Amount', readonly=True),
- 'invoice_id': fields.float('Nbr Invoice', readonly=True),
- 'invoice_am': fields.float('Invoice Amount', readonly=True),
- 'product_nb': fields.float('Product Nb.', readonly=True),
- 'disc': fields.float('Disc.', readonly=True),
- }
-
- def init(self, cr):
- tools.drop_view_if_exists(cr, 'report_transaction_pos')
- cr.execute("""
- create or replace view report_transaction_pos as (
- select
- min(absl.id) as id,
- count(absl.id) as no_trans,
- sum(absl.amount) as amount,
- sum(line.price_ded) as disc,
- to_char(date_trunc('day',absl.create_date),'YYYY-MM-DD')::text as date_create,
- po.user_id as user_id,
- po.sale_journal as journal_id,
- abs.journal_id as jl_id,
- count(po.invoice_id) as invoice_id,
- count(p.id) as product_nb
- from
- account_bank_statement_line as absl,
- account_bank_statement as abs,
- product_product as p,
- pos_order_line as line,
- pos_order as po
- where
- absl.pos_statement_id = po.id and
- line.order_id=po.id and
- line.product_id=p.id and
- absl.statement_id=abs.id
-
- group by
- po.user_id,po.sale_journal, abs.journal_id,
- to_char(date_trunc('day',absl.create_date),'YYYY-MM-DD')::text
- )
- """)
- #to_char(date_trunc('day',absl.create_date),'YYYY-MM-DD')
- #to_char(date_trunc('day',absl.create_date),'YYYY-MM-DD')::text as date_create,
-report_transaction_pos()
-
-class report_sales_by_user_pos(osv.osv):
- _name = "report.sales.by.user.pos"
- _description = "Sales by user"
- _auto = False
- _columns = {
- 'date_order': fields.date('Order Date',required=True, select=True),
- 'amount': fields.float('Total', readonly=True, select=True),
- 'qty': fields.float('Quantity', readonly=True, select=True),
- 'user_id': fields.many2one('res.users', 'User', readonly=True, select=True),
- }
-
- def init(self, cr):
- tools.drop_view_if_exists(cr, 'report_sales_by_user_pos')
- cr.execute("""
- create or replace view report_sales_by_user_pos as (
- select
- min(po.id) as id,
- to_char(date_trunc('day',po.date_order),'YYYY-MM-DD')::text as date_order,
- po.user_id as user_id,
- sum(pol.qty)as qty,
- sum((pol.price_unit * pol.qty * (1 - (pol.discount) / 100.0))) as amount
- from
- pos_order as po,pos_order_line as pol,product_product as pp,product_template as pt
- where
- pt.id=pp.product_tmpl_id and pp.id=pol.product_id and po.id = pol.order_id
- group by
- to_char(date_trunc('day',po.date_order),'YYYY-MM-DD')::text,
- po.user_id
-
- )
- """)
-report_sales_by_user_pos()
-
-class report_sales_by_user_pos_month(osv.osv):
- _name = "report.sales.by.user.pos.month"
- _description = "Sales by user monthly"
- _auto = False
- _columns = {
- 'date_order': fields.date('Order Date',required=True, select=True),
- 'amount': fields.float('Total', readonly=True, select=True),
- 'qty': fields.float('Quantity', readonly=True, select=True),
- 'user_id': fields.many2one('res.users', 'User', readonly=True, select=True),
- }
-
- def init(self, cr):
- tools.drop_view_if_exists(cr, 'report_sales_by_user_pos_month')
- cr.execute("""
- create or replace view report_sales_by_user_pos_month as (
- select
- min(po.id) as id,
- to_char(date_trunc('month',po.date_order),'YYYY-MM-DD')::text as date_order,
- po.user_id as user_id,
- sum(pol.qty)as qty,
- sum((pol.price_unit * pol.qty * (1 - (pol.discount) / 100.0))) as amount
- from
- pos_order as po,pos_order_line as pol,product_product as pp,product_template as pt
- where
- pt.id=pp.product_tmpl_id and pp.id=pol.product_id and po.id = pol.order_id
- group by
- to_char(date_trunc('month',po.date_order),'YYYY-MM-DD')::text,
- po.user_id
-
- )
- """)
-report_sales_by_user_pos_month()
-
-class report_sales_by_margin_pos(osv.osv):
- _name = "report.sales.by.margin.pos"
- _description = "Sales by margin"
- _auto = False
- _columns = {
-# 'pos_name': fields.char('POS Order', size=64, readonly=True),
- 'product_name':fields.char('Product Name', size=64, readonly=True),
- 'date_order': fields.date('Order Date',required=True, select=True),
- # 'amount': fields.float('Total', readonly=True, select=True),
- 'user_id': fields.many2one('res.users', 'User', readonly=True, select=True),
- 'qty': fields.float('Qty', readonly=True, select=True),
- 'net_margin_per_qty':fields.float('Net margin per Qty', readonly=True, select=True),
- 'total':fields.float('Margin', readonly=True, select=True),
-
- }
-
- def init(self, cr):
- tools.drop_view_if_exists(cr, 'report_sales_by_margin_pos')
- cr.execute("""
- create or replace view report_sales_by_margin_pos as (
- select
- min(pol.id) as id,
- po.user_id as user_id,
- pt.name as product_name,
- to_char(date_trunc('day',po.date_order),'YYYY-MM-DD')::text as date_order,
- sum(pol.qty) as qty,
- pt.list_price-pt.standard_price as net_margin_per_qty,
- (pt.list_price-pt.standard_price) *sum(pol.qty) as total
- from
- product_template as pt,
- product_product as pp,
- pos_order_line as pol,
- pos_order as po
- where
- pol.product_id = pp.product_tmpl_id and
- pp.product_tmpl_id = pt.id and
- po.id = pol.order_id
-
- group by
- pt.name,
- pt.list_price,
- pt.standard_price,
- po.user_id,
- to_char(date_trunc('day',po.date_order),'YYYY-MM-DD')::text
-
- )
- """)
-report_sales_by_margin_pos()
-
-class report_sales_by_margin_pos_month(osv.osv):
- _name = "report.sales.by.margin.pos.month"
- _description = "Sales by margin monthly"
- _auto = False
- _columns = {
-# 'pos_name': fields.char('POS Order', size=64, readonly=True),
- 'product_name':fields.char('Product Name', size=64, readonly=True),
- 'date_order': fields.date('Order Date',required=True, select=True),
- #'amount': fields.float('Total', readonly=True, select=True),
- 'user_id': fields.many2one('res.users', 'User', readonly=True, select=True),
- 'qty': fields.float('Qty', readonly=True, select=True),
- 'net_margin_per_qty':fields.float('Net margin per Qty', readonly=True, select=True),
- 'total':fields.float('Margin', readonly=True, select=True),
-
- }
-
- def init(self, cr):
- tools.drop_view_if_exists(cr, 'report_sales_by_margin_pos_month')
- cr.execute("""
- create or replace view report_sales_by_margin_pos_month as (
- select
- min(pol.id) as id,
- po.user_id as user_id,
- pt.name as product_name,
- to_char(date_trunc('month',po.date_order),'YYYY-MM-DD')::text as date_order,
- sum(pol.qty) as qty,
- pt.list_price-pt.standard_price as net_margin_per_qty,
- (pt.list_price-pt.standard_price) *sum(pol.qty) as total
- from
- product_template as pt,
- product_product as pp,
- pos_order_line as pol,
- pos_order as po
- where
- pol.product_id = pp.product_tmpl_id and
- pp.product_tmpl_id = pt.id and
- po.id = pol.order_id
-
- group by
- pt.name,
- pt.list_price,
- pt.standard_price,
- po.user_id,
- to_char(date_trunc('month',po.date_order),'YYYY-MM-DD')::text
-
- )
- """)
-report_sales_by_margin_pos_month()
-
-
class account_move_line(osv.osv):
+
_inherit = 'account.move.line'
def create(self, cr, user, vals, context={}):
pos_obj = self.pool.get('pos.order')
@@ -1587,7 +1296,9 @@ account_move_line()
class account_move(osv.osv):
+
_inherit = 'account.move'
+
def create(self, cr, user, vals, context={}):
pos_obj = self.pool.get('pos.order')
val_name = vals.get('name', '')
diff --git a/addons/point_of_sale/pos_account_bank_statement.py b/addons/point_of_sale/pos_account_bank_statement.py
index ccce315fe36..60924350014 100644
--- a/addons/point_of_sale/pos_account_bank_statement.py
+++ b/addons/point_of_sale/pos_account_bank_statement.py
@@ -65,4 +65,3 @@ class account_bank_statement_line(osv.osv):
account_bank_statement_line()
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
-
diff --git a/addons/point_of_sale/pos_data.xml b/addons/point_of_sale/pos_data.xml
index 8ff4697804e..b36bd0827c2 100644
--- a/addons/point_of_sale/pos_data.xml
+++ b/addons/point_of_sale/pos_data.xml
@@ -11,7 +11,6 @@
0.00.0
-
@@ -22,7 +21,6 @@
100.0100.0
-
diff --git a/addons/point_of_sale/pos_demo.xml b/addons/point_of_sale/pos_demo.xml
index 789d96b897d..b75f4362578 100644
--- a/addons/point_of_sale/pos_demo.xml
+++ b/addons/point_of_sale/pos_demo.xml
@@ -57,8 +57,8 @@
-
-
+
+
@@ -93,8 +93,8 @@
-
-
+
+
@@ -135,8 +135,8 @@
-
-
+
+
@@ -144,16 +144,6 @@
-
-
@@ -194,12 +184,6 @@ do black box testing on entries on this chart of account, without modifying
your own chart of account.
-
diff --git a/addons/point_of_sale/pos_report.xml b/addons/point_of_sale/pos_report.xml
index 2e9ff5e6107..9123502d288 100644
--- a/addons/point_of_sale/pos_report.xml
+++ b/addons/point_of_sale/pos_report.xml
@@ -1,39 +1,6 @@
-
-
-
-
-
+
@@ -58,28 +58,14 @@
states="paid, draft"
attrs="{'invisible':[('state_2','=','accepted')]}"/>
-
-
-
-
-
-
+
-
-
-
-
-
-
+
@@ -90,14 +76,14 @@
-
+
-
-
+
+
@@ -122,7 +108,6 @@
-
@@ -135,8 +120,6 @@
-
-
Point of Saleir.actions.act_window
@@ -145,8 +128,6 @@
[['date_order','>=',time.strftime('%Y-%m-%d')]]
-
-
Salespos.order
@@ -155,8 +136,8 @@
+
-
@@ -165,10 +146,38 @@
+
+ pos.order.list.select
+ pos.order
+ search
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
-
+
+
+
@@ -176,10 +185,12 @@
ir.actions.act_windowpos.orderform
+ tree,form['|',('state_2','=','to_verify'),('state','=','advance')]
+
+
-invoiced
Sales to Invoice
@@ -189,6 +200,8 @@ invoiced
tree,form[('state','!=', 'invoiced')]
+
+
@@ -198,8 +211,8 @@ invoiced
pos.orderformtree,form
- [('state','=', 'paid')]
+ Point of Sale
@@ -207,29 +220,25 @@ invoiced
pos.orderformtree,form
- [('date_order','<=', time.strftime('%Y-%m-%d 23:59:59'))]
+
-
-
Point of Saleir.actions.act_windowpos.orderformtree,form
-
+
-
-
Opened Salesir.actions.act_windowpos.orderformform,tree
-
+
@@ -663,59 +672,11 @@ invoiced
-
-
-
- Contact Mode
- res.mode.contact
- form
-
-
-
-
-
-
-
-
-
- Contact Mode
- res.mode.contact
- tree
-
-
-
-
-
-
-
-
-
- Contact Mode
- ir.actions.act_window
- res.mode.contact
- form
- tree,form
-
-
-
-
-
- view.partner.contact
- res.partner
- form
-
-
-
-
-
-
-
-
product.normal.form.inheritproduct.product
@@ -748,7 +709,6 @@ invoiced
-
@@ -829,13 +789,6 @@ invoiced
parent="menu_point_config_product"
action="action_product_output"
id="products_for_output_operations"/>
-
-
@@ -845,22 +798,12 @@ invoiced
action="action_box_entries"
id="menu_wizard_enter_jrnl" sequence="3" />
-
-
-
-
-
POS Salespos.order
@@ -870,8 +813,8 @@ invoiced
+
-
@@ -888,8 +831,6 @@ invoiced
form
-
-
POS Sales Linespos.order.line
@@ -912,7 +853,6 @@ invoiced
form
-
@@ -926,8 +866,6 @@ invoiced
id="menu_action_sale_of_day_tree2" action="action_trans_pos_tree_today"/>
-
@@ -975,11 +913,6 @@ invoiced
-
-
-
diff --git a/addons/point_of_sale/pos_wizard.xml b/addons/point_of_sale/pos_wizard.xml
index 50e3630c4d7..4a321d7787f 100644
--- a/addons/point_of_sale/pos_wizard.xml
+++ b/addons/point_of_sale/pos_wizard.xml
@@ -1,74 +1,3 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
diff --git a/addons/point_of_sale/pos_workflow.xml b/addons/point_of_sale/pos_workflow.xml
index d3f1313c13f..11cd9481343 100644
--- a/addons/point_of_sale/pos_workflow.xml
+++ b/addons/point_of_sale/pos_workflow.xml
@@ -66,7 +66,6 @@
done
-
diff --git a/addons/point_of_sale/posrule_data.xml b/addons/point_of_sale/posrule_data.xml
index 05313a72d51..5fa46ad43a8 100644
--- a/addons/point_of_sale/posrule_data.xml
+++ b/addons/point_of_sale/posrule_data.xml
@@ -1,61 +1,6 @@
-
-
-
-
-
-
-
-
-
-
-
@@ -67,6 +12,7 @@
+
@@ -77,26 +23,22 @@
+
-
-
-
-
-
-
-
-
-
+ POS line
+
+
+ ['|',('company_id','=',False),('company_id','child_of',[user.company_id.id])]
-
+
@@ -121,42 +63,21 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
+
+
+
+
+ ['|',('company_id','=',False),('company_id','child_of',[user.company_id.id])]
+
+
-
+
-
-
-
-
+
+ ['|',('user_id','=',False),('user_id','=',[user.id])]
@@ -174,7 +95,7 @@
ref('stock.menu_action_picking_tree7'),
ref('stock.menu_action_picking_tree8'),
ref('stock.menu_action_picking_tree9'),
- ref('mrp.menu_mrp_procurement_action3'),
+ ref('mrp_procurement.menu_mrp_procurement_action3'),
ref('point_of_sale.menu_point_root')])]" name="menu_access"/>
@@ -211,7 +132,7 @@
-
+
@@ -285,7 +206,7 @@
-
+
@@ -553,7 +474,7 @@
-
+
@@ -575,13 +496,8 @@
id="stock.next_id_61"
name="Reporting"
parent="stock.menu_stock_root" groups="base.group_user"/>
-
-
-
-
-
-
+
diff --git a/addons/point_of_sale/posrule_data2.xml b/addons/point_of_sale/posrule_data2.xml
index 680ae25d7b7..927584e92ce 100644
--- a/addons/point_of_sale/posrule_data2.xml
+++ b/addons/point_of_sale/posrule_data2.xml
@@ -177,7 +177,7 @@
ref('stock.menu_action_picking_tree7'),
ref('stock.menu_action_picking_tree8'),
ref('stock.menu_action_picking_tree9'),
- ref('mrp.menu_mrp_procurement_action3'),
+ ref('mrp_procurement.menu_mrp_procurement_action3'),
ref('point_of_sale.menu_point_root')])]" name="menu_access"/>
@@ -214,7 +214,7 @@
-
+
@@ -557,7 +557,7 @@
-
+
diff --git a/addons/point_of_sale/report/__init__.py b/addons/point_of_sale/report/__init__.py
index a5798add7b4..4af503ff9da 100644
--- a/addons/point_of_sale/report/__init__.py
+++ b/addons/point_of_sale/report/__init__.py
@@ -36,5 +36,6 @@ import pos_payment_report_user
import pos_sales_user_today_current_user
import pos_receipt_with_remboursment
import pos_receipt_without_remboursment
+import point_of_sale_report
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
diff --git a/addons/point_of_sale/report/point_of_sale_report.py b/addons/point_of_sale/report/point_of_sale_report.py
new file mode 100644
index 00000000000..10ba94662a2
--- /dev/null
+++ b/addons/point_of_sale/report/point_of_sale_report.py
@@ -0,0 +1,242 @@
+# -*- coding: utf-8 -*-
+##############################################################################
+#
+# OpenERP, Open Source Management Solution
+# Copyright (C) 2004-2010 Tiny SPRL ().
+#
+# This program is free software: you can redistribute it and/or modify
+# it under the terms of the GNU Affero General Public License as
+# published by the Free Software Foundation, either version 3 of the
+# License, or (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU Affero General Public License for more details.
+#
+# You should have received a copy of the GNU Affero General Public License
+# along with this program. If not, see .
+#
+##############################################################################
+
+from osv import osv, fields
+import time
+import netsvc
+import tools
+
+class report_transaction_pos(osv.osv):
+ _name = "report.transaction.pos"
+ _description = "transaction for the pos"
+ _auto = False
+ _columns = {
+ 'date_create': fields.char('Date', size=16, readonly=True),
+ 'journal_id': fields.many2one('account.journal', 'Sales Journal', readonly=True),
+ 'jl_id': fields.many2one('account.journal', 'Cash Journals', readonly=True),
+ 'user_id': fields.many2one('res.users', 'User', readonly=True),
+ 'no_trans': fields.float('Number of Transaction', readonly=True),
+ 'amount': fields.float('Amount', readonly=True),
+ 'invoice_id': fields.float('Nbr Invoice', readonly=True),
+ 'invoice_am': fields.float('Invoice Amount', readonly=True),
+ 'product_nb': fields.float('Product Nb.', readonly=True),
+ 'disc': fields.float('Disc.', readonly=True),
+ }
+
+ def init(self, cr):
+ tools.drop_view_if_exists(cr, 'report_transaction_pos')
+ cr.execute("""
+ create or replace view report_transaction_pos as (
+ select
+ min(absl.id) as id,
+ count(absl.id) as no_trans,
+ sum(absl.amount) as amount,
+ sum(line.price_ded) as disc,
+ to_char(date_trunc('day',absl.create_date),'YYYY-MM-DD')::text as date_create,
+ po.user_id as user_id,
+ po.sale_journal as journal_id,
+ abs.journal_id as jl_id,
+ count(po.invoice_id) as invoice_id,
+ count(p.id) as product_nb
+ from
+ account_bank_statement_line as absl,
+ account_bank_statement as abs,
+ product_product as p,
+ pos_order_line as line,
+ pos_order as po
+ where
+ absl.pos_statement_id = po.id and
+ line.order_id=po.id and
+ line.product_id=p.id and
+ absl.statement_id=abs.id
+
+ group by
+ po.user_id,po.sale_journal, abs.journal_id,
+ to_char(date_trunc('day',absl.create_date),'YYYY-MM-DD')::text
+ )
+ """)
+ #to_char(date_trunc('day',absl.create_date),'YYYY-MM-DD')
+ #to_char(date_trunc('day',absl.create_date),'YYYY-MM-DD')::text as date_create,
+report_transaction_pos()
+
+class report_sales_by_user_pos(osv.osv):
+ _name = "report.sales.by.user.pos"
+ _description = "Sales by user"
+ _auto = False
+ _columns = {
+ 'date_order': fields.date('Order Date',required=True, select=True),
+ 'amount': fields.float('Total', readonly=True, select=True),
+ 'qty': fields.float('Quantity', readonly=True, select=True),
+ 'user_id': fields.many2one('res.users', 'User', readonly=True, select=True),
+ }
+
+ def init(self, cr):
+ tools.drop_view_if_exists(cr, 'report_sales_by_user_pos')
+ cr.execute("""
+ create or replace view report_sales_by_user_pos as (
+ select
+ min(po.id) as id,
+ to_char(date_trunc('day',po.date_order),'YYYY-MM-DD')::text as date_order,
+ po.user_id as user_id,
+ sum(pol.qty)as qty,
+ sum((pol.price_unit * pol.qty * (1 - (pol.discount) / 100.0))) as amount
+ from
+ pos_order as po,pos_order_line as pol,product_product as pp,product_template as pt
+ where
+ pt.id=pp.product_tmpl_id and pp.id=pol.product_id and po.id = pol.order_id
+ group by
+ to_char(date_trunc('day',po.date_order),'YYYY-MM-DD')::text,
+ po.user_id
+
+ )
+ """)
+report_sales_by_user_pos()
+
+class report_sales_by_user_pos_month(osv.osv):
+ _name = "report.sales.by.user.pos.month"
+ _description = "Sales by user monthly"
+ _auto = False
+ _columns = {
+ 'date_order': fields.date('Order Date',required=True, select=True),
+ 'amount': fields.float('Total', readonly=True, select=True),
+ 'qty': fields.float('Quantity', readonly=True, select=True),
+ 'user_id': fields.many2one('res.users', 'User', readonly=True, select=True),
+ }
+
+ def init(self, cr):
+ tools.drop_view_if_exists(cr, 'report_sales_by_user_pos_month')
+ cr.execute("""
+ create or replace view report_sales_by_user_pos_month as (
+ select
+ min(po.id) as id,
+ to_char(date_trunc('month',po.date_order),'YYYY-MM-DD')::text as date_order,
+ po.user_id as user_id,
+ sum(pol.qty)as qty,
+ sum((pol.price_unit * pol.qty * (1 - (pol.discount) / 100.0))) as amount
+ from
+ pos_order as po,pos_order_line as pol,product_product as pp,product_template as pt
+ where
+ pt.id=pp.product_tmpl_id and pp.id=pol.product_id and po.id = pol.order_id
+ group by
+ to_char(date_trunc('month',po.date_order),'YYYY-MM-DD')::text,
+ po.user_id
+
+ )
+ """)
+report_sales_by_user_pos_month()
+
+class report_sales_by_margin_pos(osv.osv):
+ _name = "report.sales.by.margin.pos"
+ _description = "Sales by margin"
+ _auto = False
+ _columns = {
+# 'pos_name': fields.char('POS Order', size=64, readonly=True),
+ 'product_name':fields.char('Product Name', size=64, readonly=True),
+ 'date_order': fields.date('Order Date',required=True, select=True),
+ # 'amount': fields.float('Total', readonly=True, select=True),
+ 'user_id': fields.many2one('res.users', 'User', readonly=True, select=True),
+ 'qty': fields.float('Qty', readonly=True, select=True),
+ 'net_margin_per_qty':fields.float('Net margin per Qty', readonly=True, select=True),
+ 'total':fields.float('Margin', readonly=True, select=True),
+
+ }
+
+ def init(self, cr):
+ tools.drop_view_if_exists(cr, 'report_sales_by_margin_pos')
+ cr.execute("""
+ create or replace view report_sales_by_margin_pos as (
+ select
+ min(pol.id) as id,
+ po.user_id as user_id,
+ pt.name as product_name,
+ to_char(date_trunc('day',po.date_order),'YYYY-MM-DD')::text as date_order,
+ sum(pol.qty) as qty,
+ pt.list_price-pt.standard_price as net_margin_per_qty,
+ (pt.list_price-pt.standard_price) *sum(pol.qty) as total
+ from
+ product_template as pt,
+ product_product as pp,
+ pos_order_line as pol,
+ pos_order as po
+ where
+ pol.product_id = pp.product_tmpl_id and
+ pp.product_tmpl_id = pt.id and
+ po.id = pol.order_id
+
+ group by
+ pt.name,
+ pt.list_price,
+ pt.standard_price,
+ po.user_id,
+ to_char(date_trunc('day',po.date_order),'YYYY-MM-DD')::text
+
+ )
+ """)
+report_sales_by_margin_pos()
+
+class report_sales_by_margin_pos_month(osv.osv):
+ _name = "report.sales.by.margin.pos.month"
+ _description = "Sales by margin monthly"
+ _auto = False
+ _columns = {
+
+ 'product_name':fields.char('Product Name', size=64, readonly=True),
+ 'date_order': fields.date('Order Date',required=True, select=True),
+ 'user_id': fields.many2one('res.users', 'User', readonly=True, select=True),
+ 'qty': fields.float('Qty', readonly=True, select=True),
+ 'net_margin_per_qty':fields.float('Net margin per Qty', readonly=True, select=True),
+ 'total':fields.float('Margin', readonly=True, select=True),
+
+ }
+
+ def init(self, cr):
+ tools.drop_view_if_exists(cr, 'report_sales_by_margin_pos_month')
+ cr.execute("""
+ create or replace view report_sales_by_margin_pos_month as (
+ select
+ min(pol.id) as id,
+ po.user_id as user_id,
+ pt.name as product_name,
+ to_char(date_trunc('month',po.date_order),'YYYY-MM-DD')::text as date_order,
+ sum(pol.qty) as qty,
+ pt.list_price-pt.standard_price as net_margin_per_qty,
+ (pt.list_price-pt.standard_price) *sum(pol.qty) as total
+ from
+ product_template as pt,
+ product_product as pp,
+ pos_order_line as pol,
+ pos_order as po
+ where
+ pol.product_id = pp.product_tmpl_id and
+ pp.product_tmpl_id = pt.id and
+ po.id = pol.order_id
+
+ group by
+ pt.name,
+ pt.list_price,
+ pt.standard_price,
+ po.user_id,
+ to_char(date_trunc('month',po.date_order),'YYYY-MM-DD')::text
+
+ )
+ """)
+report_sales_by_margin_pos_month()
+
diff --git a/addons/point_of_sale/report/pos_receipt.rml b/addons/point_of_sale/report/pos_receipt.rml
index 1d2e6edc9d0..d615fc74534 100644
--- a/addons/point_of_sale/report/pos_receipt.rml
+++ b/addons/point_of_sale/report/pos_receipt.rml
@@ -103,7 +103,7 @@
Tel : [[ address and address.phone ]]E-mail : [[ address and address.email ]]Shop : [[ o.shop_id.name ]]
- Vendeur : [[ o.user_id1.name ]]
+ Vendeur : [[ o.user_salesman_id.name ]]Date : [[ formatLang(o.date_order,date = True) ]]
diff --git a/addons/point_of_sale/sale_wizard.xml b/addons/point_of_sale/sale_wizard.xml
deleted file mode 100644
index ca741e2c808..00000000000
--- a/addons/point_of_sale/sale_wizard.xml
+++ /dev/null
@@ -1,6 +0,0 @@
-
-
-
-
-
-
diff --git a/addons/point_of_sale/security/ir.model.access.csv b/addons/point_of_sale/security/ir.model.access.csv
index 0cfc0fae9b7..599df9581ee 100644
--- a/addons/point_of_sale/security/ir.model.access.csv
+++ b/addons/point_of_sale/security/ir.model.access.csv
@@ -13,7 +13,6 @@
"access_sale_shop_pos_user","sale.shop pos_user","sale.model_sale_shop","point_of_sale.group_pos_user",1,0,0,0
"access_pos_order_stock_worker","pos.order stock_worker","model_pos_order","stock.group_stock_user",1,0,0,0
"access_stock_move_pos_user","stock.move pos_user","stock.model_stock_move","point_of_sale.group_pos_user",1,1,1,1
-"access_res_mode_contact","res.mode.contact","model_res_mode_contact","point_of_sale.group_pos_user",1,0,0,0
"access_report_sales_by_user_pos","report.sales.by.user.pos","model_report_sales_by_user_pos","point_of_sale.group_pos_user",1,0,0,0
"access_report_sales_by_user_pos_month","report.sales.by.user.pos.month","model_report_sales_by_user_pos_month","point_of_sale.group_pos_user",1,0,0,0
"access_report_sales_by_margin_pos","report.sales.by.margin.pos","model_report_sales_by_margin_pos","point_of_sale.group_pos_user",1,0,0,0
diff --git a/addons/point_of_sale/singer_statement_demo.xml b/addons/point_of_sale/singer_statement_demo.xml
index edc8299c609..68f889cddee 100644
--- a/addons/point_of_sale/singer_statement_demo.xml
+++ b/addons/point_of_sale/singer_statement_demo.xml
@@ -316,17 +316,6 @@
-
-
-
-
-
-
-
-
-
-
-
diff --git a/addons/point_of_sale/statement_data.xml b/addons/point_of_sale/statement_data.xml
index 947348a990d..67c94170666 100644
--- a/addons/point_of_sale/statement_data.xml
+++ b/addons/point_of_sale/statement_data.xml
@@ -21,19 +21,19 @@
-
+
-
+
-
+
diff --git a/addons/point_of_sale/statement_view.xml b/addons/point_of_sale/statement_view.xml
index 80b2b1ec756..cef2748b5e4 100644
--- a/addons/point_of_sale/statement_view.xml
+++ b/addons/point_of_sale/statement_view.xml
@@ -434,7 +434,11 @@
string="Close Register"
action="action_pos_close_statement"
id="menu_close_statement" sequence="2" />
-
+
+
diff --git a/addons/point_of_sale/stock.py b/addons/point_of_sale/stock.py
index 95630569a7c..9d2b24d69b8 100644
--- a/addons/point_of_sale/stock.py
+++ b/addons/point_of_sale/stock.py
@@ -30,7 +30,6 @@ class stock_picking(osv.osv):
_inherit = 'stock.picking'
_columns = {
'pos_order': fields.many2one('pos.order', 'Pos order'),
- # 'company_id':fields.many2one('res.company', 'Company', required=True),
}
stock_picking()
diff --git a/addons/point_of_sale/wizard/__init__.py b/addons/point_of_sale/wizard/__init__.py
index cdfd3f9fb20..d8a4b93e3a2 100644
--- a/addons/point_of_sale/wizard/__init__.py
+++ b/addons/point_of_sale/wizard/__init__.py
@@ -19,7 +19,7 @@
# along with this program. If not, see .
#
##############################################################################
-import wizard_return
+
import pos_add_product
import pos_confirm
import pos_discount
@@ -39,6 +39,7 @@ import pos_payment_report_date
import pos_payment_report
import pos_payment
import pos_scan_product
+import pos_return
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
diff --git a/addons/point_of_sale/wizard/pos_add_product.py b/addons/point_of_sale/wizard/pos_add_product.py
index 34769be78e9..5d88b75d7ff 100644
--- a/addons/point_of_sale/wizard/pos_add_product.py
+++ b/addons/point_of_sale/wizard/pos_add_product.py
@@ -61,7 +61,27 @@ class add_product(osv.osv_memory):
'views': False,
'type': 'ir.actions.act_window',
}
+ def close_action(self, cr, uid, ids, context):
+ record_id = context and context.get('active_id', False)
+ order_obj= self.pool.get('pos.order')
+ order_line_obj= self.pool.get('pos.order.line')
+ obj=order_obj.browse(cr,uid, record_id)
+ order_obj.write(cr,uid,[record_id],{'state':'done'})
+ if obj.amount_total != obj.amount_paid:
+ return {
+ 'name': _('Make Payment'),
+ 'context ':context and context.get('active_id', False),
+ 'view_type': 'form',
+ 'view_mode': 'form',
+ 'res_model': 'pos.make.payment',
+ 'view_id': False,
+ 'target': 'new',
+ 'views': False,
+ 'type': 'ir.actions.act_window',
+
+ }
+ return {}
add_product()
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
diff --git a/addons/point_of_sale/wizard/pos_add_product.xml b/addons/point_of_sale/wizard/pos_add_product.xml
index 5d380624f0d..f465f97f097 100644
--- a/addons/point_of_sale/wizard/pos_add_product.xml
+++ b/addons/point_of_sale/wizard/pos_add_product.xml
@@ -12,8 +12,8 @@
-
+
diff --git a/addons/point_of_sale/wizard/pos_details.xml b/addons/point_of_sale/wizard/pos_details.xml
index 077e2ed89dc..bb62b94fb75 100644
--- a/addons/point_of_sale/wizard/pos_details.xml
+++ b/addons/point_of_sale/wizard/pos_details.xml
@@ -29,7 +29,6 @@
formformnew
- {'record_id' : active_id}
diff --git a/addons/point_of_sale/wizard/pos_payment.py b/addons/point_of_sale/wizard/pos_payment.py
index 8e25f3f0797..f59d814522c 100644
--- a/addons/point_of_sale/wizard/pos_payment.py
+++ b/addons/point_of_sale/wizard/pos_payment.py
@@ -43,7 +43,8 @@ class pos_make_payment(osv.osv_memory):
@return: A dictionary which of fields with values.
"""
res = super(pos_make_payment, self).default_get(cr, uid, fields, context=context)
- record_id = context and context.get('active_id',False)
+
+ active_id = context and context.get('active_id',False)
j_obj = self.pool.get('account.journal')
company_id = self.pool.get('res.users').browse(cr,uid,uid).company_id.id
journal = j_obj.search(cr, uid, [('type', '=', 'cash'), ('company_id', '=', company_id)])
@@ -55,14 +56,14 @@ class pos_make_payment(osv.osv_memory):
wf_service = netsvc.LocalService("workflow")
order_obj=self.pool.get('pos.order')
- order = order_obj.browse(cr, uid, record_id, context)
+ order = order_obj.browse(cr, uid, active_id, context)
#get amount to pay
amount = order.amount_total - order.amount_paid
if amount <= 0.0:
context.update({'flag': True})
- order_obj.action_paid(cr, uid, [record_id], context)
+ order_obj.action_paid(cr, uid, [active_id], context)
elif order.amount_paid > 0.0:
- order_obj.write(cr, uid, [record_id], {'state': 'advance'})
+ order_obj.write(cr, uid, [active_id], {'state': 'advance'})
invoice_wanted_checked = False
current_date = time.strftime('%Y-%m-%d')
@@ -81,11 +82,11 @@ class pos_make_payment(osv.osv_memory):
def view_init(self, cr, uid, fields_list, context=None):
res = super(pos_make_payment, self).view_init(cr, uid, fields_list, context=context)
- record_id = context and context.get('active_id', False) or False
- order = self.pool.get('pos.order').browse(cr, uid, record_id)
+ active_id = context and context.get('active_id', False) or False
+ order = self.pool.get('pos.order').browse(cr, uid, active_id)
if not order.lines:
- raise osv.except_osv('Error!','No order lines defined for this sale ')
- True
+ raise osv.except_osv('Error!','No order lines defined for this sale ')
+ return True
def fields_view_get(self, cr, uid, view_id=None, view_type='form', context=None, toolbar=False, submenu=False):
"""
@@ -99,22 +100,26 @@ class pos_make_payment(osv.osv_memory):
@return: New arch of view.
"""
- record_id = context and context.get('record_id', False) or False
- res = super(pos_make_payment, self).fields_view_get(cr, uid, view_id=view_id, view_type=view_type, context=context, toolbar=toolbar,submenu=False)
- if record_id:
- order = self.pool.get('pos.order').browse(cr, uid, record_id)
- amount = order.amount_total - order.amount_paid
- if amount==0.0:
- res['arch'] = """
-
-
-
-
-
-
-
- """
- return res
+
+
+ result = super(pos_make_payment, self).fields_view_get(cr, uid, view_id=view_id, view_type=view_type, context=context, toolbar=toolbar,submenu=False)
+ active_model = context.get('active_model')
+ active_id = context.get('active_id', False)
+ if not active_id or (active_model and active_model != 'pos.order'):
+ return result
+
+ order = self.pool.get('pos.order').browse(cr, uid, active_id)
+ if order.amount_total == order.amount_paid:
+ res['arch'] = """
+
+
+
+
+
+
+
+ """
+ return result
def check(self, cr, uid, ids, context=None):
@@ -122,47 +127,48 @@ class pos_make_payment(osv.osv_memory):
if the order is not paid: continue payment,
if the order is paid print invoice (if wanted) or ticket.
"""
- record_id = context and context.get('active_id',False)
+ active_id = context and context.get('active_id',False)
order_obj = self.pool.get('pos.order')
jrnl_obj = self.pool.get('account.journal')
- order = order_obj.browse(cr, uid, record_id, context)
+ order = order_obj.browse(cr, uid, active_id, context)
amount = order.amount_total - order.amount_paid
data = self.read(cr, uid, ids)[0]
-
+
# Todo need to check ...
if amount !=0.0:
invoice_wanted = data['invoice_wanted']
jrnl_used=False
if data.get('journal',False):
jrnl_used=jrnl_obj.browse(cr,uid,data['journal'])
- order_obj.write(cr, uid, [record_id], {'invoice_wanted': invoice_wanted})
- order_obj.add_payment(cr, uid, record_id, data, context=context)
+ order_obj.write(cr, uid, [active_id], {'invoice_wanted': invoice_wanted})
+ order_obj.add_payment(cr, uid, active_id, data, context=context)
# Todo need to check
# if amount<=0.0:
# context.update({'flag':True})
-# order_obj.action_paid(cr,uid,[record_id],context)
- if order_obj.test_paid(cr, uid, [record_id]):
+# order_obj.action_paid(cr,uid,[active_id],context)
+ if order_obj.test_paid(cr, uid, [active_id]):
if order.partner_id and order.invoice_wanted:
return self.create_invoice(cr,uid,ids,context)
else:
- order_obj.action_paid(cr,uid,[record_id],context)
- order_obj.write(cr, uid, [record_id],{'state':'paid'})
+ context.update({'flag': True})
+ order_obj.action_paid(cr,uid,[active_id],context)
+ order_obj.write(cr, uid, [active_id],{'state':'paid'})
return self.print_report(cr, uid, ids, context)
if order.amount_paid > 0.0:
context.update({'flag': True})
# Todo need to check
- order_obj.action_paid(cr, uid, [record_id], context)
- self.pool.get('pos.order').write(cr, uid, [record_id],{'state':'advance'})
+ order_obj.action_paid(cr, uid, [active_id], context)
+ self.pool.get('pos.order').write(cr, uid, [active_id],{'state':'advance'})
return self.print_report(cr, uid, ids, context)
return {}
def create_invoice(self, cr, uid, ids, context):
wf_service = netsvc.LocalService("workflow")
- record_ids = context and context.get('active_ids',False)
- for i in record_ids:
+ active_ids = [context and context.get('active_id',False)]
+ for i in active_ids:
wf_service.trg_validate(uid, 'pos.order', i, 'invoice', cr)
- datas = {'ids' : context.get('active_ids', [])}
+ datas = {'ids' : context.get('active_id', [])}
return {
'type' : 'ir.actions.report.xml',
'report_name':'pos.invoice',
@@ -180,7 +186,8 @@ class pos_make_payment(osv.osv_memory):
@param context: A standard dictionary
@return : retrun report
"""
- datas = {'ids' : context.get('active_ids',[])}
+ active_id=context.get('active_id',[])
+ datas = {'ids' : [active_id]}
res = {}
datas['form'] = res
diff --git a/addons/point_of_sale/wizard/pos_return.py b/addons/point_of_sale/wizard/pos_return.py
new file mode 100644
index 00000000000..bdb6f46e71e
--- /dev/null
+++ b/addons/point_of_sale/wizard/pos_return.py
@@ -0,0 +1,351 @@
+# -*- encoding: utf-8 -*-
+##############################################################################
+#
+# OpenERP, Open Source Management Solution
+# Copyright (C) 2004-2009 Tiny SPRL (). All Rights Reserved
+# $Id$
+#
+# This program is free software: you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation, either version 3 of the License, or
+# (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program. If not, see .
+#
+##############################################################################
+
+import netsvc
+from osv import osv,fields
+from tools.translate import _
+from mx import DateTime
+import time
+import pos_box_entries
+import pos_add_product
+import pos_payment
+
+class pos_return(osv.osv_memory):
+ _name = 'pos.return'
+ _description = 'Point of sale return'
+
+ _columns = {
+
+ }
+
+ def default_get(self, cr, uid, fields, context=None):
+ """
+ To get default values for the object.
+
+ @param self: The object pointer.
+ @param cr: A database cursor
+ @param uid: ID of the user currently logged in
+ @param fields: List of fields for which we want default values
+ @param context: A standard dictionary
+
+ @return: A dictionary which of fields with values.
+
+ """
+
+ res = super(pos_return, self).default_get(cr, uid, fields, context=context)
+ order_obj = self.pool.get('pos.order')
+ active_ids = context.get('active_ids')
+ if not context:
+ context={}
+ for order in order_obj.browse(cr, uid, active_ids):
+ for line in order.lines:
+ if 'return%s'%(line.id) in fields:
+ res['return%s'%(line.id)] = line.qty
+ return res
+
+ def view_init(self, cr, uid, fields_list, context=None):
+ res = super(pos_return, self).view_init(cr, uid, fields_list, context=context)
+ order_obj=self.pool.get('pos.order')
+ if not context:
+ context={}
+
+ active_ids=context.get('active_ids')
+ for order in order_obj.browse(cr, uid, active_ids):
+ for line in order.lines:
+ if 'return%s'%(line.id) not in self._columns:
+ self._columns['return%s'%(line.id)] = fields.float("Quantity")
+
+ return res
+
+ def fields_view_get(self, cr, uid, view_id=None, view_type='form', context=None, toolbar=False,submenu=False):
+ result = super(pos_return, self).fields_view_get(cr, uid, view_id, view_type, context, toolbar,submenu)
+ if not context:
+ context={}
+ active_model = context.get('active_model')
+ if not active_model and active_model != 'pos.order':
+ return result
+ order_obj = self.pool.get('pos.order')
+ active_id = context.get('active_id', False)
+ if active_id:
+ _moves_arch_lst="""
+
' % _('Return lines'), '' % _('Quantities you enter, match to products that will return to the stock.')]
- for m in [line for line in order.lines]:
- quantity=m.qty
- arch_lst.append('\n' % (m.id,))
- fields['return%s' % m.id]={'string':m.product_id.name, 'type':'float', 'required':True, 'default':quantity}
- res.setdefault('returns', []).append(m.id)
- arch_lst.append('
')
- arch.string='\n'.join(arch_lst)
- return res
-
-def _create_returns(self, cr, uid, data, context):
- pool = pooler.get_pool(cr.dbname)
- order_obj = pool.get('pos.order')
- lines_obj = pool.get('pos.order.line')
- picking_obj = pool.get('stock.picking')
- stock_move_obj = pool.get('stock.move')
- move_obj = pool.get('stock.move')
- picking_ids = picking_obj.search(cr, uid, [('pos_order', 'in', data['ids']), ('state', '=', 'done')])
- clone_list = []
- date_cur=time.strftime('%Y-%m-%d')
- uom_obj = pool.get('product.uom')
- wf_service = netsvc.LocalService("workflow")
- for order_id in order_obj.browse(cr, uid, data['ids'], context=context):
- prop_ids = pool.get("ir.property").search(cr, uid,[('name', '=', 'property_stock_customer')])
- val = pool.get("ir.property").browse(cr, uid,prop_ids[0]).value
- cr.execute("select s.id from stock_location s, stock_warehouse w where w.lot_stock_id=s.id and w.id= %d "%(order_id.shop_id.warehouse_id.id))
- res=cr.fetchone()
- location_id=res and res[0] or None
- stock_dest_id = int(val.split(',')[1])
-
- order_obj.write(cr,uid,[order_id.id],{'type_rec':'Exchange'})
- if order_id.invoice_id:
- pool.get('account.invoice').refund(cr, uid, [order_id.invoice_id.id],time.strftime('%Y-%m-%d'), False, order_id.name)
- new_picking=picking_obj.create(cr,uid,{
- 'name':'%s (return)' %order_id.name,
- 'move_lines':[], 'state':'draft',
- 'type':'in',
- 'date':date_cur, })
- for line in order_id.lines:
- for r in data['form'].get('returns',[]):
- if line.id==r and (data['form']['return%s' %r]!=0.0):
- new_move=stock_move_obj.create(cr, uid,{
- 'product_qty': data['form']['return%s' %r],
- 'product_uos_qty': uom_obj._compute_qty(cr, uid,data['form']['return%s' %r] ,line.product_id.uom_id.id),
- 'picking_id':new_picking,
- 'product_uom':line.product_id.uom_id.id,
- 'location_id':location_id,
- 'product_id':line.product_id.id,
- 'location_dest_id':stock_dest_id,
- 'name':'%s (return)' %order_id.name,
- 'date':date_cur,
- 'date_planned':date_cur,})
- lines_obj.write(cr,uid,[line.id],{'qty_rfd':(line.qty or 0.0) + data['form']['return%s' %r],
- 'qty':line.qty-(data['form']['return%s' %r] or 0.0)
- })
- wf_service.trg_validate(uid, 'stock.picking',new_picking,'button_confirm', cr)
- picking_obj.force_assign(cr, uid, [new_picking], context)
- return res
-
-def _create_returns2(self, cr, uid, data, context):
- act={}
- pool = pooler.get_pool(cr.dbname)
- order_obj = pool.get('pos.order')
- line_obj = pool.get('pos.order.line')
- picking_obj = pool.get('stock.picking')
- stock_move_obj = pool.get('stock.move')
- picking_ids = picking_obj.search(cr, uid, [('pos_order', 'in', data['ids']), ('state', '=', 'done')])
- clone_list = []
- date_cur=time.strftime('%Y-%m-%d')
- uom_obj = pool.get('product.uom')
- wf_service = netsvc.LocalService("workflow")
- for order_id in order_obj.browse(cr, uid, data['ids'], context=context):
- prop_ids = pool.get("ir.property").search(cr, uid,[('name', '=', 'property_stock_customer')])
- val = pool.get("ir.property").browse(cr, uid,prop_ids[0]).value
- cr.execute("select s.id from stock_location s, stock_warehouse w where w.lot_stock_id=s.id and w.id= %d "%(order_id.shop_id.warehouse_id.id))
- res=cr.fetchone()
- location_id=res and res[0] or None
- stock_dest_id = int(val.split(',')[1])
- if order_id.last_out_picking.id:
- new_picking=picking_obj.copy(cr, uid, order_id.last_out_picking.id, {'name':'%s (return)' % order_id.name,
- 'move_lines':[], 'state':'draft', 'type':'in',
- 'type':'in',
- 'date':date_cur, })
- new_order=order_obj.copy(cr,uid,order_id.id, {'name': 'Refund %s'%order_id.name,
- 'lines':[],
- 'statement_ids':[],
- 'last_out_picking':[]})
- for line in order_id.lines:
- for r in data['form'].get('returns',[]):
- if line.id==r and (data['form']['return%s' %r]!=0.0):
- new_move=stock_move_obj.create(cr, uid,{
- 'product_qty': data['form']['return%s' %r],
- 'product_uos_qty': uom_obj._compute_qty(cr, uid,data['form']['return%s' %r] ,line.product_id.uom_id.id),
- 'picking_id':new_picking,
- 'product_uom':line.product_id.uom_id.id,
- 'location_id':location_id,
- 'product_id':line.product_id.id,
- 'location_dest_id':stock_dest_id,
- 'name':'%s (return)' %order_id.name,
- 'date':date_cur,
- 'date_planned':date_cur,})
- line_obj.copy(cr,uid,line.id,{'qty':-data['form']['return%s' %r],
- 'order_id': new_order,
- })
- order_obj.write(cr,uid, new_order, {'state':'done'})
- wf_service.trg_validate(uid, 'stock.picking',new_picking,'button_confirm', cr)
- picking_obj.force_assign(cr, uid, [new_picking], context)
- act = {
- 'domain': "[('id', 'in', ["+str(new_order)+"])]",
- 'name': 'Refunded Orders',
- 'view_type': 'form',
- 'view_mode': 'form,tree',
- 'res_model': 'pos.order',
- 'auto_refresh':0,
- 'res_id':new_order,
- 'view_id': False,
- 'type': 'ir.actions.act_window'
- }
- else:
- raise wizard.except_wizard(_('Error'), _('Last out picking No find!'))
-
- return act
-def test(self,cr,uid,data,context={}):
- # import pdb; pdb.set_trace()
- data['id']=data['res_id']
- return {'id':data['res_id']}
-
-#def _raise(self,cr,uid,data,context={}):
-# return datas
-# raise wizard.except_wizard(_('Message'),_('You can not exchange products more than total paid amount.'))
-
-
-#def _test_exist1(self,cr,uid,data,context={}):
-# return 'choice'
-
-def _test_exist(self,cr,uid,data,context={}):
-# order_obj= pooler.get_pool(cr.dbname).get('pos.order')
-# order_line_obj= pooler.get_pool(cr.dbname).get('pos.order.line')
-# obj=order_obj.browse(cr,uid, data['ids'])[0]
-# am_tot=obj._amount_total(cr, uid, data['ids'])
-# order_obj.write(cr,uid,data['ids'],{'state':'done'})
-# if obj.amount_total == obj.amount_paid:
-# return 'receipt'
-# elif obj.amount_total > obj.amount_paid:
-# sql = """select max(id) from pos_order_line where order_id = %d """%(obj.id)
-# cr.execute(sql)
-# res = cr.fetchone()
-# cr.execute("delete from pos_order_line where id = %d"%(res[0]))
-# cr.commit()
-# return 'choice_raise'
-# else:
- return 'add_p'
-
-def _close(self,cr,uid,data,context={}):
- order_obj= pooler.get_pool(cr.dbname).get('pos.order')
- order_line_obj= pooler.get_pool(cr.dbname).get('pos.order.line')
- obj=order_obj.browse(cr,uid, data['ids'])[0]
- order_obj.write(cr,uid,data['ids'],{'state':'done'})
- if obj.amount_total != obj.amount_paid:
- return 'ask_pay'
- else :
- return 'receipt'
-
-
-
-
-def _add_pdct(self, cr, uid, data, context):
- pool = pooler.get_pool(cr.dbname)
- order_obj = pool.get('pos.order')
- line_obj = pool.get('pos.order.line')
- picking_obj = pool.get('stock.picking')
- wf_service = netsvc.LocalService("workflow")
- prod_obj = pool.get('product.product')
- stock_move_obj = pool.get('stock.move')
- uom_obj = pool.get('product.uom')
- date_cur=time.strftime('%Y-%m-%d')
- order_obj.add_product(cr, uid, data['id'], data['form']['product'],
- data['form']['quantity'], context=context)
- cr.commit()
- for order_id in order_obj.browse(cr, uid, data['ids'], context=context):
- prod=data['form']['product']
- qty=data['form']['quantity']
- prop_ids = pool.get("ir.property").search(cr, uid,[('name', '=', 'property_stock_customer')])
- val = pool.get("ir.property").browse(cr, uid,prop_ids[0]).value
- cr.execute("select s.id from stock_location s, stock_warehouse w where w.lot_stock_id=s.id and w.id= %d "%(order_id.shop_id.warehouse_id.id))
- res=cr.fetchone()
- location_id=res and res[0] or None
- stock_dest_id = int(val.split(',')[1])
-
- prod_id=prod_obj.browse(cr,uid,prod)
- new_picking=picking_obj.create(cr,uid,{
- 'name':'%s (Added)' %order_id.name,
- 'move_lines':[],
- 'state':'draft',
- 'type':'out',
- 'date':date_cur, })
- new_move=stock_move_obj.create(cr, uid,{
- 'product_qty': qty,
- 'product_uos_qty': uom_obj._compute_qty(cr, uid,prod_id.uom_id.id, qty, prod_id.uom_id.id),
- 'picking_id':new_picking,
- 'product_uom':prod_id.uom_id.id,
- 'location_id':location_id,
- 'product_id':prod_id.id,
- 'location_dest_id':stock_dest_id,
- 'name':'%s (return)' %order_id.name,
- 'date':date_cur,
- 'date_planned':date_cur,})
-
- wf_service.trg_validate(uid, 'stock.picking',new_picking,'button_confirm', cr)
- picking_obj.force_assign(cr, uid, [new_picking], context)
- # order_obj.write(cr,uid,data['id'],{'state':'done','last_out_picking':new_picking})
- order_obj.write(cr,uid,data['id'],{'last_out_picking':new_picking})
- return {}
-
-
-
-
-class wizard_return_picking(wizard.interface):
- states={
- 'init':{
- 'actions':[_get_returns],
- 'result':{'type':'form',
- 'arch':arch,
- 'fields':fields,
- 'state':[('end','Cancel', 'gtk-cancel'),('return','Return goods and Exchange', 'gtk-ok'),('return_w','Return without Refund','gtk-ok')]
- }
- },
- 'return':{
- 'actions':[],
- 'result':{ 'type': 'action',
- 'action' : _create_returns,
- 'state':'prod'}
- },
- 'prod':{
- 'actions':[],
- 'result': {
- 'type': 'form',
- 'arch': _form,
- 'fields':_fields,
- 'state': [('close','Close'),('choice','Continue')]
- }
- },
-# 'choice1' : {
-# 'actions' : [_add_pdct],
-# 'result' : {'type' : 'choice', 'next_state': _test_exist1 }
-# },
- 'choice' : {
- 'actions' : [],
- 'result' : {'type' : 'choice', 'next_state': _test_exist }
- },
-# 'choice_raise':{
-# 'actions':[],
-# 'result':{ 'type': 'action',
-# 'action' : _raise,
-# 'state':'end'}
-# },
- 'add_p' :{
- 'actions':[],
- 'result':{
- 'type':'action',
- 'action': _add_pdct,
- 'state': 'prod'}
- },
-# 'add_pp' :{
-# 'actions':[],
-# 'result':{
-# 'type':'action',
-# 'action': _add_pdct,
-# 'state': 'end'}
-# },
- 'receipt':{
- 'result': {
- 'type': 'print',
- 'report': 'pos.receipt',
- 'state': 'end'
- }
- },
- 'return_w':{
- 'actions':[],
- 'result':{'type':'action', 'action':_create_returns2, 'state':'end'}
- },
-
- 'close':{
- 'actions' : [],
- 'result' : {'type' : 'choice', 'next_state': _close }
- },
-
- 'check': {
- 'actions': [],
- 'result': {
- 'type': 'choice',
- 'next_state': _check,
- }
- },
-
- 'ask_pay': {
- 'actions': [_pre_init],
- 'result': {
- 'type': 'form',
- 'arch': payment_form,
- 'fields': payment_fields,
- 'state': (('end', 'Cancel'), ('add_pay', 'Ma_ke payment', 'gtk-ok', True)
- )
- }
- },
- 'add_pay': {
- 'actions': [_add_pay],
- 'result': {
- 'type': 'state',
- 'state': "check",
- }
- },
-
-
- 'invoice': {
- 'actions': [create_invoice],
- 'result': {
- 'type': 'print',
- 'report': 'pos.invoice',
- 'state': 'end'
- }
- },
- 'receipt': {
- 'actions': [],
- 'result': {
- 'type': 'print',
- 'report': 'pos.receipt',
- 'state': 'end'
- }
- },
- 'paid': {
- 'actions': [],
- 'result': {
- 'type': 'state',
- 'state': 'end'
- }
- },
-
- }
-wizard_return_picking('pos.return.picking')
-
-# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
diff --git a/addons/product/__openerp__.py b/addons/product/__openerp__.py
index 4128e992c82..b3e18ced10a 100644
--- a/addons/product/__openerp__.py
+++ b/addons/product/__openerp__.py
@@ -49,13 +49,13 @@
'update_xml': [
'security/product_security.xml',
'security/ir.model.access.csv',
+ 'wizard/product_price_view.xml',
'product_data.xml',
'product_report.xml',
'product_view.xml',
'pricelist_view.xml',
'partner_view.xml',
'company_view.xml',
- 'product_wizard.xml',
'process/product_process.xml'
],
'installable': True,
diff --git a/addons/product/i18n/tr.po b/addons/product/i18n/tr.po
index bb924db644c..62e52d410d2 100644
--- a/addons/product/i18n/tr.po
+++ b/addons/product/i18n/tr.po
@@ -7,13 +7,13 @@ msgstr ""
"Project-Id-Version: OpenERP Server 5.0.0_rc3\n"
"Report-Msgid-Bugs-To: support@openerp.com\n"
"POT-Creation-Date: 2009-08-28 16:01+0000\n"
-"PO-Revision-Date: 2010-02-27 08:20+0000\n"
-"Last-Translator: Oktay Altunergil \n"
+"PO-Revision-Date: 2010-05-10 16:32+0000\n"
+"Last-Translator: Angel Spy \n"
"Language-Team: \n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
-"X-Launchpad-Export-Date: 2010-04-17 04:10+0000\n"
+"X-Launchpad-Export-Date: 2010-05-11 04:19+0000\n"
"X-Generator: Launchpad (build Unknown)\n"
#. module: product
@@ -90,7 +90,7 @@ msgstr ""
#. module: product
#: field:product.packaging,width:0
msgid "Width"
-msgstr "En/Genişlik"
+msgstr "Genişlik"
#. module: product
#: help:product.pricelist.item,product_tmpl_id:0
diff --git a/addons/product/partner_view.xml b/addons/product/partner_view.xml
index 66e4ba84c37..6b756eb8d7f 100644
--- a/addons/product/partner_view.xml
+++ b/addons/product/partner_view.xml
@@ -9,7 +9,7 @@
-
+
diff --git a/addons/product/product.py b/addons/product/product.py
index b21ebe5ee3a..e8a226597e7 100644
--- a/addons/product/product.py
+++ b/addons/product/product.py
@@ -210,11 +210,11 @@ class product_category(osv.osv):
'sequence': fields.integer('Sequence', help="Gives the sequence order when displaying a list of product categories."),
'type': fields.selection([('view','View'), ('normal','Normal')], 'Category Type'),
}
-
+
_defaults = {
'type' : lambda *a : 'normal',
}
-
+
_order = "sequence"
def _check_recursion(self, cr, uid, ids):
level = 100
@@ -274,7 +274,7 @@ class product_template(osv.osv):
'sale_ok': fields.boolean('Can be Sold', help="Determines if the product can be visible in the list of product within a selection from a sale order line."),
'purchase_ok': fields.boolean('Can be Purchased', help="Determine if the product is visible in the list of products within a selection from a purchase order line."),
'state': fields.selection([('',''),('draft', 'In Development'),('sellable','In Production'),('end','End of Lifecycle'),('obsolete','Obsolete')], 'State', help="Tells the user if he can use the product or not."),
- 'uom_id': fields.many2one('product.uom', 'Default UoM', required=True, help="Default Unit of Measure used for all stock operation."),
+ 'uom_id': fields.many2one('product.uom', 'Default Unit Of Measure', required=True, help="Default Unit of Measure used for all stock operation."),
'uom_po_id': fields.many2one('product.uom', 'Purchase UoM', required=True, help="Default Unit of Measure used for purchase orders. It must be in the same category than the default unit of measure."),
'uos_id' : fields.many2one('product.uom', 'Unit of Sale',
help='Used by companies that manage two units of measure: invoicing and inventory management. For example, in food industries, you will manage a stock of ham but invoice in Kg. Keep empty to use the default UOM.'),
@@ -551,7 +551,7 @@ class product_product(osv.osv):
price_type_currency_id = pricetype_obj.browse(cr,uid,price_type_id).currency_id.id
res[product.id] = self.pool.get('res.currency').compute(cr, uid, price_type_currency_id,
context['currency_id'], res[product.id],context=context)
-
+
return res
def copy(self, cr, uid, id, default=None, context=None):
diff --git a/addons/product/product_view.xml b/addons/product/product_view.xml
index b9858e19eaf..24976a71533 100644
--- a/addons/product/product_view.xml
+++ b/addons/product/product_view.xml
@@ -607,6 +607,12 @@
+
+ Products
+ ir.ui.menu
+
+
+
+
+
+ Price List
+ product.price_list
+ form
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/addons/product/wizard/wizard_price.py b/addons/product/wizard/wizard_price.py
deleted file mode 100644
index 12c810b802d..00000000000
--- a/addons/product/wizard/wizard_price.py
+++ /dev/null
@@ -1,59 +0,0 @@
-# -*- coding: utf-8 -*-
-##############################################################################
-#
-# OpenERP, Open Source Management Solution
-# Copyright (C) 2004-2010 Tiny SPRL ().
-#
-# This program is free software: you can redistribute it and/or modify
-# it under the terms of the GNU Affero General Public License as
-# published by the Free Software Foundation, either version 3 of the
-# License, or (at your option) any later version.
-#
-# This program is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-# GNU Affero General Public License for more details.
-#
-# You should have received a copy of the GNU Affero General Public License
-# along with this program. If not, see .
-#
-##############################################################################
-
-import wizard
-
-qty1_form = '''
-
+
+ 15
+
+ Here are a few modules which might be useful along with the rest of the Manufacturing profile. You can also install them the normal way later on, but if you think you'll need them to fit your requirements, you can select them now and they'll be installed immediately.
- Manufacturing Modules
+ Stock & Manufacturing
-
@@ -52,5 +55,16 @@
3
+
+ ir.actions.todo
+ manufacturing_installer_action_replace
+ tree
+
+
+
+
+
+
+
diff --git a/addons/profile_tools/misc_tools_installer.xml b/addons/profile_tools/misc_tools_installer.xml
index 6f4a7aa9e9e..efef1dc3649 100644
--- a/addons/profile_tools/misc_tools_installer.xml
+++ b/addons/profile_tools/misc_tools_installer.xml
@@ -10,9 +10,12 @@
Tools Modules Installation
+
+
+
- Select Tools To Install
+ Tools
@@ -20,7 +23,6 @@
>Here are a few useful applications which, while they don't directly contribute to your business, can improve on it or improve your OpenERP experience
-
@@ -44,5 +46,16 @@
3
+
+ ir.actions.todo
+ misc_installer_action_replace
+ tree
+
+
+
+
+
+
+
diff --git a/addons/project/installer.py b/addons/project/installer.py
index 1848d1e300e..dd18a2937a2 100644
--- a/addons/project/installer.py
+++ b/addons/project/installer.py
@@ -52,4 +52,7 @@ class project_installer(osv.osv_memory):
help="Embeds the Getting Things Done concepts into OpenERP's "
"project management."),
}
+ _defaults={
+ 'project_crm': True,
+ }
project_installer()
diff --git a/addons/project/project.py b/addons/project/project.py
index 727f210a488..c7a1a8ae054 100644
--- a/addons/project/project.py
+++ b/addons/project/project.py
@@ -139,6 +139,7 @@ class project(osv.osv):
'active': lambda *a: True,
'priority': lambda *a: 1,
'sequence': lambda *a: 10,
+ 'warn_manager': lambda *a: True,
}
def _check_dates(self, cr, uid, ids):
leave = self.read(cr, uid, ids[0],['date_start','date'])
diff --git a/addons/project/project_installer.xml b/addons/project/project_installer.xml
index d7ca8c43989..a127333544f 100644
--- a/addons/project/project_installer.xml
+++ b/addons/project/project_installer.xml
@@ -13,21 +13,23 @@
Configure Your Project Management
+ >Project Management
+
+
+ Various OpenERP applications are available to bring your project management to the next levels of control and flexibility.
-
-
+
+
-
-
-
+
+
@@ -50,5 +52,16 @@
3
+
+ ir.actions.todo
+ project_installer_action_replace
+ tree
+
+
+
+
+
+
+
diff --git a/addons/project/project_view.xml b/addons/project/project_view.xml
index 6a74161b250..fa795c12d6a 100644
--- a/addons/project/project_view.xml
+++ b/addons/project/project_view.xml
@@ -110,7 +110,7 @@
-
+
@@ -136,7 +136,7 @@
treechild_ids
-
+
@@ -238,7 +238,7 @@
-
+
@@ -590,8 +590,8 @@
-
+
@@ -640,5 +640,6 @@
+
diff --git a/addons/project/report/project_report.py b/addons/project/report/project_report.py
index e4cd21f0b48..e099b4544aa 100644
--- a/addons/project/report/project_report.py
+++ b/addons/project/report/project_report.py
@@ -84,7 +84,7 @@ class report_project_task_user(osv.osv):
t.project_id,
t.state,
t.priority,
- t.name,
+ t.name as name,
t.company_id,
t.partner_id,
t.type,
diff --git a/addons/project/report/project_report_view.xml b/addons/project/report/project_report_view.xml
index 64fc88dc5ed..7990d7ab1aa 100644
--- a/addons/project/report/project_report_view.xml
+++ b/addons/project/report/project_report_view.xml
@@ -9,7 +9,7 @@
tree
-
+
@@ -121,6 +121,7 @@
+
diff --git a/addons/project_timesheet/report/task_report_view.xml b/addons/project_timesheet/report/task_report_view.xml
index e44e399b292..bd94592dee9 100644
--- a/addons/project_timesheet/report/task_report_view.xml
+++ b/addons/project_timesheet/report/task_report_view.xml
@@ -74,10 +74,6 @@
-
-
-
-
diff --git a/addons/purchase/__init__.py b/addons/purchase/__init__.py
index 41c673c0104..301e32ebca9 100644
--- a/addons/purchase/__init__.py
+++ b/addons/purchase/__init__.py
@@ -25,6 +25,7 @@ import stock
import wizard
import report
import stock
+import company
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
diff --git a/addons/purchase/__openerp__.py b/addons/purchase/__openerp__.py
index 6687b330b2c..909b785fe72 100644
--- a/addons/purchase/__openerp__.py
+++ b/addons/purchase/__openerp__.py
@@ -31,7 +31,7 @@
""",
'author': 'Tiny',
'website': 'http://www.openerp.com',
- 'depends': ['base', 'account', 'stock', 'process'],
+ 'depends': ['base', 'account', 'stock', 'process', 'mrp_procurement'],
'init_xml': [],
'update_xml': [
@@ -39,6 +39,7 @@
'security/ir.model.access.csv',
'purchase_workflow.xml',
'purchase_sequence.xml',
+ 'company_view.xml',
'purchase_data.xml',
'wizard/purchase_order_group_view.xml',
'wizard/purchase_installer.xml',
diff --git a/addons/purchase/company.py b/addons/purchase/company.py
new file mode 100644
index 00000000000..2a01605782c
--- /dev/null
+++ b/addons/purchase/company.py
@@ -0,0 +1,36 @@
+# -*- coding: utf-8 -*-
+##############################################################################
+#
+# OpenERP, Open Source Management Solution
+# Copyright (C) 2004-2010 Tiny SPRL ().
+#
+# This program is free software: you can redistribute it and/or modify
+# it under the terms of the GNU Affero General Public License as
+# published by the Free Software Foundation, either version 3 of the
+# License, or (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU Affero General Public License for more details.
+#
+# You should have received a copy of the GNU Affero General Public License
+# along with this program. If not, see .
+#
+##############################################################################
+
+from osv import osv,fields
+
+class company(osv.osv):
+ _inherit = 'res.company'
+ _columns = {
+ 'po_lead': fields.float('Purchase Lead Time', required=True,
+ help="This is the leads/security time for each purchase order."),
+ }
+ _defaults = {
+ 'po_lead': lambda *a: 1.0,
+ }
+company()
+
+
+# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
diff --git a/addons/purchase/company_view.xml b/addons/purchase/company_view.xml
new file mode 100644
index 00000000000..d7707fe32c7
--- /dev/null
+++ b/addons/purchase/company_view.xml
@@ -0,0 +1,18 @@
+
+
+
+
+
+ res.company.mrp.config
+ res.company
+ form
+
+
+
+
+
+
+
+
+
+
diff --git a/addons/purchase/i18n/ru.po b/addons/purchase/i18n/ru.po
index 7fc35a5db72..f86e7b2def6 100644
--- a/addons/purchase/i18n/ru.po
+++ b/addons/purchase/i18n/ru.po
@@ -7,13 +7,13 @@ msgstr ""
"Project-Id-Version: OpenERP Server 5.0.4\n"
"Report-Msgid-Bugs-To: support@openerp.com\n"
"POT-Creation-Date: 2009-08-28 16:01+0000\n"
-"PO-Revision-Date: 2009-02-03 10:09+0000\n"
-"Last-Translator: Fabien (Open ERP) \n"
+"PO-Revision-Date: 2010-05-06 12:53+0000\n"
+"Last-Translator: g0nz1k12 \n"
"Language-Team: \n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
-"X-Launchpad-Export-Date: 2010-04-17 03:59+0000\n"
+"X-Launchpad-Export-Date: 2010-05-07 04:02+0000\n"
"X-Generator: Launchpad (build Unknown)\n"
#. module: purchase
@@ -69,7 +69,7 @@ msgstr ""
#. module: purchase
#: model:process.node,name:purchase.process_node_confirmpurchaseorder0
msgid "Confirmed Purchase"
-msgstr ""
+msgstr "Подтвержденные Заказы"
#. module: purchase
#: selection:purchase.order,state:0
@@ -236,7 +236,7 @@ msgstr "НДС :"
#. module: purchase
#: rml:purchase.quotation:0
msgid "Tel.:"
-msgstr ""
+msgstr "Тел.:"
#. module: purchase
#: field:purchase.order.line,account_analytic_id:0
diff --git a/addons/purchase/purchase.py b/addons/purchase/purchase.py
index 2bcc62c06ac..a7d69159873 100644
--- a/addons/purchase/purchase.py
+++ b/addons/purchase/purchase.py
@@ -19,6 +19,7 @@
#
##############################################################################
+from mx import DateTime
from osv import fields
from osv import osv
import time
@@ -692,5 +693,86 @@ class purchase_order_line(osv.osv):
return True
purchase_order_line()
+class mrp_procurement(osv.osv):
+ _inherit = 'mrp.procurement'
+ _columns = {
+ 'purchase_id': fields.many2one('purchase.order', 'Purchase Order'),
+ }
+
+ def action_po_assign(self, cr, uid, ids, context={}):
+ """ This is action which call from workflow to assign purchase order to procurements
+ @return: True
+ """
+ res = self.make_po(cr, uid, ids, context=context)
+ res = res.values()
+ return len(res) and res[0] or 0 #TO CHECK: why workflow is generated error if return not integer value
+
+ def make_po(self, cr, uid, ids, context={}):
+ """ Make purchase order from procurement
+ @return: New created Purchase Orders procurement wise
+ """
+ res = {}
+ company = self.pool.get('res.users').browse(cr, uid, uid, context).company_id
+ partner_obj = self.pool.get('res.partner')
+ uom_obj = self.pool.get('product.uom')
+ pricelist_obj = self.pool.get('product.pricelist')
+ prod_obj = self.pool.get('product.product')
+ acc_pos_obj = self.pool.get('account.fiscal.position')
+ po_obj = self.pool.get('purchase.order')
+ for procurement in self.browse(cr, uid, ids):
+ res_id = procurement.move_id.id
+ partner = procurement.product_id.seller_ids[0].name
+ partner_id = partner.id
+ address_id = partner_obj.address_get(cr, uid, [partner_id], ['delivery'])['delivery']
+ pricelist_id = partner.property_product_pricelist_purchase.id
+
+ uom_id = procurement.product_id.uom_po_id.id
+
+ qty = uom_obj._compute_qty(cr, uid, procurement.product_uom.id, procurement.product_qty, uom_id)
+ if procurement.product_id.seller_ids[0].qty:
+ qty = max(qty,procurement.product_id.seller_ids[0].qty)
+
+ price = pricelist_obj.price_get(cr, uid, [pricelist_id], procurement.product_id.id, qty, False, {'uom': uom_id})[pricelist_id]
+
+ newdate = DateTime.strptime(procurement.date_planned, '%Y-%m-%d %H:%M:%S')
+ newdate = newdate - DateTime.RelativeDateTime(days=company.po_lead)
+ newdate = newdate - procurement.product_id.seller_ids[0].delay
+
+ #Passing partner_id to context for purchase order line integrity of Line name
+ context.update({'lang': partner.lang, 'partner_id': partner_id})
+
+ product = prod_obj.browse(cr, uid, procurement.product_id.id, context=context)
+
+ line = {
+ 'name': product.partner_ref,
+ 'product_qty': qty,
+ 'product_id': procurement.product_id.id,
+ 'product_uom': uom_id,
+ 'price_unit': price,
+ 'date_planned': newdate.strftime('%Y-%m-%d %H:%M:%S'),
+ 'move_dest_id': res_id,
+ 'notes': product.description_purchase,
+ }
+
+ taxes_ids = procurement.product_id.product_tmpl_id.supplier_taxes_id
+ taxes = acc_pos_obj.map_tax(cr, uid, partner.property_account_position, taxes_ids)
+ line.update({
+ 'taxes_id': [(6,0,taxes)]
+ })
+ purchase_id = po_obj.create(cr, uid, {
+ 'origin': procurement.origin,
+ 'partner_id': partner_id,
+ 'partner_address_id': address_id,
+ 'location_id': procurement.location_id.id,
+ 'pricelist_id': pricelist_id,
+ 'order_line': [(0,0,line)],
+ 'company_id': procurement.company_id.id,
+ 'fiscal_position': partner.property_account_position and partner.property_account_position.id or False
+ })
+ res[procurement.id] = purchase_id
+ self.write(cr, uid, [procurement.id], {'state': 'running', 'purchase_id': purchase_id})
+ return res
+mrp_procurement()
+
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
diff --git a/addons/purchase/purchase_view.xml b/addons/purchase/purchase_view.xml
index c301116db2a..555d1fb085c 100644
--- a/addons/purchase/purchase_view.xml
+++ b/addons/purchase/purchase_view.xml
@@ -289,7 +289,8 @@
id="action_purchase_line_product_tree"
name="Product purchases"
res_model="purchase.order.line"
- src_model="product.product"/>
+ src_model="product.product"
+ groups="base.group_extended"/>
+
+
+ mrp.procurement.form.inherit
+ mrp.procurement
+
+ form
+
+
+
+
+
+
diff --git a/addons/purchase/purchase_workflow.xml b/addons/purchase/purchase_workflow.xml
index 26f83d5a554..d7684be1875 100644
--- a/addons/purchase/purchase_workflow.xml
+++ b/addons/purchase/purchase_workflow.xml
@@ -177,6 +177,33 @@
+
+
+
+
+ buy
+ subflow
+
+ action_po_assign()
+
+
+
+
+
+ check_buy()
+
+
+
+
+
+ subflow.delivery_done
+
+
+
+
+
+ subflow.cancel
+
diff --git a/addons/purchase/wizard/purchase_installer.xml b/addons/purchase/wizard/purchase_installer.xml
index 77bbef10453..b105b6ba3aa 100644
--- a/addons/purchase/wizard/purchase_installer.xml
+++ b/addons/purchase/wizard/purchase_installer.xml
@@ -11,7 +11,9 @@
-
+
+
+ Select Reporting Tools To Install
+ >Reporting Tools
@@ -21,7 +23,6 @@
>OpenERP's built-in reporting abilities can be improved even further with some of the following applications
-
@@ -44,5 +45,16 @@
3
+
+ ir.actions.todo
+ report_designer_installer_action_replace
+ tree
+
+
+
+
+
+
+
diff --git a/addons/report_purchase/i18n/pl.po b/addons/report_purchase/i18n/pl.po
index 25e17d830de..8ddcba983bd 100644
--- a/addons/report_purchase/i18n/pl.po
+++ b/addons/report_purchase/i18n/pl.po
@@ -7,20 +7,20 @@ msgstr ""
"Project-Id-Version: OpenERP Server 5.0.0\n"
"Report-Msgid-Bugs-To: support@openerp.com\n"
"POT-Creation-Date: 2009-08-28 16:01+0000\n"
-"PO-Revision-Date: 2009-11-17 10:25+0000\n"
-"Last-Translator: Fabien (Open ERP) \n"
+"PO-Revision-Date: 2010-05-05 06:46+0000\n"
+"Last-Translator: Wojtek Kubiak \n"
"Language-Team: \n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
-"X-Launchpad-Export-Date: 2010-04-17 03:54+0000\n"
+"X-Launchpad-Export-Date: 2010-05-06 04:03+0000\n"
"X-Generator: Launchpad (build Unknown)\n"
#. module: report_purchase
#: field:report.purchase.order.category,price_average:0
#: field:report.purchase.order.product,price_average:0
msgid "Average Price"
-msgstr "Cena przeciętna"
+msgstr "Średnia cena"
#. module: report_purchase
#: field:report.purchase.order.category,state:0
@@ -49,7 +49,7 @@ msgstr "Zakupy wg produktów"
#. module: report_purchase
#: constraint:ir.actions.act_window:0
msgid "Invalid model name in the action definition."
-msgstr ""
+msgstr "Nieprawidłowa nazwa modelu w definicji akcji."
#. module: report_purchase
#: model:ir.ui.menu,name:report_purchase.next_id_75
diff --git a/addons/sale/__init__.py b/addons/sale/__init__.py
index ebc12a1089e..71f33623c55 100644
--- a/addons/sale/__init__.py
+++ b/addons/sale/__init__.py
@@ -26,9 +26,10 @@
import sale
import stock
import product
-import mrp
+#import mrp
import wizard
import report
+import company
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
diff --git a/addons/sale/__openerp__.py b/addons/sale/__openerp__.py
index a6ff79b38cd..23e72c60775 100644
--- a/addons/sale/__openerp__.py
+++ b/addons/sale/__openerp__.py
@@ -42,13 +42,14 @@
""",
'author': 'Tiny',
'website': 'http://www.openerp.com',
- 'depends': ['product', 'stock', 'mrp', 'process'],
+ 'depends': ['product', 'stock', 'mrp_procurement', 'process'],
'init_xml': [],
'update_xml': [
'wizard/sale_make_invoice_advance.xml',
'wizard/sale_line_invoice.xml',
'security/sale_security.xml',
'security/ir.model.access.csv',
+ 'company_view.xml',
'sale_workflow.xml',
'sale_sequence.xml',
'sale_data.xml',
@@ -56,7 +57,7 @@
'report/sale_report_view.xml',
'sale_report.xml',
'stock_view.xml',
- 'process/sale_process.xml',
+# 'process/sale_process.xml',
],
'demo_xml': ['sale_demo.xml'],
'installable': True,
diff --git a/addons/sale/company.py b/addons/sale/company.py
new file mode 100644
index 00000000000..401a1a9c1d8
--- /dev/null
+++ b/addons/sale/company.py
@@ -0,0 +1,37 @@
+# -*- coding: utf-8 -*-
+##############################################################################
+#
+# OpenERP, Open Source Management Solution
+# Copyright (C) 2004-2010 Tiny SPRL ().
+#
+# This program is free software: you can redistribute it and/or modify
+# it under the terms of the GNU Affero General Public License as
+# published by the Free Software Foundation, either version 3 of the
+# License, or (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU Affero General Public License for more details.
+#
+# You should have received a copy of the GNU Affero General Public License
+# along with this program. If not, see .
+#
+##############################################################################
+
+from osv import osv,fields
+
+class company(osv.osv):
+ _inherit = 'res.company'
+ _columns = {
+ 'security_lead': fields.float('Security Days', required=True,
+ help="This is the days added to what you promise to customers "\
+ "for security purpose"),
+ }
+ _defaults = {
+ 'security_lead': lambda *a: 5.0,
+ }
+company()
+
+
+# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
diff --git a/addons/sale/company_view.xml b/addons/sale/company_view.xml
new file mode 100644
index 00000000000..ead9128d6f3
--- /dev/null
+++ b/addons/sale/company_view.xml
@@ -0,0 +1,18 @@
+
+
+
+
+
+ res.company.mrp.config
+ res.company
+ form
+
+
+
+
+
+
+
+
+
+
diff --git a/addons/sale/i18n/it.po b/addons/sale/i18n/it.po
index 846764f2ee5..0b2dd5cc4bb 100644
--- a/addons/sale/i18n/it.po
+++ b/addons/sale/i18n/it.po
@@ -7,13 +7,13 @@ msgstr ""
"Project-Id-Version: OpenERP Server 5.0.0_rc3\n"
"Report-Msgid-Bugs-To: support@openerp.com\n"
"POT-Creation-Date: 2009-08-28 16:01+0000\n"
-"PO-Revision-Date: 2010-03-18 10:45+0000\n"
-"Last-Translator: Carlo Vettore \n"
+"PO-Revision-Date: 2010-05-09 16:30+0000\n"
+"Last-Translator: eLBati - albatos.com \n"
"Language-Team: \n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
-"X-Launchpad-Export-Date: 2010-04-17 04:09+0000\n"
+"X-Launchpad-Export-Date: 2010-05-10 04:17+0000\n"
"X-Generator: Launchpad (build Unknown)\n"
#. module: sale
@@ -861,6 +861,17 @@ msgid ""
" - The 'Invoice from the packing' choice is used to create an invoice "
"during the packing process."
msgstr ""
+"La politica di spedizione è utilizzata per sincronizzare le operazioni di "
+"fatturazione e consegna\n"
+" - La scelta 'Pagamento prima della consegna' dapprima genererà la fattura "
+"e poi, dopo il pagamento di questa fattura, genererà il DDT.\n"
+" - 'Spedizione e fatturazione manuale' genererà direttamente il DDT e "
+"attenderà che l'utente clicchi manualmente sul bottone \"Crea fattura\" per "
+"generare la bozza di fattura.\n"
+" - 'Fattura su ordine a consegna effettuata' genererà la bozza di fattura "
+"basata sull'ordine di vendita dopo che la merce sia uscita.\n"
+" - 'Fattura da DDT' è utilizzato per creare una fattura durante il processo "
+"di spedizione."
#. module: sale
#: rml:sale.order:0
diff --git a/addons/sale/process/sale_process.xml b/addons/sale/process/sale_process.xml
index 5da1a96f8d4..58e4be14d84 100644
--- a/addons/sale/process/sale_process.xml
+++ b/addons/sale/process/sale_process.xml
@@ -35,7 +35,7 @@
-
+
@@ -63,12 +63,12 @@
-
-
+
+
-
+
@@ -202,7 +202,7 @@
-
+
diff --git a/addons/sale/sale_demo.xml b/addons/sale/sale_demo.xml
index 259b5d75e39..d6ab6a7bc0c 100644
--- a/addons/sale/sale_demo.xml
+++ b/addons/sale/sale_demo.xml
@@ -1,6 +1,16 @@
+
+
+
+
+
+
+
+
+
@@ -188,7 +188,7 @@
-
+
@@ -395,9 +395,9 @@
icon="gtk-cancel" />
-
-
-
+
+
+
@@ -486,7 +486,7 @@
-
+
@@ -502,12 +502,18 @@