Use filters to exclude companies by default

This commit is contained in:
Daniel Berteaud 2023-10-24 21:53:54 +02:00
parent 43151cb3a2
commit 5238af22d1
1 changed files with 4 additions and 6 deletions

View File

@ -27,7 +27,9 @@ my $conf = {
user => undef,
password => undef,
database => undef,
filters => []
filters => [
["is_compagny", "=", "False"]
]
},
dav => {
url => undef,
@ -165,12 +167,8 @@ sub prompt_pass {
}
my %odoo_uuid = ();
foreach my $contact_id (@{$odoo->search('res.partner', [])}){
foreach my $contact_id (@{$odoo->search('res.partner', $conf->{odoo}->{filters})}){
my $contact = $odoo->read('res.partner', [ $contact_id ])->[0];
if (defined $contact->{is_company}){
print "Skiping $contact->{name} because it's a company\n";
next;
}
my $vcard =<<_EOV;
BEGIN:VCARD