Skip to content

GitLab

  • Menu
Projects Groups Snippets
  • Help
    • Help
    • Support
    • Community forum
    • Submit feedback
    • Contribute to GitLab
  • Sign in / Register
  • G generic-addons
  • Project information
    • Project information
    • Activity
    • Labels
    • Members
  • Repository
    • Repository
    • Files
    • Commits
    • Branches
    • Tags
    • Contributors
    • Graph
    • Compare
  • Issues 20
    • Issues 20
    • List
    • Boards
    • Service Desk
    • Milestones
  • Merge requests 3
    • Merge requests 3
  • CI/CD
    • CI/CD
    • Pipelines
    • Jobs
    • Schedules
  • Deployments
    • Deployments
    • Environments
    • Releases
  • Monitor
    • Monitor
    • Incidents
  • Packages & Registries
    • Packages & Registries
    • Container Registry
  • Analytics
    • Analytics
    • Value stream
    • CI/CD
    • Repository
  • Wiki
    • Wiki
  • Activity
  • Graph
  • Create a new issue
  • Jobs
  • Commits
  • Issue Boards
Collapse sidebar
  • crnd-opensource
  • generic-addons
  • Issues
  • #11

Closed
Open
Created Jun 24, 2018 by Dmytro Katyukha@katyukhaOwner

generic_location_address addon: Add addresses to generic locations

Idea

Generic Locations at this time are just names of locations. But in most cases it is not enough, and location address is needed.

As i see, there are two options to add address to location:

  1. reference to res.partner
  2. add set of address-related fields referencing res.country, res.country.state, res.city, etc

First approach is very simple to implement, but i think partner models is too complex to use it as address. Second approach is little bit more complex, and requires a set of fields to be added to generic.location model, idealy with onchanges and proper domains to simplify address input.

So we have to add following fields to generic.location object according to second approach:

  • Country
  • Country State
  • City
  • street
  • street2

Onchanges have to implement following logic:

  • if Country is changed then State have to be cleared

Following domains have to be added to fields:

  • State have to be filtered by selected country. if country is not selected, then state cannot be selected

Note that this addon will not take into account base_address_city and integration with base_address_city have to be done in separate addon.

Also generic locations are hierarchial structures, thus we need some logic to use address of parent location if current location have no own address. It may be done on per field basis, for example - parent location is address representing building with Country, State, City, Street fields filled. Sublocations represent rooms / appartments in this building with only street2 field filled. Thus sublocation's address is a combination of Country, State, City, Street fields from parent location and Street2 field from sublocation

Edited Jun 24, 2018 by Dmytro Katyukha
Assignee
Assign to
Time tracking