← Back to team overview

openerp-dev-web team mailing list archive

[Merge] lp:~openerp-dev/openobject-addons/ron-dev-addons2 into lp:~openerp-dev/openobject-addons/trunk-dev-addons2

 

ron(openerp) has proposed merging lp:~openerp-dev/openobject-addons/ron-dev-addons2 into lp:~openerp-dev/openobject-addons/trunk-dev-addons2.

Requested reviews:
  OpenERP Core Team (openerp)
Related bugs:
  #666362 [6.0RC1] sale Invoice Control "Not from Picking" is bad wording
  https://bugs.launchpad.net/bugs/666362
  #667246 Wrong Journals when creating an invoice from picking
  https://bugs.launchpad.net/bugs/667246
  #667324 invoicing control in purchase orders
  https://bugs.launchpad.net/bugs/667324
  #669210 [trunk][mrp] stock_move.action_consume raises exception
  https://bugs.launchpad.net/bugs/669210


>if chain location type fixed then chain_location_id is required on Product
>lp:-667246:-Wrong Journals when creating an invoice from picking
>lp:-669210:-{mrp] stock_move.action_consume raises exception
>Update CSV File For Access Right on Wharehouse Module

-- 
https://code.launchpad.net/~openerp-dev/openobject-addons/ron-dev-addons2/+merge/40059
Your team OpenERP R&D Team is subscribed to branch lp:~openerp-dev/openobject-addons/ron-dev-addons2.
=== modified file 'account/account_invoice_view.xml'
--- account/account_invoice_view.xml	2010-11-01 05:50:03 +0000
+++ account/account_invoice_view.xml	2010-11-04 09:04:54 +0000
@@ -458,7 +458,6 @@
             <field name="view_mode">tree,form,calendar,graph</field>
             <field eval="False" name="view_id"/>
             <field name="domain">[('type','=','in_invoice')]</field>
-            <field name="context">{'type':'in_invoice', 'journal_type': 'purchase'}</field>
             <field name="search_view_id" ref="view_account_invoice_filter"/>
             <field name="help">Supplier Invoices allows you to enter and manage invoices issued by your suppliers. OpenERP generates draft of supplier invoices automatically so that you can control what you received from your supplier according to what you purchased or received.</field>
         </record>

=== modified file 'mrp/security/ir.model.access.csv'
--- mrp/security/ir.model.access.csv	2010-10-16 16:47:09 +0000
+++ mrp/security/ir.model.access.csv	2010-11-04 09:04:54 +0000
@@ -67,3 +67,4 @@
 "access_stock_picking_mrp_manager","stock.picking mrp_manager","stock.model_stock_picking","mrp.group_mrp_manager",1,0,0,0
 "access_report_mrp_inout_user","report.mrp.inout user","model_report_mrp_inout","mrp.group_mrp_user",1,0,0,0
 "access_report_workcenter_load_user","report.workcenter.load.user","model_report_workcenter_load","mrp.group_mrp_user",1,0,0,0
+"access_mrp_bom","mrp.bom","model_mrp_bom","base.group_sale_salesman",1,0,0,0

=== modified file 'sale/security/ir.model.access.csv'
--- sale/security/ir.model.access.csv	2010-10-17 21:30:29 +0000
+++ sale/security/ir.model.access.csv	2010-11-04 09:04:54 +0000
@@ -1,5 +1,5 @@
 "id","name","model_id:id","group_id:id","perm_read","perm_write","perm_create","perm_unlink"
-"access_sale_shop","sale.shop","model_sale_shop","base.group_user",1,0,0,0
+"access_sale_shop","sale.shop","model_sale_shop","base.group_user",1,1,0,0
 "access_sale_order","sale.order","model_sale_order","base.group_sale_salesman",1,1,1,0
 "access_sale_order_line","sale.order.line","model_sale_order_line","base.group_sale_salesman",1,1,1,1
 "access_account_invoice_tax_salesman","account_invoice_tax salesman","account.model_account_invoice_tax","base.group_sale_salesman",1,1,1,0

=== modified file 'stock/stock.py'
--- stock/stock.py	2010-11-01 05:50:03 +0000
+++ stock/stock.py	2010-11-04 09:04:54 +0000
@@ -2231,7 +2231,7 @@
                 quantity_rest = quantity
                 uos_qty_rest =  uos_qty
                 if move.product_id.track_production and location_id:
