Merge lp:~camptocamp/carriers-deliveries/7.0-base_delivery_carrier_label-improve-carrier-type into lp:~stock-logistic-core-editors/carriers-deliveries/7.0

Proposed by Yannick Vaucher @ Camptocamp
Status: Merged
Merged at revision: 19
Proposed branch: lp:~camptocamp/carriers-deliveries/7.0-base_delivery_carrier_label-improve-carrier-type
Merge into: lp:~stock-logistic-core-editors/carriers-deliveries/7.0
Diff against target: 18 lines (+5/-1)
1 file modified
base_delivery_carrier_label/delivery.py (+5/-1)
To merge this branch: bzr merge lp:~camptocamp/carriers-deliveries/7.0-base_delivery_carrier_label-improve-carrier-type
Reviewer Review Type Date Requested Status
Pedro Manuel Baeza code review Approve
David BEAL (ak) (community) Approve
Review via email: mp+208384@code.launchpad.net

Description of the change

As discussed on community list this is a better way to handle field selection inheritance.

Other linked MP:
https://code.launchpad.net/~camptocamp/carriers-deliveries/7.0-delivery_carrier_label_postlogistics-improve-carrier-type/+merge/208383

To post a comment you must log in.
11. By Yannick Vaucher @ Camptocamp

docstring

Revision history for this message
David BEAL (ak) (davidbeal) wrote :

LGTM

review: Approve
Revision history for this message
Pedro Manuel Baeza (pedro.baeza) wrote :

LGTM

review: Approve (code review)

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'base_delivery_carrier_label/delivery.py'
2--- base_delivery_carrier_label/delivery.py 2013-11-27 06:54:16 +0000
3+++ base_delivery_carrier_label/delivery.py 2014-02-26 14:47:26 +0000
4@@ -70,9 +70,13 @@
5 """ To inherit to add carrier type """
6 return []
7
8+ def __get_carrier_type_selection(self, cr, uid, context=None):
9+ """ Wrapper to preserve inheritance for selection field """
10+ return self._get_carrier_type_selection(cr, uid, context=context)
11+
12 _columns = {
13 'type': fields.selection(
14- _get_carrier_type_selection, 'Type',
15+ __get_carrier_type_selection, 'Type',
16 help="Carrier type (combines several delivery methods)"),
17 'code': fields.char(
18 'Code', size=10,

Subscribers

People subscribed via source and target branches