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
1=== modified file 'product/product_view.xml'
2--- product/product_view.xml 2011-10-25 14:13:28 +0000
3+++ product/product_view.xml 2011-11-03 14:22:38 +0000
4@@ -46,6 +46,7 @@
5 <field eval="7" name="priority"/>
6 <field name="arch" type="xml">
7 <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">
8+ <field name="partner_ref" invisible="not context.get('partner_id')"/>
9 <field name="default_code"/>
10 <field name="name"/>
11 <field name="categ_id" invisible="1"/>
12
13=== modified file 'stock/wizard/stock_location_product.py'
14--- stock/wizard/stock_location_product.py 2011-02-03 14:21:24 +0000
15+++ stock/wizard/stock_location_product.py 2011-11-03 14:22:38 +0000
16@@ -27,6 +27,7 @@
17 _columns = {
18 'from_date': fields.datetime('From'),
19 'to_date': fields.datetime('To'),
20+ 'partner_id': fields.many2one('res.partner', "Display Partner's references"),
21 }
22
23 def action_open_window(self, cr, uid, ids, context=None):
24@@ -39,7 +40,9 @@
25 @return: Invoice type
26 """
27 mod_obj = self.pool.get('ir.model.data')
28- for location_obj in self.read(cr, uid, ids, ['from_date', 'to_date'], context=context):
29+ for location_obj in self.read(cr, uid, ids,
30+ ['from_date', 'to_date', 'partner_id'],
31+ context=context):
32 return {
33 'name': False,
34 'view_type': 'form',
35@@ -48,7 +51,8 @@
36 'type': 'ir.actions.act_window',
37 'context': {'location': context['active_id'],
38 'from_date': location_obj['from_date'],
39- 'to_date': location_obj['to_date']},
40+ 'to_date': location_obj['to_date'],
41+ 'partner_id': location_obj['partner_id'][0]},
42 'domain': [('type', '<>', 'service')],
43 }
44
45
46=== modified file 'stock/wizard/stock_location_product_view.xml'
47--- stock/wizard/stock_location_product_view.xml 2011-01-14 00:11:01 +0000
48+++ stock/wizard/stock_location_product_view.xml 2011-11-03 14:22:38 +0000
49@@ -14,6 +14,10 @@
50 <newline/>
51 <label string=""/>
52 <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"/>
53+ <group colspan="4" groups="base.group_extended">
54+ <separator string="Additional information" colspan="4"/>
55+ <field name="partner_id" colspan="4"/>
56+ </group>
57 <separator string="" colspan="4" />
58 <label string=""/>
59 <button special="cancel" string="_Cancel" icon="gtk-cancel" />

Subscribers

People subscribed via source and target branches

to all changes: