Commit Graph

230 Commits

Author SHA1 Message Date
Olivier Dony 2bf1034cd2 [FIX] res.partner: autosync of commercial fields and address fields + correct views accordingly + basic tests
* Commercial fields (bug 1160365)

Fix autosync of accounting/invoicing-related fields on contacts,
just as if they were actually modeled as fields.related to the
parent commercial entity.
This starts with the addition of the new functional field
`commercial_id`, to locate the commercial entity for any partner.
The commercial entity is defined as the first ancestor (starting
at the partner itself) that is either marked `is_company` or has
no parent. [This is Part A of the solution on bug 1160365].

Then, whenever a partner is created or modified:
- if it is a commercial entity, the commercial fields are synced
downstream to all its descendants, stopping at company boundaries.
- if is is not a commercial entity, the commercial fields are
synced from its parent commercial entity.
The list of fields to sync is determined by calling the new
res.partner method `_commercial_fields()` which can be easily
extended by any module that adds commercial fields on res.partner.
A utility method `open_commercial_entity()` was added to
res.partner to make it easy to include a button for editing the
parent commercial entity, to be displayed instead of now-hidden
commercial fields.
[This is part B of the solution on bug 1160365]

The res.partner.address_get() method (used to find child partners
of certain types, e.g. "invoice") was udpated to take the new
"commercial entity" notion into account: it will now look for
matches in children but also parents and siblings that are part
of the same "commercial entity". The default partner `type` is
now "contact" to reflect the new model ; "default" is
inappropriate because it is a wildcard and would stop the type
lookup early.
[This composes parts C and D of the solution on bug 1160365]

Note: This fix comes with a matching addons fix to implement
module-specific extensions of part B, as well as part E of the
solution.


* Address fields (bug 1160425)

Corrected autosync of address fields is also included in the
same branch, because those two mechanisms are closely related
and share some parts of the implementation.

The `use_parent_address` field now defaults to False (except
in the mini-kanban view of contacts on a partner form), and
the autosync of address fields has been modified to only work
downstream and never update a parent company if a child contact
is modified. Instead, the address fields are now displayed
readonly on contacts that use the parent address, with a button
to edit the parent address (new method open_parent(), similar
to open_commercial_entity() but opening the direct parent).

To make the initial creation of a contact + company pair,
a special case was added: when a new contact is created for
a company that has no other contact and no address, the
address of the contact is assumed to be that of the company
so it is moved to the company, then the `use_parent_address`
flag is enabled on the contact, and the `is_company` flag on
the company. This covers a use case where contact and
company are created on-the-fly when creating a new document.

Many logical flaws in the autosync of address fields have been
corrected and are now covered by unit tests.


* Misc related fixes

- checking `is_company` does not reset the parent_id field
anymore, to allow for multi-level structures. The field is
still hidden automatically because having an empty "Company"
field on the form view of a company is quite suprising), but
this UI behavior is easily customized;
- the `email`, `phone`, `fax`, `mobile`, `lang`, etc. that
were sometimes synced when changing parent company are now
properly left alone;
- the `use_parent_address` field is now always visible next
to the parent_id field when a parent is set

lp bug: https://launchpad.net/bugs/1160425 fixed
lp bug: https://launchpad.net/bugs/1160365 fixed