-                    res += self.split_lines(cr, uid, [move.id], quantity_rest, split_by_qty=1, context=context)
+                    res += self.action_split(cr, uid, [move.id], quantity_rest, split_by_qty=1, context=context)
                 else:
                     res += [move.id]
                     update_val = {

=== modified file 'stock/stock_view.xml'
--- stock/stock_view.xml	2010-10-29 05:22:01 +0000
+++ stock/stock_view.xml	2010-11-04 09:04:54 +0000
@@ -304,7 +304,7 @@
                         <page string="Stock Moves">
                             <field colspan="2" name="move_ids" nolabel="1" widget="one2many_list">
                                 <tree  string="Stock Moves">
- 									<field name="picking_id" string="Reference"/>                                
+ 									<field name="picking_id" string="Reference"/>
 									<field name="origin"/>
 									<field name="partner_id"/>
                                     <field name="product_id"/>
@@ -317,7 +317,7 @@
                                     <field name="location_dest_id"/>
                                     <field name="state"/>
                                 </tree>
-                             </field>                            
+                             </field>
                         </page>
                     </notebook>
                 </form>
@@ -449,7 +449,7 @@
                     <group col="2" colspan="2" groups="base.group_extended">
                         <separator string="Chained Locations" colspan="2"/>
                         <field name="chained_location_type"/>
-                        <field name="chained_location_id"/>
+                        <field name="chained_location_id"  attrs="{'required':[('chained_location_type','=','fixed')]}"/>
                         <field name="chained_auto_packing"/>
                         <field name="chained_delay"/>
                         <field name="chained_journal_id"/>

=== modified file 'stock/wizard/stock_invoice_onshipping.py'
--- stock/wizard/stock_invoice_onshipping.py	2010-10-15 11:58:17 +0000
+++ stock/wizard/stock_invoice_onshipping.py	2010-11-04 09:04:54 +0000
@@ -24,14 +24,52 @@
 from tools.translate import _
 
 class stock_invoice_onshipping(osv.osv_memory):
+
+    def _get_journal_id(self, cr, uid, context=None):
+        if context is None:
+            context = {}
+
+        model = context.get('active_model')
+        if not model or model != 'stock.picking':
+            return []
+
+        model_pool = self.pool.get(model)
+        acct_obj = self.pool.get('account.journal')
+        res_ids = context and context.get('active_ids', [])
+        vals=[]
+        pick_types = list(set(map(lambda x: x.type, model_pool.browse(cr, uid, res_ids, context=context))))
+        for type in pick_types:
+            if type == 'out':
+               value = acct_obj.search(cr, uid, [('type', 'in',('sale','sale_refund') )])
+               for jr_type in acct_obj.browse(cr, uid, value, context=context):
+                   t1 = jr_type.id,jr_type.name
+                   vals.append(t1)
+
+            elif type == 'in':
+               value = acct_obj.search(cr, uid, [('type', 'in',('purchase','purchase_refund') )])
+               for jr_type in acct_obj.browse(cr, uid, value, context=context):
+                   t1 = jr_type.id,jr_type.name
+                   vals.append(t1)
+            else:
+               value = acct_obj.search(cr, uid, [('type', 'in',('cash','bank','general','situation') )])
+               for jr_type in acct_obj.browse(cr, uid, value, context=context):
+                   t1 = jr_type.id,jr_type.name
+                   vals.append(t1)
+        return vals
+
+
     _name = "stock.invoice.onshipping"
     _description = "Stock Invoice Onshipping"
+
+
     _columns = {
-        'journal_id': fields.many2one('account.journal', 'Destination Journal', required=True),
+#        'journal_id': fields.many2one('account.journal', 'Destination Journal', required=True,selection=_get_journal_id),
+        'journal_id': fields.selection(_get_journal_id, 'Destination Journal',required=True),
         'group': fields.boolean("Group by partner"),
         'invoice_date': fields.date('Invoiced date'),
     }
 
+
     def view_init(self, cr, uid, fields_list, context=None):
         if context is None:
             context = {}
@@ -78,6 +116,8 @@
             onshipdata_obj[ids] = onshipdata_obj.new_picking
 
         context['date_inv'] = onshipdata_obj['invoice_date']
+        journal_id = onshipdata_obj['journal_id']
+        context['journal_type'] =self.pool.get('account.journal').browse(cr, uid, journal_id).type
         invoice_ids = []
         for picking in picking_obj.browse(cr, uid, context.get('active_ids', []), context=context):
             if picking.invoice_state == '2binvoiced':

=== modified file 'stock_location/security/ir.model.access.csv'
--- stock_location/security/ir.model.access.csv	2010-08-11 11:34:24 +0000
+++ stock_location/security/ir.model.access.csv	2010-11-04 09:04:54 +0000
@@ -6,3 +6,5 @@
 "access_stock_location_path_manager","stock location path manager","model_stock_location_path","stock.group_stock_manager",1,1,1,1
 "access_stock_location_path_partner_manager","stock.location.path partner manager","model_stock_location_path","product.group_product_manager",1,1,1,1
 "access_stock_location_path_stock_user","stock.location.path stock user","model_stock_location_path","stock.group_stock_user",1,1,1,1
+"access_stock_location_path","stock.location.path","model_stock_location_path","base.group_sale_salesman",1,0,0,0
+"access_product_pulled_flow","product.pulled.flow","model_product_pulled_flow","base.group_sale_salesman",1,0,0,0


Follow ups