Add area_id to family

This commit is contained in:
Youssef Elouahby 2018-10-26 12:27:00 +01:00
parent 2599eb55fb
commit a9888427ec
2 changed files with 7 additions and 0 deletions

View File

@ -145,6 +145,11 @@ class GolemFamily(models.Model):
note = fields.Text() note = fields.Text()
count = fields.Integer(compute='_compute_count', store=True) count = fields.Integer(compute='_compute_count', store=True)
area_id = fields.Many2one(
'golem.partner.area', index=True, auto_join=True, string='Area',
help="Area, quarter... for statistics and activity price."
)
@api.depends('member_ids') @api.depends('member_ids')
def _compute_count(self): def _compute_count(self):
for family in self: for family in self:

View File

@ -45,6 +45,8 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
<field name="street" placeholder="Street..." /> <field name="street" placeholder="Street..." />
<field name="street2" /> <field name="street2" />
<field name="zip" placeholder="ZIP" /> <field name="zip" placeholder="ZIP" />
<field name="area_id" placeholder="Area, quarter..."
options="{'no_create': true}" />
<field name="city" placeholder="City" /> <field name="city" placeholder="City" />
</group> </group>
<group> <group>