← Back to team overview

c2c-oerpscenario team mailing list archive

[Bug 660506] Re: Useless _('...') in _constraints messages (v. 6.0)

 

Hello Jordi,

It's true that it is not necessary to use _( ) in constraints because the ORM translates the constraints automatically when needed.
However you should not worry about it because these calls are in fact evaluated only once when the server starts, outside of any language context, so the _( ) call has no effect.

But you're right, we can remove them :-)

** Changed in: openobject-addons
   Importance: Undecided => Low

** Changed in: openobject-addons
       Status: New => Confirmed

** Changed in: openobject-addons
    Milestone: None => 6.0-rc2

-- 
Useless _('...') in _constraints messages (v. 6.0)
https://bugs.launchpad.net/bugs/660506
You received this bug notification because you are a member of C2C
OERPScenario, which is subscribed to OpenERP OpenObject.

Status in OpenObject Addons Modules: Confirmed

Bug description:
There are some useless _('...') in _constraints and _sql_constraints messages (v. 6.0) that could be removed. I suppose that the English texts extracted from this messages to create .pot files will be wrong if _('...') are no removed.

$ grep -r " _constraints" * -A 1|grep "_("

account/account.py-        (_check_percent, _('Percentages for Payment Term Line must be between 0 and 1, Example: 0.02 for 2% '), ['value_amount']),

marketing_campaign/marketing_campaign.py-        (_check_model, _('Model of filter must be same as resource model of Campaign '), ['ir_filter_id,campaign_id']),

marketing_campaign/marketing_campaign.py-            (_check_campaign, _('The To/From Activity of transition must be of the same Campaign '), ['activity_from_id,activity_to_id']),

product/pricelist.py-        (_check_recursion, _('Error ! You cannot assign the Main Pricelist as Other Pricelist in PriceList Item!'), ['base_pricelist_id'])

project/project.py-        (_check_recursion, _('Error ! You cannot create recursive tasks.'), ['parent_ids'])


$ grep -r "sql_constraints" * -A 1|grep "_("

base/res/res_user.py-        ('login_key', 'UNIQUE (login)',  _('You can not have two users with the same login !'))

email_template/email_template.py-        ('name', 'unique (name)', _('The template name must be unique !'))

stock/stock.py-        ('name_ref_uniq', 'unique (name, ref)', _('The combination of serial number and internal reference must be unique !')),





References