Merge lp:~numerigraphe/openobject-addons/trunk-stock-wizard-partner into lp:openobject-addons

Proposed by Numérigraphe
Status: Superseded
Proposed branch: lp:~numerigraphe/openobject-addons/trunk-stock-wizard-partner
Merge into: lp:openobject-addons
Diff against target: 59 lines (+11/-2)
3 files modified
product/product_view.xml (+1/-0)
stock/wizard/stock_location_product.py (+6/-2)
stock/wizard/stock_location_product_view.xml (+4/-0)
To merge this branch: bzr merge lp:~numerigraphe/openobject-addons/trunk-stock-wizard-partner
Reviewer Review Type Date Requested Status
OpenERP Core Team Pending
Review via email: mp+81154@code.launchpad.net

This proposal has been superseded by a proposal from 2011-11-16.

Description of the change

This branch adds a field to the wizard "stock by location" to let users set a partner context for the product list.
This partner context is used to display the partner's ref along with the product data in the tree view.
This is available to users in the group "extended view".

To post a comment you must log in.
Revision history for this message
Fabien (Open ERP) (fp-tinyerp) wrote :

Hello,

It's a good contribution but I suggest to put this new feature in a separate module.
We prefer not to add this by default as most of the customers do not need this.

Revision history for this message
Numérigraphe (numerigraphe) wrote :

OK I'll resubmit a module version of this later on.
Thanks for checking.
Lionel.

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
=== modified file 'product/product_view.xml'
--- product/product_view.xml 2011-10-25 14:13:28 +0000
+++ product/product_view.xml 2011-11-03 14:22:38 +0000
@@ -46,6 +46,7 @@
46 <field eval="7" name="priority"/>46 <field eval="7" name="priority"/>
47 <field name="arch" type="xml">47 <field name="arch" type="xml">
48 <tree colors="red:virtual_available&lt;0;blue:virtual_available&gt;=0 and state in ('draft', 'end', 'obsolete');black:virtual_available&gt;=0 and state not in ('draft', 'end', 'obsolete')" string="Products">48 <tree colors="red:virtual_available&lt;0;blue:virtual_available&gt;=0 and state in ('draft', 'end', 'obsolete');black:virtual_available&gt;=0 and state not in ('draft', 'end', 'obsolete')" string="Products">
49 <field name="partner_ref" invisible="not context.get('partner_id')"/>
49 <field name="default_code"/>50 <field name="default_code"/>
50 <field name="name"/>51 <field name="name"/>
51 <field name="categ_id" invisible="1"/>52 <field name="categ_id" invisible="1"/>
5253
=== modified file 'stock/wizard/stock_location_product.py'
--- stock/wizard/stock_location_product.py 2011-02-03 14:21:24 +0000
+++ stock/wizard/stock_location_product.py 2011-11-03 14:22:38 +0000
@@ -27,6 +27,7 @@
27 _columns = {27 _columns = {
28 'from_date': fields.datetime('From'), 28 'from_date': fields.datetime('From'),
29 'to_date': fields.datetime('To'), 29 'to_date': fields.datetime('To'),
30 'partner_id': fields.many2one('res.partner', "Display Partner's references"),
30 }31 }
3132
32 def action_open_window(self, cr, uid, ids, context=None):33 def action_open_window(self, cr, uid, ids, context=None):
@@ -39,7 +40,9 @@
39 @return: Invoice type40 @return: Invoice type
40 """41 """
41 mod_obj = self.pool.get('ir.model.data')42 mod_obj = self.pool.get('ir.model.data')
42 for location_obj in self.read(cr, uid, ids, ['from_date', 'to_date'], context=context):43 for location_obj in self.read(cr, uid, ids,
44 ['from_date', 'to_date', 'partner_id'],
45 context=context):
43 return {46 return {
44 'name': False, 47 'name': False,
45 'view_type': 'form', 48 'view_type': 'form',
@@ -48,7 +51,8 @@
48 'type': 'ir.actions.act_window', 51 'type': 'ir.actions.act_window',
49 'context': {'location': context['active_id'], 52 'context': {'location': context['active_id'],
50 'from_date': location_obj['from_date'], 53 'from_date': location_obj['from_date'],
51 'to_date': location_obj['to_date']}, 54 'to_date': location_obj['to_date'],
55 'partner_id': location_obj['partner_id'][0]},
52 'domain': [('type', '<>', 'service')], 56 'domain': [('type', '<>', 'service')],
53 }57 }
5458
5559
=== modified file 'stock/wizard/stock_location_product_view.xml'
--- stock/wizard/stock_location_product_view.xml 2011-01-14 00:11:01 +0000
+++ stock/wizard/stock_location_product_view.xml 2011-11-03 14:22:38 +0000
@@ -14,6 +14,10 @@
14 <newline/>14 <newline/>
15 <label string=""/>15 <label string=""/>
16 <label string="(Keep empty to open the current situation. Adjust HH:MM:SS to 00:00:00 to filter all resources of the day for the 'From' date and 23:59:59 for the 'To' date)" align="0.0" colspan="3"/>16 <label string="(Keep empty to open the current situation. Adjust HH:MM:SS to 00:00:00 to filter all resources of the day for the 'From' date and 23:59:59 for the 'To' date)" align="0.0" colspan="3"/>
17 <group colspan="4" groups="base.group_extended">
18 <separator string="Additional information" colspan="4"/>
19 <field name="partner_id" colspan="4"/>
20 </group>
17 <separator string="" colspan="4" />21 <separator string="" colspan="4" />
18 <label string=""/>22 <label string=""/>
19 <button special="cancel" string="_Cancel" icon="gtk-cancel" />23 <button special="cancel" string="_Cancel" icon="gtk-cancel" />

Subscribers

People subscribed via source and target branches

to all changes: