Skip to content

Commit

Permalink
Add option to print ProClima logo
Browse files Browse the repository at this point in the history
  • Loading branch information
yvaucher committed Mar 6, 2017
1 parent 98a5df7 commit d95bf54
Show file tree
Hide file tree
Showing 4 changed files with 20 additions and 0 deletions.
1 change: 1 addition & 0 deletions delivery_carrier_label_postlogistics/models/company.py
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,7 @@ class ResCompany(models.Model):
string="Tracking number format",
default='postlogistics',
)
postlogistics_proclima_logo = fields.Boolean('Print ProClima logo')

@api.depends('postlogistics_test_mode')
def _get_wsdl_url(self):
Expand Down
8 changes: 8 additions & 0 deletions delivery_carrier_label_postlogistics/models/res_config.py
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,14 @@ def _default_company(self):
"digits of picking name and add the pack number. 2 digits for"
"pack number and 6 digits for picking number. (eg. 07000042 "
"for picking 42 and 7th pack")
proclima_logo = fields.Boolean(
related='company_id.postlogistics_proclima_logo',
help="The “pro clima” logo indicates an item for which the "
"surcharge for carbon-neutral shipping has been paid and a "
"contract to that effect has been signed. For Letters with "
"barcode (BMB) domestic, the ProClima logo is printed "
"automatically (at no additional charge)"
)

@api.onchange('company_id')
def onchange_company_id(self):
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -298,6 +298,8 @@ def _prepare_attributes(self, picking, pack_num=None, pack_total=None):
})
if 'ZAW3219' in option_codes and picking.delivery_place:
attributes['DeliveryPlace'] = picking.delivery_place
if picking.company_id.postlogistics_proclima_logo:
attributes['ProClima'] = True
return attributes

def _get_itemid(self, picking, pack_no):
Expand Down
9 changes: 9 additions & 0 deletions delivery_carrier_label_postlogistics/views/res_config.xml
Original file line number Diff line number Diff line change
Expand Up @@ -90,6 +90,15 @@
</div>
</div>
</group>
<separator string="Other"/>
<group>
<div>
<div>
<label for="proclima_logo"/>
<field name="proclima_logo" class="oe_inline"/>
</div>
</div>
</group>
<group>
<div>
<div>
Expand Down

0 comments on commit d95bf54

Please sign in to comment.