← Back to team overview

c2c-oerpscenario team mailing list archive

[Bug 816561] [NEW] Pb with complex domain expressions

 

Public bug reported:

I have a problem with complex domain expressions ; it may be a bug of
the OpenERP server, but it may also be a bad domain expression due to a
bad comprehension of the way it is supposed to work.

In an ir.actions.act_window on the object account.invoice :

1) I want to filter on open invoice/refunds that are either from Asustek
with country = Taiwan or from Direct PC with country = Belgium, so I
write the following expression :

<field name="domain">['&amp;', '|', '&amp;',
('address_invoice_id.country_id.name', '=', 'Taiwan'),
('partner_id.name', '=', 'ASUStek'), '&amp;',
('address_invoice_id.country_id.name', '=', 'Belgium'),
('partner_id.name', '=', 'Distrib PC'), ('state', '=', 'open')]</field>

Result : it works OK.

2) I want to filter on open customer invoices that are either from
Asustek with country = Taiwan or from Direct PC with country = Belgium,
so I write the following expression :

<field name="domain">['&amp;', '&amp;', '|', '&amp;',
('address_invoice_id.country_id.name', '=', 'Taiwan'),
('partner_id.name', '=', 'ASUStek'), '&amp;',
('address_invoice_id.country_id.name', '=', 'Belgium'),
('partner_id.name', '=', 'Distrib PC'), ('state', '=', 'open'), ('type',
'=', 'out_invoice')]</field>

Result : NOT OK, I get ALL the invoices !

I have this problem with OpenERP server branch 5.0 and branch 6.0 ; I
wanted to test on trunk, but I can't find the "Modules" menu entry to
install my module !

By the way, my source of information about complex domain expressions is this one :
http://christophe-simonis-at-tiny.blogspot.com/2008/08/new-new-domain-notation.html
plus wikipedia to understand "polish expressions" and "arity".

** Affects: openobject-server
     Importance: Undecided
         Status: New

** Description changed:

  I have a problem with complex domain expressions ; it may be a bug of
  the OpenERP server, but it may also be a bad domain expression due to a
  bad comprehension of the way it is supposed to work.
  
  In an ir.actions.act_window on the object account.invoice :
  
  1) I want to filter on open invoice/refunds that are either from Asustek
  with country = Taiwan or from Direct PC with country = Belgium, so I
  write the following expression :
  
- <field name="domain">['&amp;', '|', '&amp;', ('address_invoice_id.country_id.name', 
-                  '=', 'Taiwan'), ('partner_id.name', '=', 'ASUStek'), '&amp;', 
-                  ('address_invoice_id.country_id.name', '=', 'Belgium'), ('partner_id.name', '=', 
-                  'Distrib PC'), ('state', '=', 'open')]</field>
+ <field name="domain">['&amp;', '|', '&amp;', ('address_invoice_id.country_id.name', '=', 'Taiwan'), ('partner_id.name', '=', 'ASUStek'), '&amp;',
+                  ('address_invoice_id.country_id.name', '=', 'Belgium'), ('partner_id.name', '=', 'Distrib PC'), ('state', '=', 'open')]</field>
  
  Result : it works OK.
  
  2) I want to filter on open customer invoices that are either from
  Asustek with country = Taiwan or from Direct PC with country = Belgium,
  so I write the following expression :
  
  <field name="domain">['&amp;', '&amp;', '|', '&amp;',
  ('address_invoice_id.country_id.name', '=', 'Taiwan'),
  ('partner_id.name', '=', 'ASUStek'), '&amp;',
  ('address_invoice_id.country_id.name', '=', 'Belgium'),
  ('partner_id.name', '=', 'Distrib PC'), ('state', '=', 'open'), ('type',
  '=', 'out_invoice')]</field>
  
  Result : NOT OK, I get ALL the invoices !
  
  I have this problem with OpenERP server branch 5.0 and branch 6.0 ; I
  wanted to test on trunk, but I can't find the "Modules" menu entry to
  install my module !
  
  By the way, my source of information about complex domain expressions is this one :
  http://christophe-simonis-at-tiny.blogspot.com/2008/08/new-new-domain-notation.html
  plus wikipedia to understand "polish expressions" and "arity".

