Kirti Savalia(OpenERP) has proposed merging lp:~openerp-dev/openobject-addons/ksa-addons2 into lp:~openerp-dev/openobject-addons/trunk-dev-addons2.
Requested reviews: OpenERP Core Team (openerp) Related bugs: #500931 No analytic entry is generated finishing one production order https://bugs.launchpad.net/bugs/500931 #543979 product: check uos not necessary https://bugs.launchpad.net/bugs/543979 #623680 [5.0] stock - Stock Inventory with date past https://bugs.launchpad.net/bugs/623680 #674551 "qunatity" in MRP https://bugs.launchpad.net/bugs/674551 #674578 no pdf report "delivery order" in warehouse management https://bugs.launchpad.net/bugs/674578 #675418 account moves with same account in debit and credit https://bugs.launchpad.net/bugs/675418 #677437 Production : done moves should not be re-considered while completing production order https://bugs.launchpad.net/bugs/677437 #680916 "Work center" spelling is inconsistent https://bugs.launchpad.net/bugs/680916 #683231 [6.0][purchase] destination address inside company makes picking to "customer" location https://bugs.launchpad.net/bugs/683231 #687352 remove the domain on the filter field in segment https://bugs.launchpad.net/bugs/687352 #687360 Warehouse : change order of buttons in incoming and outgoingview https://bugs.launchpad.net/bugs/687360 #690583 stock.picking.test_finished: write() takes at most 6 arguments (8 given) https://bugs.launchpad.net/bugs/690583 #690700 [purchase-stock] Wrong Partner used when invoicing from picking coming from a puchase with sent_to_address https://bugs.launchpad.net/bugs/690700 #691901 [6.0] delivery data.xml contains demo data https://bugs.launchpad.net/bugs/691901 #692461 [6.0] wiki_faq - update problem - reloads template https://bugs.launchpad.net/bugs/692461 #692467 menuitem for price.type object is missing https://bugs.launchpad.net/bugs/692467 #695343 mrp_repair doesn't work with products with lot tracking https://bugs.launchpad.net/bugs/695343 #697273 [6.0 rc2] regression - cannot specify dedicated inventory accounts for periodical inventory or production https://bugs.launchpad.net/bugs/697273 #697554 Custom Reports do not display any values https://bugs.launchpad.net/bugs/697554 #699821 add access group on button used to update stock on product https://bugs.launchpad.net/bugs/699821 #701017 Duplication of product should not duplicate its BoM if the product is a component. https://bugs.launchpad.net/bugs/701017 #704289 "Deliveries to Invoice" lists "Put in new pack" twice https://bugs.launchpad.net/bugs/704289 #710516 [Trunk] purchase: Try to select partner address which has no partner on it https://bugs.launchpad.net/bugs/710516 For more details, see: https://code.launchpad.net/~openerp-dev/openobject-addons/ksa-addons2/+merge/47976 https://bugs.launchpad.net/openobject-addons/+bug/710516 -- https://code.launchpad.net/~openerp-dev/openobject-addons/ksa-addons2/+merge/47976 Your team OpenERP R&D Team is subscribed to branch lp:~openerp-dev/openobject-addons/ksa-addons2.
=== modified file 'mrp/wizard/change_production_qty.py' --- mrp/wizard/change_production_qty.py 2011-01-14 00:11:01 +0000 +++ mrp/wizard/change_production_qty.py 2011-01-31 10:15:00 +0000 @@ -1,6 +1,6 @@ # -*- coding: utf-8 -*- ############################################################################## -# +# # OpenERP, Open Source Management Solution # Copyright (C) 2004-2010 Tiny SPRL (<http://tiny.be>). # @@ -15,7 +15,7 @@ # GNU Affero General Public License for more details. # # You should have received a copy of the GNU Affero General Public License -# along with this program. If not, see <http://www.gnu.org/licenses/>. +# along with this program. If not, see <http://www.gnu.org/licenses/>. # ############################################################################## @@ -25,7 +25,7 @@ class change_production_qty(osv.osv_memory): _name = 'change.production.qty' _description = 'Change Quantity of Products' - + _columns = { 'product_qty': fields.float('Product Qty', required=True), } @@ -35,28 +35,28 @@ @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. - """ + @param fields: List of fields for which we want default values + @param context: A standard dictionary + @return: A dictionary which of fields with values. + """ if context is None: context = {} - res = super(change_production_qty, self).default_get(cr, uid, fields, context=context) + res = super(change_production_qty, self).default_get(cr, uid, fields, context=context) prod_obj = self.pool.get('mrp.production') prod = prod_obj.browse(cr, uid, context.get('active_id'), context=context) if 'product_qty' in fields: - res.update({'product_qty': prod.product_qty}) + res.update({'product_qty': prod.product_qty}) return res - + def change_prod_qty(self, cr, uid, ids, context=None): - """ + """ Changes the Quantity of Product. @param self: The object pointer. @param cr: A database cursor @param uid: ID of the user currently logged in - @param ids: List of IDs selected - @param context: A standard dictionary - @return: + @param ids: List of IDs selected + @param context: A standard dictionary + @return: """ record_id = context and context.get('active_id',False) assert record_id, _('Active Id is not found') @@ -66,7 +66,7 @@ prod = prod_obj.browse(cr, uid, record_id, context=context) prod_obj.write(cr, uid,prod.id, {'product_qty': wiz_qty.product_qty}) prod_obj.action_compute(cr, uid, [prod.id]) - + move_lines_obj = self.pool.get('stock.move') for move in prod.move_lines: bom_point = prod.bom_id @@ -77,10 +77,10 @@ raise osv.except_osv(_('Error'), _("Couldn't find bill of material for product")) prod_obj.write(cr, uid, [prod.id], {'bom_id': bom_id}) bom_point = bom_obj.browse(cr, uid, [bom_id])[0] - + if not bom_id: raise osv.except_osv(_('Error'), _("Couldn't find bill of material for product")) - + factor = prod.product_qty * prod.product_uom.factor / bom_point.product_uom.factor res = bom_obj._bom_explode(cr, uid, bom_point, factor / bom_point.product_qty, []) for r in res[0]: @@ -88,9 +88,9 @@ move_lines_obj.write(cr, uid, [move.id], {'product_qty' : r['product_qty']}) for m in prod.move_created_ids: move_lines_obj.write(cr, uid, [m.id], {'product_qty': wiz_qty.product_qty}) - + return {} - + change_production_qty() # vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4: === modified file 'procurement/__openerp__.py' --- procurement/__openerp__.py 2011-01-17 13:51:36 +0000 +++ procurement/__openerp__.py 2011-01-31 10:15:00 +0000 @@ -46,6 +46,7 @@ 'board_mrp_procurement_view.xml', ], 'demo_xml': ['stock_orderpoint.xml'], + 'test': ['test/procurement_test.yml'], 'installable': True, 'active': False, 'certificate': '00954248826881074509', === modified file 'procurement/procurement_view.xml' --- procurement/procurement_view.xml 2011-01-17 13:55:22 +0000 +++ procurement/procurement_view.xml 2011-01-31 10:15:00 +0000 @@ -28,6 +28,7 @@ <field name="name">procurement.order.tree.board</field> <field name="model">procurement.order</field> <field name="type">tree</field> + <field eval="20" name="priority"/> <field name="arch" type="xml"> <tree string="Procurement Lines" colors="red:date_planned<current_date and state in ('exception');black:state=='running';darkgreen:state=='confirmed';gray:state in ['done','cancel'];blue:state in ('ready')"> <field name="date_planned" widget="date"/> @@ -246,8 +247,8 @@ <act_window context="{'search_default_warehouse_id': active_id}" id="act_stock_warehouse_2_stock_warehouse_orderpoint" - name="Minimum Stock Rules" - res_model="stock.warehouse.orderpoint" + name="Minimum Stock Rules" + res_model="stock.warehouse.orderpoint" src_model="stock.warehouse" groups="stock.group_stock_user"/> === added directory 'procurement/test' === added file 'procurement/test/procurement_test.yml' --- procurement/test/procurement_test.yml 1970-01-01 00:00:00 +0000 +++ procurement/test/procurement_test.yml 2011-01-31 10:15:00 +0000 @@ -0,0 +1,60 @@ +- + In order to test the Procurement flow,I start by creating a new product 'Apple' +- + !record {model: product.product, id: product_product_apple0}: + categ_id: product.cat1 + name: Apple + procure_method: make_to_stock + seller_ids: + - delay: 1 + name: base.res_partner_asus + min_qty: 1.0 + product_uom: product.product_uom_kgm + supply_method: buy + type: product + uom_id: product.product_uom_kgm + uom_po_id: product.product_uom_kgm + property_stock_inventory: stock.location_inventory + property_stock_procurement: stock.location_procurement + property_stock_production: stock.location_production +- + I define Minimum stock rules for my stockable product "Apple". +- + !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_apple0 + product_max_qty: 10.0 + product_min_qty: 5.0 + product_uom: product.product_uom_kgm + qty_multiple: 1 + warehouse_id: stock.warehouse0 +- + The scheduler runs. +- + !function {model: procurement.order, name: run_scheduler}: + - model: procurement.order + search: "[]" +- + I also check that there are procurement order for Apple or not. +- + !python {model: procurement.order}: | + proc_ids = self.search(cr, uid, [('product_id','in',[ref('product_product_apple0')])]) + assert proc_ids, 'No Procurements.' +- + Apply Request for Procurement clicking on "Procurement Request" From Product. +- + !record {model: make.procurement, id: procurement_order_apple0}: + product_id: product_product_apple0 + qty: 10.0 + date_planned: '2010-04-20' + uom_id: product.product_uom_kgm + warehouse_id: stock.warehouse0 +- + Create procurement order for selected product. +- + !python {model: make.procurement}: | + self.make_procurement(cr, uid, [ref('procurement_order_apple0')], context={'active_id': ref('product_product_apple0')}) + === modified file 'purchase/purchase.py' --- purchase/purchase.py 2011-01-24 16:13:46 +0000 +++ purchase/purchase.py 2011-01-31 10:15:00 +0000 @@ -170,7 +170,7 @@ 'partner_id':fields.many2one('res.partner', 'Supplier', required=True, states={'confirmed':[('readonly',True)], 'approved':[('readonly',True)],'done':[('readonly',True)]}, change_default=True), 'partner_address_id':fields.many2one('res.partner.address', 'Address', required=True, states={'confirmed':[('readonly',True)], 'approved':[('readonly',True)],'done':[('readonly',True)]},domain="[('partner_id', '=', partner_id)]"), - 'dest_address_id':fields.many2one('res.partner.address', 'Destination Address', + 'dest_address_id':fields.many2one('res.partner.address', 'Destination Address',domain="[('partner_id', '<>', partner_id)]", states={'confirmed':[('readonly',True)], 'approved':[('readonly',True)],'done':[('readonly',True)]}, help="Put an address if you want to deliver directly from the supplier to the customer." \ "In this case, it will remove the warehouse link and set the customer location." === modified file 'stock/stock.py' --- stock/stock.py 2011-01-24 16:13:46 +0000 +++ stock/stock.py 2011-01-31 10:15:00 +0000 @@ -1463,7 +1463,7 @@ _description = "Stock Move" _order = 'date_expected desc, id' _log_create = False - + def action_partial_move(self, cr, uid, ids, context=None): if context is None: context = {} partial_id = self.pool.get("stock.partial.move").create( @@ -1481,7 +1481,7 @@ 'domain': '[]', 'context': context } - + def name_get(self, cr, uid, ids, context=None): res = [] @@ -1855,11 +1855,6 @@ """ moves = self.browse(cr, uid, ids, context=context) self.write(cr, uid, ids, {'state': 'confirmed'}) - res_obj = self.pool.get('res.company') - location_obj = self.pool.get('stock.location') - move_obj = self.pool.get('stock.move') - wf_service = netsvc.LocalService("workflow") - self.create_chained_picking(cr, uid, moves, context) return []
_______________________________________________ Mailing list: https://launchpad.net/~openerp-dev-gtk Post to : [email protected] Unsubscribe : https://launchpad.net/~openerp-dev-gtk More help : https://help.launchpad.net/ListHelp

