diff --git a/sign_stamp/__init__.py b/sign_stamp/__init__.py new file mode 100644 index 00000000000..0650744f6bc --- /dev/null +++ b/sign_stamp/__init__.py @@ -0,0 +1 @@ +from . import models diff --git a/sign_stamp/__manifest__.py b/sign_stamp/__manifest__.py new file mode 100644 index 00000000000..4b8ec0fd3cc --- /dev/null +++ b/sign_stamp/__manifest__.py @@ -0,0 +1,15 @@ +{ + 'author': 'Odoo S.A.', + 'name': 'Sign Stamp', + 'description': """ + add stamp field in sing app + """, + 'data': [ + 'data/sign_data.xml', + 'views/sign_request_templates.xml' + ], + 'depends': ['sign'], + 'license': 'LGPL-3', + 'application': True, + 'installable': True +} diff --git a/sign_stamp/data/sign_data.xml b/sign_stamp/data/sign_data.xml new file mode 100644 index 00000000000..9ac2653316a --- /dev/null +++ b/sign_stamp/data/sign_data.xml @@ -0,0 +1,12 @@ + + + + Test Stamp + stamp + stamp + Company Address City Country VAT Number + 0.3 + 0.1 + fa-circle + + diff --git a/sign_stamp/models/__init__.py b/sign_stamp/models/__init__.py new file mode 100644 index 00000000000..e97cd7d1936 --- /dev/null +++ b/sign_stamp/models/__init__.py @@ -0,0 +1,2 @@ +from . import res_user +from . import sign_request_item diff --git a/sign_stamp/models/res_user.py b/sign_stamp/models/res_user.py new file mode 100644 index 00000000000..d2c6331afdf --- /dev/null +++ b/sign_stamp/models/res_user.py @@ -0,0 +1,18 @@ +from odoo import models, fields + +STAMP_USER_FIELDS = ["stamp_sign_stamp", "stamp_sign_stamp_frame"] + + +class ResUsers(models.Model): + _inherit = "res.users" + + @property + def SELF_READABLE_FIELDS(self): + return super().SELF_READABLE_FIELDS + STAMP_USER_FIELDS + + @property + def SELF_WRITEABLE_FIELDS(self): + return super().SELF_WRITEABLE_FIELDS + STAMP_USER_FIELDS + + stamp_sign_stamp = fields.Binary(string="Company Stamp", copy=False, groups="base.group_user") + stamp_sign_stamp_frame = fields.Binary(string="Company Stamp Frame", copy=False, groups="base.group_user") diff --git a/sign_stamp/models/sign_request_item.py b/sign_stamp/models/sign_request_item.py new file mode 100644 index 00000000000..11dee43f924 --- /dev/null +++ b/sign_stamp/models/sign_request_item.py @@ -0,0 +1,19 @@ +from odoo import models + + +class SignRequestItem(models.Model): + _inherit = "sign.request.item" + + def _get_user_stamp(self, stamp_type='stamp_sign_stamp'): + self.ensure_one() + stamp_user = self.partner_id.user_ids[:1] + if stamp_user and stamp_type in ['stamp_sign_stamp']: + return stamp_user[stamp_type] + return False + + def _get_user_stamp_frame(self, stamp_type='stamp_sign_stamp_frame'): + self.ensure_one() + stamp_user = self.partner_id.user_ids[:1] + if stamp_user and stamp_type in ['stamp_sign_stamp_frame']: + return stamp_user[stamp_type] + return False diff --git a/sign_stamp/views/sign_request_templates.xml b/sign_stamp/views/sign_request_templates.xml new file mode 100644 index 00000000000..d364e8b1948 --- /dev/null +++ b/sign_stamp/views/sign_request_templates.xml @@ -0,0 +1,32 @@ + + + +