** Description changed:

  I have a problem with complex domain expressions ; it may be a bug of
  the OpenERP server, but it may also be a bad domain expression due to a
  bad comprehension of the way it is supposed to work.
  
  In an ir.actions.act_window on the object account.invoice :
  
  1) I want to filter on open invoice/refunds that are either from Asustek
  with country = Taiwan or from Direct PC with country = Belgium, so I
  write the following expression :
  
- <field name="domain">['&amp;', '|', '&amp;', ('address_invoice_id.country_id.name', '=', 'Taiwan'), ('partner_id.name', '=', 'ASUStek'), '&amp;',
-                  ('address_invoice_id.country_id.name', '=', 'Belgium'), ('partner_id.name', '=', 'Distrib PC'), ('state', '=', 'open')]</field>
+ <field name="domain">['&amp;', '|', '&amp;',
+ ('address_invoice_id.country_id.name', '=', 'Taiwan'),
+ ('partner_id.name', '=', 'ASUStek'), '&amp;',
+ ('address_invoice_id.country_id.name', '=', 'Belgium'),
+ ('partner_id.name', '=', 'Distrib PC'), ('state', '=', 'open')]</field>
  
  Result : it works OK.
  
  2) I want to filter on open customer invoices that are either from
  Asustek with country = Taiwan or from Direct PC with country = Belgium,
  so I write the following expression :
  
  <field name="domain">['&amp;', '&amp;', '|', '&amp;',
  ('address_invoice_id.country_id.name', '=', 'Taiwan'),
  ('partner_id.name', '=', 'ASUStek'), '&amp;',
  ('address_invoice_id.country_id.name', '=', 'Belgium'),
  ('partner_id.name', '=', 'Distrib PC'), ('state', '=', 'open'), ('type',
  '=', 'out_invoice')]</field>
  
  Result : NOT OK, I get ALL the invoices !
  
  I have this problem with OpenERP server branch 5.0 and branch 6.0 ; I
  wanted to test on trunk, but I can't find the "Modules" menu entry to
  install my module !
  
  By the way, my source of information about complex domain expressions is this one :
  http://christophe-simonis-at-tiny.blogspot.com/2008/08/new-new-domain-notation.html
  plus wikipedia to understand "polish expressions" and "arity".

-- 
You received this bug notification because you are a member of C2C
OERPScenario, which is subscribed to the OpenERP Project Group.
https://bugs.launchpad.net/bugs/816561

Title:
  Pb with complex domain expressions

Status in OpenERP Server:
  New

Bug description:
  I have a problem with complex domain expressions ; it may be a bug of
  the OpenERP server, but it may also be a bad domain expression due to
  a bad comprehension of the way it is supposed to work.

  In an ir.actions.act_window on the object account.invoice :

  1) I want to filter on open invoice/refunds that are either from
  Asustek with country = Taiwan or from Direct PC with country =
  Belgium, so I write the following expression :

  <field name="domain">['&amp;', '|', '&amp;',
  ('address_invoice_id.country_id.name', '=', 'Taiwan'),
  ('partner_id.name', '=', 'ASUStek'), '&amp;',
  ('address_invoice_id.country_id.name', '=', 'Belgium'),
  ('partner_id.name', '=', 'Distrib PC'), ('state', '=',
  'open')]</field>

  Result : it works OK.

  2) I want to filter on open customer invoices that are either from
  Asustek with country = Taiwan or from Direct PC with country =
  Belgium, so I write the following expression :

  <field name="domain">['&amp;', '&amp;', '|', '&amp;',
  ('address_invoice_id.country_id.name', '=', 'Taiwan'),
  ('partner_id.name', '=', 'ASUStek'), '&amp;',
  ('address_invoice_id.country_id.name', '=', 'Belgium'),
  ('partner_id.name', '=', 'Distrib PC'), ('state', '=', 'open'),
  ('type', '=', 'out_invoice')]</field>

  Result : NOT OK, I get ALL the invoices !

  I have this problem with OpenERP server branch 5.0 and branch 6.0 ; I
  wanted to test on trunk, but I can't find the "Modules" menu entry to
  install my module !

  By the way, my source of information about complex domain expressions is this one :
  http://christophe-simonis-at-tiny.blogspot.com/2008/08/new-new-domain-notation.html
  plus wikipedia to understand "polish expressions" and "arity".

To manage notifications about this bug go to:
https://bugs.launchpad.net/openobject-server/+bug/816561/+subscriptions


Follow ups

References