forked from Yaltik/golem
undo some changes
This commit is contained in:
parent
9af857a553
commit
722756b2a1
@ -22,13 +22,6 @@ from odoo import models, fields, api, _
|
|||||||
from odoo.exceptions import UserError
|
from odoo.exceptions import UserError
|
||||||
_LOGGER = logging.getLogger(__name__)
|
_LOGGER = logging.getLogger(__name__)
|
||||||
|
|
||||||
class golemTest(models.Model):
|
|
||||||
""" Partner Area """
|
|
||||||
_name = 'golem.test'
|
|
||||||
|
|
||||||
partner_id = fields.Many2one('res.partner')
|
|
||||||
nomination = fields.Char()
|
|
||||||
product_id = fields.Many2one('product.product')
|
|
||||||
|
|
||||||
class PartnerArea(models.Model):
|
class PartnerArea(models.Model):
|
||||||
""" Partner Area """
|
""" Partner Area """
|
||||||
@ -116,27 +109,6 @@ class GolemMember(models.Model):
|
|||||||
|
|
||||||
partner_id = fields.Many2one('res.partner', required=True, index=True,
|
partner_id = fields.Many2one('res.partner', required=True, index=True,
|
||||||
ondelete='cascade')
|
ondelete='cascade')
|
||||||
def membership_invoice_action(self):
|
|
||||||
self.ensure_one()
|
|
||||||
member = self[0]
|
|
||||||
action = self.env.ref('golem_member.golem_membership_invoice_action').read()[0]
|
|
||||||
action['domain'] = [('partner_id', 'in', member.legal_guardian_ids.ids)]
|
|
||||||
return action
|
|
||||||
#action = self.env.ref('golem_member.golem_test_action2').read()[0]
|
|
||||||
#return action
|
|
||||||
#lst = member.legal_guardian_ids.ids
|
|
||||||
#return {
|
|
||||||
# 'name': _('Next activity'),
|
|
||||||
# 'res_model': 'golem.test',
|
|
||||||
# 'context': {},
|
|
||||||
# 'domain' : [('product_id.type', '=', 'service')],
|
|
||||||
# 'type': 'ir.actions.act_window',
|
|
||||||
# 'view_id': False,
|
|
||||||
# 'view_mode': 'form',
|
|
||||||
# 'target': 'new',
|
|
||||||
# 'view_type': 'form'
|
|
||||||
#}
|
|
||||||
|
|
||||||
|
|
||||||
@api.model
|
@api.model
|
||||||
def default_season(self):
|
def default_season(self):
|
||||||
|
@ -131,7 +131,7 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
|
|||||||
<div>
|
<div>
|
||||||
<field name="partner_id" invisible="True" required="False" />
|
<field name="partner_id" invisible="True" required="False" />
|
||||||
<field name="membership_state"/>
|
<field name="membership_state"/>
|
||||||
<button name="%(golem_membership_invoice_action)d"
|
<button name="%(golem_membership_invoice_action)d"
|
||||||
type="action" string="Buy Membership"
|
type="action" string="Buy Membership"
|
||||||
attrs="{'invisible':[('free_member','=',True)]}"
|
attrs="{'invisible':[('free_member','=',True)]}"
|
||||||
context="{'default_partner_id': partner_id}"
|
context="{'default_partner_id': partner_id}"
|
||||||
|
Loading…
x
Reference in New Issue
Block a user