bzr revid: odo@openerp.com-20130408013742-tm8w0w0nmunanokk
2013-04-08 03:37:42 +02:00
Antony Lesuisse 237d3d8500 [FIX] res.partner search, customer or supplier, related companies only for companies
bzr revid: al@openerp.com-20130223003935-eoinzil3ag3wmffq
2013-02-23 01:39:35 +01:00
Antony Lesuisse 4e6607c75c [IMP] res.partner missing group by country
bzr revid: al@openerp.com-20130125214027-usu1y7eho9gm9uld
2013-01-25 22:40:27 +01:00
Christophe Matthieu 0c59cb52c9 [FIX] res_partner: kanban view : update contact avatar on edit mode (for company partner)
bzr revid: chm@openerp.com-20130111145459-e2rp9o3bmh2p679i
2013-01-11 15:54:59 +01:00
Quentin (OpenERP) eec2a5c96c [FIX] base, res.partner.form view: removed group no one on title field as this field is sometimes filled (migration, contact creation from lead...) and sometimes used as well (in reports). Besides there is no good reason to hide it
bzr revid: qdp-launchpad@openerp.com-20121227142116-zl8n0v550pbf12ju
2012-12-27 15:21:16 +01:00
niv-openerp 692cea3039 Removed default image on partners, use default one in the kanban view if false
bzr revid: nicolas.vanhoren@openerp.com-20121221120631-2uugaiexqanwbi00
2012-12-21 13:06:31 +01:00
Olivier Dony e29f0565c9 [IMP] res.partner: form view: show phone numbers in embedded contacts kanban; search view: less confusing label `Partner` -> `Name` for default search criterion
bzr revid: odo@openerp.com-20121220131606-fiuo04pn1s66bmk1
2012-12-20 14:16:06 +01:00
Ajay Chauhan (OpenERP) 2469d3b4ab [MERGE] merge with lp:openobject-server
bzr revid: cha@tinyerp.com-20121203062636-xnhqfm6491lib2hl
2012-12-03 11:56:36 +05:30
Fabien Pinckaers f5e755c409 [IMP] saving space for partners kanban
bzr revid: fp@openerp.com-20121130082137-97qibfk3k0v6y51l
2012-11-30 09:21:37 +01:00
Ajay Chauhan (OpenERP) 15226021d2 [IMP] made supplier visible on customer form
bzr revid: cha@tinyerp.com-20121130060054-tm6x6rc3ko8j28oj
2012-11-30 11:30:54 +05:30
Fabien Pinckaers 432715b184 [IMP] category -> tag
bzr revid: fp@openerp.com-20121127221111-vbguuof91pjri4nr
2012-11-27 23:11:11 +01:00
Fabien Pinckaers 6740c05cc4 [IMP] typo
bzr revid: fp@tinyerp.com-20121126215347-cd9vxrpmfjsv1kx9
2012-11-26 22:53:47 +01:00
Quentin (OpenERP) c78d16d49e [FIX] base, res.partner.view: remove duplicated invisible attribute that was totally hiding the 'type' field
bzr revid: qdp-launchpad@openerp.com-20121126145408-dq7utnmitpeaymn1
2012-11-26 15:54:08 +01:00
Hiral Patel (OpenERP) bc63b42c04 [IMP] Change string of Search Category to Search Tag
bzr revid: hip@tinyerp.com-20121123064910-406cfczq3ftb93z2
2012-11-23 12:19:10 +05:30
Arnaud Pineux 16203707c3 [IMP] change order for top menu item sequence number
bzr revid: api@openerp.com-20121122082630-ujk49g77z1mb8gqg
2012-11-22 09:26:30 +01:00
Khushboo Bhatt (Open ERP) 7aad4d8e0d [MERGE]merge with trunk
bzr revid: kbh@tinyerp.com-20121109052642-2nte0ax6pu7oktuy
2012-11-09 10:56:42 +05:30
Quentin (OpenERP) 21af7835e0 [FIX] base, res.partner.view: remove duplicated invisible attribute that was totally hiding the 'type' field
bzr revid: qdp-launchpad@openerp.com-20121108140551-lefrv5ndvyzw5tt9
2012-11-08 15:05:51 +01:00
Khushboo Bhatt (Open ERP) fcfeee25c3 [FIX]base:menu name changed
bzr revid: kbh@tinyerp.com-20121106060828-5jo86qp14s0wu4p7
2012-11-06 11:38:28 +05:30
ajay javiya (OpenERP) e23ade6f5d [IMP]:onchange state country selected automatically
bzr revid: aja@tinyerp.com-20121025093809-k907f1m17cvg648o
2012-10-25 15:08:09 +05:30
Atul Patel (OpenERP) 6c491aa26c [FIX]: Fix parent_id problem when group by company in partner tree view
bzr revid: atp@tinyerp.com-20121018072719-xb5kjnnrvrjnhexo
2012-10-18 12:57:19 +05:30
Fabien Meghazi e8c0f38927 [REM] Removed useless css class in res.partner kanban view
bzr revid: fme@openerp.com-20121016102229-c3slg9mogr04h822
2012-10-16 12:22:29 +02:00
Fabien Pinckaers ffc34ab101 [MERGE] salesman -> salesperson
bzr revid: fp@tinyerp.com-20121015175508-iqj9n5h4i9138dw4
2012-10-15 19:55:08 +02:00
Quentin (OpenERP) c98de15a09 [IMP] osv/orm.py: evaluate in python the 'options' attribute of a field in an xml view, before enclosing it in json. This allow to use python instead of json syntax in the definition of the options of a widget, which is a much more consistent behavior
bzr revid: qdp-launchpad@openerp.com-20121009142607-rk3l00atu3w3kksp
2012-10-09 16:26:07 +02:00
Rajesh Prajapati (OpenERP) 7f0ca772a5 [IMP] res_partner : rename filter Salesman to Salesperson
bzr revid: rpr@tinyerp.com-20121004060104-xuwrvsc1powekuf1
2012-10-04 11:31:04 +05:30
Amit Patel e63dd6d1a9 [MERGE]:trunk
bzr revid: hmo@tinyerp.com-20120926110557-098p014k6heo4m8t
bzr revid: apa@tinyerp.com-20120928050541-fm2pwdviqefzbtua
2012-09-28 10:35:41 +05:30
Quentin (OpenERP) e4a87fc3db [MERGE] small usability improvement in res.partner form view
bzr revid: qdp-launchpad@openerp.com-20120926113933-v2oocyrnymquyrtu
2012-09-26 13:39:33 +02:00
Harry (OpenERP) dfb5ecc6fc [FIX] partner: sales&purchase tab visible for everybody
bzr revid: hmo@tinyerp.com-20120926102400-oq5w2hjl0wp218ao
2012-09-26 15:54:00 +05:30
Khushboo Bhatt (Open ERP) 0a276c99b5 [FIX]attrs updated
bzr revid: kbh@tinyerp.com-20120925101609-9mnwh7uz1nixbu28
2012-09-25 15:46:09 +05:30
Khushboo Bhatt (Open ERP) 3877aa2205 [FIX]sale and purchase tab do not hide when chustomer is uncheckd
bzr revid: kbh@tinyerp.com-20120924070009-4xyuo4py3dl9zws6
2012-09-24 12:30:09 +05:30
Khushboo Bhatt (Open ERP) b475a5bd2b [FIX]typo in res.partner
bzr revid: kbh@tinyerp.com-20120921132002-cwerpguowhc2vcbq
2012-09-21 18:50:02 +05:30
Divyesh Makwana (Open ERP) ba4857238c [IMP] Customer form view: uncheck Customer, how to check again? Sales & Purchases disappears.
bzr revid: mdi@tinyerp.com-20120917065022-h7gtgv9rf3s62fge
2012-09-17 12:20:22 +05:30
Harry (OpenERP) 5b2bbc732a [MERGE]
bzr revid: hmo@tinyerp.com-20120914112330-3c5bsk0d2skqryew
2012-09-14 16:53:30 +05:30
Harry (OpenERP) bb9609095b [MERGE]
bzr revid: hmo@tinyerp.com-20120914110251-81rjffzvkaxfkz4v
2012-09-14 16:32:51 +05:30
Fabien Pinckaers 73ea18f9ed [FIX] quick create of partners, better layout
bzr revid: fp@tinyerp.com-20120912174622-r9ezfmafygahjpei
2012-09-12 19:46:22 +02:00
Fabien Pinckaers 03427d0ecb [IMP] partner views
bzr revid: fp@tinyerp.com-20120912121737-ck52wn7ps96decvq
2012-09-12 14:17:37 +02:00
Fabien Pinckaers e2fc0c95a5 [IMP] quick create partners usability
bzr revid: fp@tinyerp.com-20120911161926-fk35p5wwefuwpxlx
2012-09-11 18:19:26 +02:00
Stephane Wirtel c750d0b8e1 [MERGE] Remove unused res.payterm
bzr revid: stw@openerp.com-20120911153948-bfuzz0a66qi0ncpb
2012-09-11 17:39:48 +02:00
Randhir Mayatra (OpenERP) 6fca7f4abe [IMP] improve the placeholder text
bzr revid: rma@tinyerp.com-20120911132724-nc201qmgoicvknmt
2012-09-11 18:57:24 +05:30
Olivier Dony 8e96d71bf3 [MERGE] sync with trunk
bzr revid: odo@openerp.com-20120905072646-m4269m97ej1oicoq
bzr revid: odo@openerp.com-20120905220158-ulg8jy5alny97ff3
2012-09-06 00:01:58 +02:00
vta vta@openerp.com 6493b238d7 [FIX] Fixed width in div.address_format's spans.
bzr revid: vta@openerp.com-20120905112343-bathemmuv6rtb0r9
2012-09-05 13:23:43 +02:00
niv-openerp 2a664d9429 wip
bzr revid: nicolas.vanhoren@openerp.com-20120905080344-n61yuun3fuhgufbg
2012-09-05 10:03:44 +02:00
Thibault Delavallée 12294252d4 [MERGE] Merged with server/trunk.
bzr revid: tde@openerp.com-20120903081949-ucy4e1kpbb30dhko
2012-09-03 10:19:49 +02:00
Fabien Pinckaers 310aab1a57 [IMP] usability partner logo as avatar class
bzr revid: fp@openerp.com-20120902191726-7zacp4mctooxao51
2012-09-02 21:17:26 +02:00
Thibault Delavallée fed157bcad [MERGE] Merged with server/trunk.
bzr revid: tde@openerp.com-20120831073840-4cidj68qd2rubkjs
2012-08-31 09:38:40 +02:00
Fabien Meghazi d78cd0a57d [IMP] Use 'open' action in kanban views
bzr revid: fme@openerp.com-20120829114753-s0rhr2jcb7qlvvfp
2012-08-29 13:47:53 +02:00
Turkesh Patel (Open ERP) fe359ed90c [FIX] remove unnecessary code.
bzr revid: tpa@tinyerp.com-20120823050253-ng0muqz77h5cgv14
2012-08-23 10:32:53 +05:30
Fabien Pinckaers 3c8c168f85 merge_trunk
bzr revid: fp@tinyerp.com-20120822133509-v4irlqdjjba0wxxn
2012-08-22 15:35:09 +02:00
niv-openerp 5ff60ccd9f [FIX] typo
bzr revid: nicolas.vanhoren@openerp.com-20120822092041-gl3dazdit50h7u3y
2012-08-22 11:20:41 +02:00
Thibault Delavallée 9553eb0ca2 [MERGE] Merged with server/trunk.
bzr revid: tde@openerp.com-20120822074957-laga9duu2c4mhae3
2012-08-22 09:49:57 +02:00
Fabien Pinckaers e88e21bb56 fix
bzr revid: fp@tinyerp.com-20120821172414-7kz7qcibjile1dfl
2012-08-21 19:24:14 +02:00